},
{
+ 'key' => 'business-onlinepayment-test_transaction',
+ 'section' => 'billing',
+ 'description' => 'Turns on the Business::OnlinePayment test_transaction flag. Note that not all gateway modules support this flag; if yours does not, transactions will still be sent live.',
+ 'type' => 'checkbox',
+ },
+
+ {
'key' => 'countrydefault',
'section' => 'UI',
'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
},
{
+ 'key' => 'disable_settings_changes',
+ 'section' => '',
+ 'description' => 'Disable all settings changes, for demos, except for the usernames given in the comma-separated list.',
+ 'type' => [qw( checkbox text )],
+ },
+
+ {
'key' => 'cust_main-edit_agent_custid',
'section' => 'UI',
'description' => 'Enable editing of the agent_custid field.',
<%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;
);
</%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;