summaryrefslogtreecommitdiff
path: root/source3/web
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2003-08-02 20:06:57 +0000
committerSimo Sorce <idra@samba.org>2003-08-02 20:06:57 +0000
commit04bf12b176d5abe06b7f1401810369bcafe0b611 (patch)
tree8bb6627c3ffa4cab902787b874206f8012a33e3a /source3/web
parent7efce478976e2ac71bcaf4e4d1049bb263634711 (diff)
downloadsamba-04bf12b176d5abe06b7f1401810369bcafe0b611.tar.gz
samba-04bf12b176d5abe06b7f1401810369bcafe0b611.tar.bz2
samba-04bf12b176d5abe06b7f1401810369bcafe0b611.zip
port latest changes from SAMBA_3_0 tree
(This used to be commit 3101c236b8241dc0183995ffceed551876427de4)
Diffstat (limited to 'source3/web')
-rw-r--r--source3/web/statuspage.c2
-rw-r--r--source3/web/swat.c56
2 files changed, 31 insertions, 27 deletions
diff --git a/source3/web/statuspage.c b/source3/web/statuspage.c
index 44461232b8..c579e8f112 100644
--- a/source3/web/statuspage.c
+++ b/source3/web/statuspage.c
@@ -93,7 +93,7 @@ static char *mapPid2Machine (pid_t pid)
}
/* PID not in list or machine name NULL? return pid as string */
- snprintf (pidbuf, sizeof (pidbuf) - 1, "%d", pid);
+ snprintf (pidbuf, sizeof (pidbuf) - 1, "%lu", (unsigned long)pid);
return pidbuf;
}
diff --git a/source3/web/swat.c b/source3/web/swat.c
index d97278c485..a1c132a088 100644
--- a/source3/web/swat.c
+++ b/source3/web/swat.c
@@ -51,10 +51,6 @@ static int iNumNonAutoPrintServices = 0;
#define ENABLE_USER_FLAG "enable_user_flag"
#define RHOST "remote_host"
-/* we need these because we link to locking*.o */
- void become_root(void) {}
- void unbecome_root(void) {}
-
/****************************************************************************
****************************************************************************/
static int enum_index(int value, const struct enum_list *enumlist)
@@ -168,12 +164,12 @@ static const char* get_parm_translated(
static pstring output;
if(strcmp(pLabel, pTranslated) != 0)
{
- snprintf(output, sizeof(output),
+ pstr_sprintf(output,
"<A HREF=\"/swat/help/smb.conf.5.html#%s\" target=\"docs\"> %s</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; %s <br><span class=\"i18n_translated_parm\">%s</span>",
pAnchor, pHelp, pLabel, pTranslated);
return output;
}
- snprintf(output, sizeof(output),
+ pstr_sprintf(output,
"<A HREF=\"/swat/help/smb.conf.5.html#%s\" target=\"docs\"> %s</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; %s",
pAnchor, pHelp, pLabel);
return output;
@@ -316,9 +312,10 @@ static void show_parameters(int snum, int allparameters, unsigned int parm_filte
if (printers & !(parm->flags & FLAG_PRINT)) continue;
if (!printers & !(parm->flags & FLAG_SHARE)) continue;
}
- if (parm_filter == FLAG_BASIC) {
+
+ if (!( parm_filter & FLAG_ADVANCED )) {
if (!(parm->flags & FLAG_BASIC)) {
- void *ptr = parm->ptr;
+ void *ptr = parm->ptr;
if (parm->class == P_LOCAL && snum >= 0) {
ptr = lp_local_ptr(snum, ptr);
@@ -359,16 +356,15 @@ static void show_parameters(int snum, int allparameters, unsigned int parm_filte
break;
case P_SEP:
continue;
- }
+ }
}
if (printers && !(parm->flags & FLAG_PRINT)) continue;
}
- if (parm_filter == FLAG_WIZARD) {
- if (!((parm->flags & FLAG_WIZARD))) continue;
- }
- if (parm_filter == FLAG_ADVANCED) {
- if (!((parm->flags & FLAG_ADVANCED))) continue;
- }
+
+ if ((parm_filter & FLAG_WIZARD) && !(parm->flags & FLAG_WIZARD)) continue;
+
+ if ((parm_filter & FLAG_ADVANCED) && !(parm->flags & FLAG_ADVANCED)) continue;
+
if (heading && heading != last_heading) {
d_printf("<tr><td></td></tr><tr><td><b><u>%s</u></b></td></tr>\n", _(heading));
last_heading = heading;
@@ -523,10 +519,12 @@ static void show_main_buttons(void)
****************************************************************************/
static void ViewModeBoxes(int mode)
{
- d_printf("<p>%s\n", _("Configuration View:&nbsp"));
+ d_printf("<p>%s\n", _("Current View Is:&nbsp \n"));
d_printf("<input type=radio name=\"ViewMode\" value=0 %s>Basic\n", (mode == 0) ? "checked" : "");
d_printf("<input type=radio name=\"ViewMode\" value=1 %s>Advanced\n", (mode == 1) ? "checked" : "");
- d_printf("<input type=radio name=\"ViewMode\" value=2 %s>Developer\n", (mode == 2) ? "checked" : "");
+ d_printf("<br>%s\n", _("Change View To:&nbsp"));
+ d_printf("<input type=submit name=\"BasicMode\" value=\"%s\">\n", _("Basic"));
+ d_printf("<input type=submit name=\"AdvMode\" value=\"%s\">\n", _("Advanced"));
d_printf("</p><br>\n");
}
@@ -782,6 +780,10 @@ static void globals_page(void)
if ( cgi_variable("ViewMode") )
mode = atoi(cgi_variable("ViewMode"));
+ if ( cgi_variable("BasicMode"))
+ mode = 0;
+ if ( cgi_variable("AdvMode"))
+ mode = 1;
d_printf("<form name=\"swatform\" method=post action=globals>\n");
@@ -793,9 +795,6 @@ static void globals_page(void)
case 1:
parm_filter = FLAG_ADVANCED;
break;
- case 2:
- parm_filter = FLAG_DEVELOPER;
- break;
}
d_printf("<br>\n");
if (have_write_access) {
@@ -854,8 +853,14 @@ static void shares_page(void)
d_printf("<FORM name=\"swatform\" method=post>\n");
d_printf("<table>\n");
+
if ( cgi_variable("ViewMode") )
mode = atoi(cgi_variable("ViewMode"));
+ if ( cgi_variable("BasicMode"))
+ mode = 0;
+ if ( cgi_variable("AdvMode"))
+ mode = 1;
+
ViewModeBoxes( mode );
switch ( mode ) {
case 0:
@@ -864,9 +869,6 @@ static void shares_page(void)
case 1:
parm_filter = FLAG_ADVANCED;
break;
- case 2:
- parm_filter = FLAG_DEVELOPER;
- break;
}
d_printf("<br><tr>\n");
d_printf("<td><input type=submit name=selectshare value=\"%s\"></td>\n", _("Choose Share"));
@@ -1196,6 +1198,11 @@ static void printers_page(void)
if ( cgi_variable("ViewMode") )
mode = atoi(cgi_variable("ViewMode"));
+ if ( cgi_variable("BasicMode"))
+ mode = 0;
+ if ( cgi_variable("AdvMode"))
+ mode = 1;
+
ViewModeBoxes( mode );
switch ( mode ) {
case 0:
@@ -1204,9 +1211,6 @@ static void printers_page(void)
case 1:
parm_filter = FLAG_ADVANCED;
break;
- case 2:
- parm_filter = FLAG_DEVELOPER;
- break;
}
d_printf("<table>\n");
d_printf("<tr><td><input type=submit name=selectshare value=\"%s\"></td>\n", _("Choose Printer"));