summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeryck Hodge <deryck@samba.org>2005-02-02 18:01:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:32 -0500
commit4beae9996a136127350d1d7539e314f085d1a00c (patch)
treec2d0d2008cafdfe4999230893d1d91583a3a0c44
parent6ca54f00f6c723907cb6da548985f685ab0fbe13 (diff)
downloadsamba-4beae9996a136127350d1d7539e314f085d1a00c.tar.gz
samba-4beae9996a136127350d1d7539e314f085d1a00c.tar.bz2
samba-4beae9996a136127350d1d7539e314f085d1a00c.zip
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)
-rw-r--r--source3/web/swat.c5
1 files changed, 4 insertions, 1 deletions
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
};