From f61683195340baa58e2637811350dbc2c5e6af01 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 14 Nov 1998 02:14:30 +0000 Subject: allow all user to view the config (This used to be commit ab35d99e52225b0e9f519903ae99e575075187e7) --- source3/web/swat.c | 58 +++++++++++++++++++++--------------------------------- 1 file changed, 22 insertions(+), 36 deletions(-) (limited to 'source3') diff --git a/source3/web/swat.c b/source3/web/swat.c index 4d12e4b2f41..db21fbfbe10 100644 --- a/source3/web/swat.c +++ b/source3/web/swat.c @@ -406,16 +406,11 @@ static void show_main_buttons(void) { image_link("Home", "", "images/home.gif"); - /* Root gets full functionality */ - if (demo_mode || am_root()) { - image_link("Globals", "globals", "images/globals.gif"); - image_link("Shares", "shares", "images/shares.gif"); - image_link("Printers", "printers", "images/printers.gif"); - image_link("Status", "status", "images/status.gif"); - image_link("View Config", "viewconfig","images/viewconfig.gif"); - } - - /* Everyone gets this functionality */ + image_link("Globals", "globals", "images/globals.gif"); + image_link("Shares", "shares", "images/shares.gif"); + image_link("Printers", "printers", "images/printers.gif"); + image_link("Status", "status", "images/status.gif"); + image_link("View Config", "viewconfig","images/viewconfig.gif"); image_link("Password Management", "passwd", "images/passwd.gif"); printf("
\n"); @@ -642,7 +637,7 @@ static void chg_passwd(void) * If current user is not root, make sure old password has been specified * If REMOTE change, even root must provide old password */ - if (((am_root() == False) && (strlen( cgi_variable(OLD_PSWD)) <= 0)) || + if (((!am_root()) && (strlen( cgi_variable(OLD_PSWD)) <= 0)) || ((cgi_variable(CHG_R_PASSWD_FLAG)) && (strlen( cgi_variable(OLD_PSWD)) <= 0))) { printf("

Must specify \"Old Password\" \n"); return; @@ -720,7 +715,7 @@ static void passwd_page(void) */ printf(" User Name : \n"); printf(" \n", SWAT_USER, new_name); - if (am_root() == False) { + if (!am_root()) { printf(" Old Password : \n"); printf(" \n",OLD_PSWD); } @@ -733,7 +728,7 @@ static void passwd_page(void) * Create all the control buttons for requesting action */ printf("\n", CHG_S_PASSWD_FLAG); - if (am_root() == True) { + if (demo_mode || am_root()) { printf("\n", ADD_USER_FLAG); printf("\n", DISABLE_USER_FLAG); printf("\n", ENABLE_USER_FLAG); @@ -923,31 +918,22 @@ static void printers_page(void) page = cgi_pathinfo(); /* Root gets full functionality */ - if (demo_mode || am_root()) { - if (strcmp(page, "globals")==0) { - globals_page(); - } else if (strcmp(page,"shares")==0) { - shares_page(); - } else if (strcmp(page,"printers")==0) { - printers_page(); - } else if (strcmp(page,"status")==0) { - status_page(); - } else if (strcmp(page,"viewconfig")==0) { - viewconfig_page(); - } else if (strcmp(page,"passwd")==0) { - passwd_page(); - } else { - welcome_page(); - } + if (strcmp(page, "globals")==0) { + globals_page(); + } else if (strcmp(page,"shares")==0) { + shares_page(); + } else if (strcmp(page,"printers")==0) { + printers_page(); + } else if (strcmp(page,"status")==0) { + status_page(); + } else if (strcmp(page,"viewconfig")==0) { + viewconfig_page(); + } else if (strcmp(page,"passwd")==0) { + passwd_page(); } else { - /* Everyone gets this functionality */ - if (strcmp(page,"passwd")==0) { - passwd_page(); - } else { - welcome_page(); - } + welcome_page(); } - + print_footer(); return 0; } -- cgit