summaryrefslogtreecommitdiff
path: root/source3/web
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-11-12 07:13:06 +0000
committerAndrew Tridgell <tridge@samba.org>1998-11-12 07:13:06 +0000
commitc287a820572c90b05175356bf2bb9d7f72c1a9d3 (patch)
tree59b7ceb9dcbf4143a2551e498e8bff6917a6a6f5 /source3/web
parent29e36b713468d7e7de301c483fc340ef42b4a9fb (diff)
downloadsamba-c287a820572c90b05175356bf2bb9d7f72c1a9d3.tar.gz
samba-c287a820572c90b05175356bf2bb9d7f72c1a9d3.tar.bz2
samba-c287a820572c90b05175356bf2bb9d7f72c1a9d3.zip
fixed demo mode
(This used to be commit 530a98022e5207772980fc7d286547686713927a)
Diffstat (limited to 'source3/web')
-rw-r--r--source3/web/swat.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/web/swat.c b/source3/web/swat.c
index 67582bc116..0c1576edbc 100644
--- a/source3/web/swat.c
+++ b/source3/web/swat.c
@@ -29,6 +29,7 @@
#define GLOBALS_SNUM -1
static pstring servicesf = CONFIGFILE;
+static BOOL demo_mode = False;
/*
* Password Management Globals
@@ -581,12 +582,17 @@ static BOOL change_password(const char *remote_machine, char *user_name,
char *old_passwd, char *new_passwd,
BOOL add_user, BOOL enable_user, BOOL disable_user)
{
+ if (demo_mode) {
+ printf("password change in demo mode rejected\n<p>");
+ return False;
+ }
+
if (remote_machine != NULL) {
return remote_password_change(remote_machine, user_name, old_passwd, new_passwd);
}
if(!initialize_password_db()) {
- printf("Can't setup password database vectors.\n");
+ printf("Can't setup password database vectors.\n<p>");
return False;
}
@@ -802,7 +808,6 @@ static void printers_page(void)
extern FILE *dbf;
int opt;
char *page;
- int auth_required = 1;
/* just in case it goes wild ... */
alarm(300);
@@ -817,12 +822,12 @@ static void printers_page(void)
pstrcpy(servicesf,optarg);
break;
case 'a':
- auth_required = 0;
+ demo_mode = True;
break;
}
}
- cgi_setup(SWATDIR, auth_required);
+ cgi_setup(SWATDIR, !demo_mode);
print_header();
@@ -840,7 +845,7 @@ static void printers_page(void)
page = cgi_pathinfo();
/* Root gets full functionality */
- if (am_root() == True) {
+ if (demo_mode || am_root()) {
if (strcmp(page, "globals")==0) {
globals_page();
} else if (strcmp(page,"shares")==0) {