From c287a820572c90b05175356bf2bb9d7f72c1a9d3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 12 Nov 1998 07:13:06 +0000 Subject: fixed demo mode (This used to be commit 530a98022e5207772980fc7d286547686713927a) --- source3/web/swat.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'source3') 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

"); + 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

"); 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) { -- cgit