}
}
+# Sco Patron should not contain any other perms than circulate => self_checkout
+if ( C4::Context->preference('WebBasedSelfCheck')
+ and C4::Context->preference('AutoSelfCheckAllowed')
+) {
+ my $userid = C4::Context->preference('AutoSelfCheckID');
+ my $all_permissions = C4::Auth::get_user_subpermissions( $userid );
+ my ( $has_self_checkout_perm, $has_other_permissions );
+ while ( my ( $module, $permissions ) = each %$all_permissions ) {
+ if ( $module eq 'circulate' ) {
+ while ( my ( $permission, $flag ) = each %$permissions ) {
+ if ( $permission eq 'self_checkout' ) {
+ $has_self_checkout_perm = 1;
+ } else {
+ $has_other_permissions = 1;
+ }
+ }
+ } else {
+ $has_other_permissions = 1;
+ }
+ }
+ $template->param(
+ AutoSelfCheckPatronDoesNotHaveSelfCheckPerm => not ( $has_self_checkout_perm ),
+ AutoSelfCheckPatronHasTooManyPerm => $has_other_permissions,
+ );
+
+
+}
+
$template->param(
kohaVersion => $kohaVersion,
osVersion => $osVersion,
<div id="sysinfo">
[% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron ||
- warnNoActiveCurrency || QueryParserError || warnIsRootUser || xml_config_warnings.size %]
+ warnNoActiveCurrency || QueryParserError || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm %]
[% IF (warnIsRootUser) %]
<h2>Warning regarding current user</h2>
<p>You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account.</p>
[% END %]
[% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron ||
- warnNoActiveCurrency || QueryParserError %]
+ warnNoActiveCurrency || QueryParserError || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm %]
<h2>Warnings regarding the system configuration</h2>
<table>
<caption>Preferences and parameters</caption>
</td>
</tr>
[% END %]
+ [% IF AutoSelfCheckPatronDoesNotHaveSelfCheckPerm %]
+ <tr><th scope="row"><b>Warning</b> </th><td>
+ The patron used for the self checkout module at the OPAC does not have the circulate => self_checkout permission.
+ </td></tr>
+ [% END %]
+ [% IF AutoSelfCheckPatronHasTooManyPerm %]
+ <tr><th scope="row"><b>Warning</b> </th><td>
+ The patron used for the self checkout module at the OPAC has too many permissions. They should only have circulate => self_checkout.
+ </td></tr>
+ [% END %]
</table>
[% END %]