summaryrefslogtreecommitdiffstats
path: root/source/web
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-11-14 02:29:38 +0000
committerAndrew Tridgell <tridge@samba.org>1998-11-14 02:29:38 +0000
commit8e8ab4df1fe77dfcae73a34f4de174afe09cd695 (patch)
treec45a6b728cb29a9d5355757634ac531dfbf3a455 /source/web
parentab35d99e52225b0e9f519903ae99e575075187e7 (diff)
downloadsamba-8e8ab4df1fe77dfcae73a34f4de174afe09cd695.tar.gz
samba-8e8ab4df1fe77dfcae73a34f4de174afe09cd695.tar.xz
samba-8e8ab4df1fe77dfcae73a34f4de174afe09cd695.zip
- new prototypes
- much as I hate doing it I've removed the "commit changes" button for users that don't have write access to smb.conf (Jeremy insisted)
Diffstat (limited to 'source/web')
-rw-r--r--source/web/swat.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/source/web/swat.c b/source/web/swat.c
index db21fbfbe10..8f47ced52d8 100644
--- a/source/web/swat.c
+++ b/source/web/swat.c
@@ -30,6 +30,7 @@
static pstring servicesf = CONFIGFILE;
static BOOL demo_mode = False;
+static BOOL have_write_access = False;
/*
* Password Management Globals
@@ -469,7 +470,10 @@ static void globals_page(void)
printf("<FORM name=\"swatform\" method=post>\n");
- printf("<input type=submit name=\"Commit\" value=\"Commit Changes\">\n");
+ if (have_write_access) {
+ printf("<input type=submit name=\"Commit\" value=\"Commit Changes\">\n");
+ }
+
printf("<input type=reset name=\"Reset Values\" value=\"Reset Values\">\n");
if (advanced == 0) {
printf("<input type=submit name=\"Advanced\" value=\"Advanced View\">\n");
@@ -549,7 +553,10 @@ static void shares_page(void)
if (snum >= 0) {
- printf("<input type=submit name=\"Commit\" value=\"Commit Changes\">\n");
+ if (have_write_access) {
+ printf("<input type=submit name=\"Commit\" value=\"Commit Changes\">\n");
+ }
+
printf("<input type=submit name=\"Delete\" value=\"Delete Share\">\n");
if (advanced == 0) {
printf("<input type=submit name=\"Advanced\" value=\"Advanced View\">\n");
@@ -848,7 +855,9 @@ static void printers_page(void)
if (snum >= 0) {
- printf("<input type=submit name=\"Commit\" value=\"Commit Changes\">\n");
+ if (have_write_access) {
+ printf("<input type=submit name=\"Commit\" value=\"Commit Changes\">\n");
+ }
printf("<input type=submit name=\"Delete\" value=\"Delete Printer\">\n");
if (advanced == 0) {
printf("<input type=submit name=\"Advanced\" value=\"Advanced View\">\n");
@@ -917,6 +926,10 @@ static void printers_page(void)
page = cgi_pathinfo();
+ /* check if the authenticated user has write access - if not then
+ don't show write options */
+ have_write_access = (access(servicesf,W_OK) == 0);
+
/* Root gets full functionality */
if (strcmp(page, "globals")==0) {
globals_page();