diff options
author | ivan <ivan> | 2010-06-06 05:58:16 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-06-06 05:58:16 +0000 |
commit | dad1e2689ba5ff448bf1bbc9a586023137864d12 (patch) | |
tree | 487b55d771567a913904b8606bad0e88636b6843 /httemplate/config/config-delete.cgi | |
parent | a91c47d734219f046c881662225cd3f00a3f2e92 (diff) |
add disable_settings_changes conf for the demo
Diffstat (limited to 'httemplate/config/config-delete.cgi')
-rw-r--r-- | httemplate/config/config-delete.cgi | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/httemplate/config/config-delete.cgi b/httemplate/config/config-delete.cgi index a05cb1e14..488886824 100644 --- a/httemplate/config/config-delete.cgi +++ b/httemplate/config/config-delete.cgi @@ -1,6 +1,17 @@ <%init> -die "access denied\n" - unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $curuser = $FS::CurrentUser::CurrentUser; +die "access denied\n" unless $curuser->access_right('Configuration'); + +my $fsconf = new FS::Conf; +if ( $fsconf->exists('disable_settings_changes') ) { + my @changers = split(/\s*,\s*/, $fsconf->config('disable_settings_changes')); + my %changers = map { $_=>1 } @changers; + unless ( $changers{$curuser->username} ) { + errorpage("Disabled in web demo"); + die "shouldn't be reached"; + } +} $cgi->param('confnum') =~ /^(\d+)$/ or die "illegal or missing confnum"; my $confnum = $1; |