summaryrefslogtreecommitdiff
path: root/source3/web
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-03-14 11:24:01 +0000
committerAndrew Tridgell <tridge@samba.org>1998-03-14 11:24:01 +0000
commite2b50d04ad5eb5fa7c10b59cf5ba0cfe374ab240 (patch)
tree1f390e8d15e40d656034435929d339c93fb1614a /source3/web
parenta62ff8003e5e34f671e0036a2dde5742f0cf5ee4 (diff)
downloadsamba-e2b50d04ad5eb5fa7c10b59cf5ba0cfe374ab240.tar.gz
samba-e2b50d04ad5eb5fa7c10b59cf5ba0cfe374ab240.tar.bz2
samba-e2b50d04ad5eb5fa7c10b59cf5ba0cfe374ab240.zip
if a local parameter is changed at the global level then propogate the
change to all shares that are currently set to the default value. (This used to be commit b0e1183b2cbeb7a3150b7250cd19d14c9e5508b6)
Diffstat (limited to 'source3/web')
-rw-r--r--source3/web/swat.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/source3/web/swat.c b/source3/web/swat.c
index 323dfc5adf..650740428f 100644
--- a/source3/web/swat.c
+++ b/source3/web/swat.c
@@ -198,6 +198,27 @@ static int save_reload(void)
+/* commit one parameter */
+static void commit_parameter(int snum, struct parm_struct *parm, char *v)
+{
+ int i;
+ char *s;
+
+ if (snum < 0 && parm->class == P_LOCAL) {
+ /* this handles the case where we are changing a local
+ variable globally. We need to change the parameter in
+ all shares where it is currently set to the default */
+ for (i=0;i<lp_numservices();i++) {
+ s = lp_servicename(i);
+ if (s && (*s) && lp_is_default(i, parm)) {
+ lp_do_parameter(i, parm->label, v);
+ }
+ }
+ }
+
+ lp_do_parameter(snum, parm->label, v);
+}
+
/* commit a set of parameters for a service */
static void commit_parameters(int snum)
{
@@ -209,7 +230,8 @@ static void commit_parameters(int snum)
while ((parm = lp_next_parameter(snum, &i, 1))) {
sprintf(label, "parm_%s", parm->label);
if ((v = cgi_variable(label))) {
- lp_do_parameter(snum, parm->label, v);
+ if (parm->flags & FLAG_HIDE) continue;
+ commit_parameter(snum, parm, v);
}
}
}