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

(-)a/C4/Auth.pm (-5 / +3 lines)
Lines 804-812 sub checkauth { Link Here
804
            }
804
            }
805
805
806
            # If we are in a shibboleth session (shibboleth is enabled, a shibboleth match attribute is set and matches koha matchpoint)
806
            # If we are in a shibboleth session (shibboleth is enabled, a shibboleth match attribute is set and matches koha matchpoint)
807
            if ( $shib and $shib_login and $shibSuccess and $type eq 'opac' ) {
807
            if ( $shib and $shib_login and $shibSuccess) {
808
809
                # (Note: $type eq 'opac' condition should be removed when shibboleth authentication for intranet will be implemented)
810
                logout_shib($query);
808
                logout_shib($query);
811
            }
809
            }
812
        }
810
        }
Lines 891-898 sub checkauth { Link Here
891
889
892
            my ( $return, $cardnumber );
890
            my ( $return, $cardnumber );
893
891
894
            # If shib is enabled and we have a shib login, does the login match a valid koha user
892
	    # If shib is enabled and we have a shib login, does the login match a valid koha user
895
            if ( $shib && $shib_login && $type eq 'opac' ) {
893
            if ( $shib && $shib_login ) {
896
                my $retuserid;
894
                my $retuserid;
897
895
898
                # Do not pass password here, else shib will not be checked in checkpw.
896
                # Do not pass password here, else shib will not be checked in checkpw.
(-)a/C4/Auth_with_shibboleth.pm (-5 / +18 lines)
Lines 47-52 sub shib_ok { Link Here
47
    return 0;
47
    return 0;
48
}
48
}
49
49
50
50
# Logout from Shibboleth
51
# Logout from Shibboleth
51
sub logout_shib {
52
sub logout_shib {
52
    my ($query) = @_;
53
    my ($query) = @_;
Lines 112-132 sub checkpw_shib { Link Here
112
sub _get_uri {
113
sub _get_uri {
113
114
114
    my $protocol = "https://";
115
    my $protocol = "https://";
116
    my $interface = C4::Context->interface;
117
    $debug and warn "shibboleth interface: " . $interface;
118
119
    my $return;
120
    my $uri;
121
    if ( $interface eq 'intranet' ) {
115
122
116
    my $uri = C4::Context->preference('OPACBaseURL') // '';
123
        $uri = C4::Context->preference('staffClientBaseURL') // '';
117
    if ($uri eq '') {
124
        if ($uri eq '') {
118
        $debug and warn 'OPACBaseURL not set!';
125
            $debug and warn 'staffClientBaseURL not set!';
126
        }
127
    } else {
128
        $uri = C4::Context->preference('OPACBaseURL') // '';
129
        if ($uri eq '') {
130
            $debug and warn 'OPACBaseURL not set!';
131
        }
119
    }
132
    }
133
120
    if ($uri =~ /(.*):\/\/(.*)/) {
134
    if ($uri =~ /(.*):\/\/(.*)/) {
121
        my $oldprotocol = $1;
135
        my $oldprotocol = $1;
122
        if ($oldprotocol ne 'https') {
136
        if ($oldprotocol ne 'https') {
123
            $debug
137
            $debug
124
                and warn
138
                and warn
125
                  'Shibboleth requires OPACBaseURL to use the https protocol!';
139
                  'Shibboleth requires OPACBaseURL/staffClientBaseURL to use the https protocol!';
126
        }
140
        }
127
        $uri = $2;
141
        $uri = $2;
128
    }
142
    }
129
130
    my $return = $protocol . $uri;
143
    my $return = $protocol . $uri;
131
    return $return;
144
    return $return;
132
}
145
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt (-1 / +8 lines)
Lines 39-44 Link Here
39
<div id="login_error"><strong>Error: </strong>Invalid username or password</div>
39
<div id="login_error"><strong>Error: </strong>Invalid username or password</div>
40
[% END %]
40
[% END %]
41
41
42
[% IF (shibbolethAuthentication) %]
43
<!-- This is what is displayed if shib login has failed -->
44
[% IF (invalidShibLogin ) %]
45
<div id="login_error"><Strong>Error: </strong>Shibboleth login failed</div>
46
[% END %]
47
<p>If you have a shibboleth account, please <a href="[% shibbolethLoginUrl %]">click here</a> to login.</p>
48
[% END %]
49
42
<!-- login prompt time-->
50
<!-- login prompt time-->
43
<form action="[% url %]" method="post" name="loginform" id="loginform">
51
<form action="[% url %]" method="post" name="loginform" id="loginform">
44
    <input type="hidden" name="koha_login_context" value="intranet" />
52
    <input type="hidden" name="koha_login_context" value="intranet" />
45
- 

Return to bug 12027