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

(-)a/C4/Auth.pm (-5 / +3 lines)
Lines 898-906 sub checkauth { Link Here
898
            }
898
            }
899
899
900
            # If we are in a shibboleth session (shibboleth is enabled, a shibboleth match attribute is set and matches koha matchpoint)
900
            # If we are in a shibboleth session (shibboleth is enabled, a shibboleth match attribute is set and matches koha matchpoint)
901
            if ( $shib and $shib_login and $shibSuccess and $type eq 'opac' ) {
901
            if ( $shib and $shib_login and $shibSuccess) {
902
903
                # (Note: $type eq 'opac' condition should be removed when shibboleth authentication for intranet will be implemented)
904
                logout_shib($query);
902
                logout_shib($query);
905
            }
903
            }
906
        }
904
        }
Lines 982-989 sub checkauth { Link Here
982
            my $shibSuccess = 0;
980
            my $shibSuccess = 0;
983
            my ( $return, $cardnumber );
981
            my ( $return, $cardnumber );
984
982
985
            # If shib is enabled and we have a shib login, does the login match a valid koha user
983
	    # If shib is enabled and we have a shib login, does the login match a valid koha user
986
            if ( $shib && $shib_login && $type eq 'opac' ) {
984
            if ( $shib && $shib_login ) {
987
                my $retuserid;
985
                my $retuserid;
988
986
989
                # Do not pass password here, else shib will not be checked in checkpw.
987
                # Do not pass password here, else shib will not be checked in checkpw.
(-)a/C4/Auth_with_shibboleth.pm (-5 / +18 lines)
Lines 49-54 sub shib_ok { Link Here
49
    return 0;
49
    return 0;
50
}
50
}
51
51
52
52
# Logout from Shibboleth
53
# Logout from Shibboleth
53
sub logout_shib {
54
sub logout_shib {
54
    my ($query) = @_;
55
    my ($query) = @_;
Lines 131-151 sub _autocreate { Link Here
131
sub _get_uri {
132
sub _get_uri {
132
133
133
    my $protocol = "https://";
134
    my $protocol = "https://";
135
    my $interface = C4::Context->interface;
136
    $debug and warn "shibboleth interface: " . $interface;
137
138
    my $return;
139
    my $uri;
140
    if ( $interface eq 'intranet' ) {
134
141
135
    my $uri = C4::Context->preference('OPACBaseURL') // '';
142
        $uri = C4::Context->preference('staffClientBaseURL') // '';
136
    if ($uri eq '') {
143
        if ($uri eq '') {
137
        $debug and warn 'OPACBaseURL not set!';
144
            $debug and warn 'staffClientBaseURL not set!';
145
        }
146
    } else {
147
        $uri = C4::Context->preference('OPACBaseURL') // '';
148
        if ($uri eq '') {
149
            $debug and warn 'OPACBaseURL not set!';
150
        }
138
    }
151
    }
152
139
    if ($uri =~ /(.*):\/\/(.*)/) {
153
    if ($uri =~ /(.*):\/\/(.*)/) {
140
        my $oldprotocol = $1;
154
        my $oldprotocol = $1;
141
        if ($oldprotocol ne 'https') {
155
        if ($oldprotocol ne 'https') {
142
            $debug
156
            $debug
143
                and warn
157
                and warn
144
                  'Shibboleth requires OPACBaseURL to use the https protocol!';
158
                  'Shibboleth requires OPACBaseURL/staffClientBaseURL to use the https protocol!';
145
        }
159
        }
146
        $uri = $2;
160
        $uri = $2;
147
    }
161
    }
148
149
    my $return = $protocol . $uri;
162
    my $return = $protocol . $uri;
150
    return $return;
163
    return $return;
151
}
164
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt (-1 / +8 lines)
Lines 49-54 Link Here
49
<div id="login_error"><strong>Error: </strong>Invalid username or password</div>
49
<div id="login_error"><strong>Error: </strong>Invalid username or password</div>
50
[% END %]
50
[% END %]
51
51
52
[% IF (shibbolethAuthentication) %]
53
<!-- This is what is displayed if shib login has failed -->
54
[% IF (invalidShibLogin ) %]
55
<div id="login_error"><Strong>Error: </strong>Shibboleth login failed</div>
56
[% END %]
57
<p>If you have a shibboleth account, please <a href="[% shibbolethLoginUrl %]">click here</a> to login.</p>
58
[% END %]
59
52
<!-- login prompt time-->
60
<!-- login prompt time-->
53
<form action="[% script_name | html %]" method="post" name="loginform" id="loginform">
61
<form action="[% script_name | html %]" method="post" name="loginform" id="loginform">
54
    <input type="hidden" name="koha_login_context" value="intranet" />
62
    <input type="hidden" name="koha_login_context" value="intranet" />
55
- 

Return to bug 12027