#
# This file is part of Koha.
#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along
-# with Koha; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
#
-use strict;
-use warnings;
+use Modern::Perl;
use C4::Context;
use C4::Service;
=cut
-our ( $query, $response ) = C4::Service->init( parameters => 1 );
+our ( $query, $response ) = C4::Service->init( parameters => 'manage_sysprefs' );
=head2 set_preference
=over 4
+=item url path
+
POST /svc/config/systempreferences/$preference
+=item url query
+
value=$value
=back
unless ( C4::Context->config('demo') ) {
my $value = join( ',', $query->param( 'value' ) );
C4::Context->set_preference( $preference, $value );
- logaction( 'SYSTEMPREFERENCE', 'MODIFY', undef, $preference . " | " . $value );
}
C4::Service->return_success( $response );
=over 4
+=item url path
+
POST /svc/config/systempreferences/
+=item url query
+
pref_$pref1=$value1&pref_$pref2=$value2
=back
next if ( !defined( $pref ) );
- my $value = join( '|', $query->param( $param ) );
+ my $value = join( ',', $query->multi_param( $param ) );
C4::Context->set_preference( $pref, $value );
- logaction( 'SYSTEMPREFERENCE', 'MODIFY', undef, $pref . " | " . $value );
}
}