View | Details | Raw Unified | Return to bug 18506
Collapse All | Expand All

(-)a/C4/Auth.pm (-2 / +2 lines)
Lines 1107-1113 sub checkauth { Link Here
1107
                && (
1107
                && (
1108
                    (
1108
                    (
1109
                        ( $type eq 'opac' )
1109
                        ( $type eq 'opac' )
1110
                        && C4::Context->preference('opacShibOnly')
1110
                        && C4::Context->preference('OPACShibOnly')
1111
                    )
1111
                    )
1112
                    || ( ( $type ne 'opac' )
1112
                    || ( ( $type ne 'opac' )
1113
                        && C4::Context->preference('staffShibOnly') )
1113
                        && C4::Context->preference('staffShibOnly') )
Lines 1411-1417 sub checkauth { Link Here
1411
1411
1412
    if ($shib) {
1412
    if ($shib) {
1413
        #If shibOnly is enabled just go ahead and redirect directly
1413
        #If shibOnly is enabled just go ahead and redirect directly
1414
        if ( (($type eq 'opac') && C4::Context->preference('opacShibOnly')) || (($type ne 'opac') && C4::Context->preference('staffShibOnly')) ) {
1414
        if ( (($type eq 'opac') && C4::Context->preference('OPACShibOnly')) || (($type ne 'opac') && C4::Context->preference('staffShibOnly')) ) {
1415
            my $redirect_url = login_shib_url( $query );
1415
            my $redirect_url = login_shib_url( $query );
1416
            print $query->redirect( -uri => "$redirect_url", -status => 303 );
1416
            print $query->redirect( -uri => "$redirect_url", -status => 303 );
1417
            safe_exit;
1417
            safe_exit;
(-)a/installer/data/mysql/atomicupdate/shibOnly.perl (-1 / +1 lines)
Lines 1-6 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do( "INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('opacShibOnly','0','If ON enables shibboleth only authentication for the opac','','YesNo'),('staffShibOnly','0','If ON enables shibboleth only authentication for the staff client','','YesNo')" );
3
    $dbh->do( "INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACShibOnly','0','If ON enables shibboleth only authentication for the opac','','YesNo'),('staffShibOnly','0','If ON enables shibboleth only authentication for the staff client','','YesNo')" );
4
    SetVersion( $DBversion );
4
    SetVersion( $DBversion );
5
    print "Upgrade to $DBversion done (Bug XXXXX - shibOnly preferences)\n";
5
    print "Upgrade to $DBversion done (Bug XXXXX - shibOnly preferences)\n";
6
}
6
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +1 lines)
Lines 934-940 OPAC: Link Here
934
            - "."
934
            - "."
935
    Authentication:
935
    Authentication:
936
        -
936
        -
937
            - pref: opacShibOnly
937
            - pref: OPACShibOnly
938
              choices:
938
              choices:
939
                  yes: "Don't allow"
939
                  yes: "Don't allow"
940
                  no: Allow
940
                  no: Allow
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt (-7 / +6 lines)
Lines 79-85 Link Here
79
                                    <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
79
                                    <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
80
                                    <div class="alert alert-info">
80
                                    <div class="alert alert-info">
81
                                        <p>Sorry, your Shibboleth identity does not match a valid library identity.</p>
81
                                        <p>Sorry, your Shibboleth identity does not match a valid library identity.</p>
82
                                        [% UNLESS ( Koha.Preference('opacShibOnly') ) %]
82
                                        [% UNLESS ( Koha.Preference('OPACShibOnly') ) %]
83
                                        [% IF ( casAuthentication ) %]
83
                                        [% IF ( casAuthentication ) %]
84
                                            [% IF ( invalidCasLogin ) %]
84
                                            [% IF ( invalidCasLogin ) %]
85
                                                <!-- This is what is displayed if cas login has failed -->
85
                                                <!-- This is what is displayed if cas login has failed -->
Lines 96-102 Link Here
96
                                    <h3>Shibboleth Login</h3>
96
                                    <h3>Shibboleth Login</h3>
97
                                    <p><a href="[% shibbolethLoginUrl | $raw %]">If you have a Shibboleth account, please click here to log in.</a></p>
97
                                    <p><a href="[% shibbolethLoginUrl | $raw %]">If you have a Shibboleth account, please click here to log in.</a></p>
98
                                [% END # /IF invalidShibLogin %]
98
                                [% END # /IF invalidShibLogin %]
99
                                [% UNLESS ( Koha.Preference('opacShibOnly') ) %]
99
                                [% UNLESS ( Koha.Preference('OPACShibOnly') ) %]
100
                                [% IF ( casAuthentication ) %]
100
                                [% IF ( casAuthentication ) %]
101
                                    <h3>CAS login</h3>
101
                                    <h3>CAS login</h3>
102
                                    <p>If you do not have a Shibboleth account, but you do have a CAS account, you can use CAS.</p>
102
                                    <p>If you do not have a Shibboleth account, but you do have a CAS account, you can use CAS.</p>
Lines 107-113 Link Here
107
                                [% END %]
107
                                [% END %]
108
                            [% END # /IF shibbolethAuthentication %]
108
                            [% END # /IF shibbolethAuthentication %]
109
109
110
                        [% UNLESS ( Koha.Preference('opacShibOnly') ) %]
110
                        [% UNLESS ( Koha.Preference('OPACShibOnly') ) %]
111
                        [% IF ( casAuthentication ) %]
111
                        [% IF ( casAuthentication ) %]
112
                            [% IF ( shibbolethAuthentication ) %]
112
                            [% IF ( shibbolethAuthentication ) %]
113
                                [% IF ( casServerUrl ) %]
113
                                [% IF ( casServerUrl ) %]
Lines 163-171 Link Here
163
                            <a href="/cgi-bin/koha/svc/auth/googleopenidconnect" class="btn btn-primary" id="openid_connect">Log in with Google</a>
163
                            <a href="/cgi-bin/koha/svc/auth/googleopenidconnect" class="btn btn-primary" id="openid_connect">Log in with Google</a>
164
                            <p>If you do not have a Google account, but do have a local account, you can still log in: </p>
164
                            <p>If you do not have a Google account, but do have a local account, you can still log in: </p>
165
                        [% END # /IF GoogleOpenIDConnect %]
165
                        [% END # /IF GoogleOpenIDConnect %]
166
                        [% END # /UNLESS opacShibOnly %]
166
                        [% END # /UNLESS OPACShibOnly %]
167
167
168
                        [% IF !Koha.Preference('opacShibOnly') or SCO_login or SCI_login %]
168
                        [% IF !Koha.Preference('OPACShibOnly') or SCO_login or SCI_login %]
169
                        [% IF SCO_login %]
169
                        [% IF SCO_login %]
170
                            <form action="/cgi-bin/koha/sco/sco-main.pl" name="auth" id="auth" method="post" autocomplete="off">
170
                            <form action="/cgi-bin/koha/sco/sco-main.pl" name="auth" id="auth" method="post" autocomplete="off">
171
                        [% ELSIF SCI_login %]
171
                        [% ELSIF SCI_login %]
Lines 215-221 Link Here
215
                                [% END %]
215
                                [% END %]
216
                            </div>
216
                            </div>
217
                        </form>
217
                        </form>
218
                        [% END # / IF !opacShibOnly or SCO_login or SCI_login %]
218
                        [% END # / IF !OPACShibOnly or SCO_login or SCI_login %]
219
                    [% END # / IF loginprompt %]
219
                    [% END # / IF loginprompt %]
220
220
221
                    [% ELSE %]
221
                    [% ELSE %]
222
- 

Return to bug 18506