[freeside-commits] freeside/httemplate/config config-delete.cgi, 1.3, 1.4 config-process.cgi, 1.22, 1.23

Ivan,,, ivan at wavetail.420.am
Sat Jun 5 22:58:18 PDT 2010


Update of /home/cvs/cvsroot/freeside/httemplate/config
In directory wavetail.420.am:/tmp/cvs-serv2755/httemplate/config

Modified Files:
	config-delete.cgi config-process.cgi 
Log Message:
add disable_settings_changes conf for the demo

Index: config-process.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/config/config-process.cgi,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -w -d -r1.22 -r1.23
--- config-process.cgi	4 Nov 2009 01:04:35 -0000	1.22
+++ config-process.cgi	6 Jun 2010 05:58:16 -0000	1.23
@@ -70,10 +70,21 @@
 );
 </%once>
 <%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 $conf = new FS::Conf;
+
+if ( $conf->exists('disable_settings_changes') ) {
+  my @changers = split(/\s*,\s*/, $conf->config('disable_settings_changes'));
+  my %changers = map { $_=>1 } @changers;
+  unless ( $changers{$curuser->username} ) {
+    errorpage("Disabled in web demo");
+    die "shouldn't be reached";
+  }
+}
+
 $FS::Conf::DEBUG = 1;
 my @config_items = grep { $_->key != ~/^invoice_(html|latex|template)/ }
                         $conf->config_items;

Index: config-delete.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/config/config-delete.cgi,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -d -r1.3 -r1.4
--- config-delete.cgi	3 May 2009 01:11:50 -0000	1.3
+++ config-delete.cgi	6 Jun 2010 05:58:16 -0000	1.4
@@ -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;



More information about the freeside-commits mailing list