From 4beae9996a136127350d1d7539e314f085d1a00c Mon Sep 17 00:00:00 2001 From: Deryck Hodge Date: Wed, 2 Feb 2005 18:01:11 +0000 Subject: r5179: Add -P (password-menu-only) option to swat. Admins can allow users to use swat to change their password without allowing them to see the "View" and "Status" buttons. deryck (This used to be commit c9cacd553f8e7aa2db011cb7b22dd791b7460ea0) --- source3/web/swat.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/web/swat.c') diff --git a/source3/web/swat.c b/source3/web/swat.c index 7bd9837c37..e7402e0a0f 100644 --- a/source3/web/swat.c +++ b/source3/web/swat.c @@ -32,6 +32,7 @@ #include "web/swat_proto.h" static BOOL demo_mode = False; +static BOOL passwd_only = False; static BOOL have_write_access = False; static BOOL have_read_access = False; static int iNumNonAutoPrintServices = 0; @@ -530,7 +531,8 @@ static void show_main_buttons(void) image_link(_("Printers"), "printers", "images/printers.gif"); image_link(_("Wizard"), "wizard", "images/wizard.gif"); } - if (have_read_access) { + /* root always gets all buttons, otherwise look for -P */ + if ( have_write_access || (!passwd_only && have_read_access) ) { image_link(_("Status"), "status", "images/status.gif"); image_link(_("View Config"), "viewconfig", "images/viewconfig.gif"); } @@ -1315,6 +1317,7 @@ static void printers_page(void) struct poptOption long_options[] = { POPT_AUTOHELP { "disable-authentication", 'a', POPT_ARG_VAL, &demo_mode, True, "Disable authentication (demo mode)" }, + { "password-menu-only", 'P', POPT_ARG_VAL, &passwd_only, True, "Show only change password menu" }, POPT_COMMON_SAMBA POPT_TABLEEND }; -- cgit