svn commit: samba r5178 - in trunk/source/web: .

deryck at samba.org deryck at samba.org
Wed Feb 2 17:59:52 GMT 2005


Author: deryck
Date: 2005-02-02 17:59:51 +0000 (Wed, 02 Feb 2005)
New Revision: 5178

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5178

Log:

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 

Modified:
   trunk/source/web/swat.c


Changeset:
Modified: trunk/source/web/swat.c
===================================================================
--- trunk/source/web/swat.c	2005-02-02 16:35:57 UTC (rev 5177)
+++ trunk/source/web/swat.c	2005-02-02 17:59:51 UTC (rev 5178)
@@ -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 @@
 		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 @@
 	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
 	};



More information about the samba-cvs mailing list