From 57d4977f24566675111d791949491908eb4a6c4e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 14 Nov 1998 02:29:38 +0000 Subject: - 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) (This used to be commit 8e8ab4df1fe77dfcae73a34f4de174afe09cd695) --- source3/web/swat.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'source3/web/swat.c') diff --git a/source3/web/swat.c b/source3/web/swat.c index db21fbfbe1..8f47ced52d 100644 --- a/source3/web/swat.c +++ b/source3/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("
\n"); - printf("\n"); + if (have_write_access) { + printf("\n"); + } + printf("\n"); if (advanced == 0) { printf("\n"); @@ -549,7 +553,10 @@ static void shares_page(void) if (snum >= 0) { - printf("\n"); + if (have_write_access) { + printf("\n"); + } + printf("\n"); if (advanced == 0) { printf("\n"); @@ -848,7 +855,9 @@ static void printers_page(void) if (snum >= 0) { - printf("\n"); + if (have_write_access) { + printf("\n"); + } printf("\n"); if (advanced == 0) { printf("\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(); -- cgit