Bug 18426: Make sure the logged in user can edit the subscriptions
[koha.git] / admin / systempreferences.pl
index 67e0638..b16143f 100755 (executable)
@@ -40,8 +40,7 @@ ALSO :
 
 =cut
 
-use strict;
-use warnings;
+use Modern::Perl;
 
 use CGI qw ( -utf8 );
 use MIME::Base64;
@@ -276,7 +275,7 @@ if ( $op eq 'update_and_reedit' ) {
         }
     }
     my $variable = $input->param('variable');
-    C4::Context->set_preference($variable, $value) unless C4::Context->config('demo');
+    C4::Context->set_preference($variable, $value);
 }
 
 ################## ADD_FORM ##################################
@@ -335,8 +334,7 @@ if ( $op eq 'add_form' ) {
         $value = encode_base64($value);
     }
 
-    C4::Context->set_preference( $variable, $value, $expl, $type, $options )
-        unless C4::Context->config('demo');
+    C4::Context->set_preference( $variable, $value, $expl, $type, $options );
     print $input->redirect("/cgi-bin/koha/admin/systempreferences.pl?tab=");
     exit;
 ################## DELETE_CONFIRM ##################################
@@ -392,7 +390,7 @@ sub get_prefs_from_files {
                         '/prog/en/modules/admin/preferences';
     # Get all .pref file names
     opendir ( my $fh, $path_pref_en );
-    my @pref_files = grep { /.pref/ } readdir($fh);
+    my @pref_files = grep { /.pref$/ } readdir($fh);
     close $fh;
 
     my @names = ();