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

(-)a/C4/Auth.pm (-5 / +3 lines)
Lines 850-858 sub checkauth { Link Here
850
            }
850
            }
851
851
852
            # If we are in a shibboleth session (shibboleth is enabled, a shibboleth match attribute is set and matches koha matchpoint)
852
            # If we are in a shibboleth session (shibboleth is enabled, a shibboleth match attribute is set and matches koha matchpoint)
853
            if ( $shib and $shib_login and $shibSuccess and $type eq 'opac' ) {
853
            if ( $shib and $shib_login and $shibSuccess) {
854
855
                # (Note: $type eq 'opac' condition should be removed when shibboleth authentication for intranet will be implemented)
856
                logout_shib($query);
854
                logout_shib($query);
857
            }
855
            }
858
        }
856
        }
Lines 936-943 sub checkauth { Link Here
936
934
937
            my ( $return, $cardnumber );
935
            my ( $return, $cardnumber );
938
936
939
            # If shib is enabled and we have a shib login, does the login match a valid koha user
937
	    # If shib is enabled and we have a shib login, does the login match a valid koha user
940
            if ( $shib && $shib_login && $type eq 'opac' ) {
938
            if ( $shib && $shib_login ) {
941
                my $retuserid;
939
                my $retuserid;
942
940
943
                # Do not pass password here, else shib will not be checked in checkpw.
941
                # 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 41-46 Link Here
41
<div id="login_error"><strong>Error: </strong>Invalid username or password</div>
41
<div id="login_error"><strong>Error: </strong>Invalid username or password</div>
42
[% END %]
42
[% END %]
43
43
44
[% IF (shibbolethAuthentication) %]
45
<!-- This is what is displayed if shib login has failed -->
46
[% IF (invalidShibLogin ) %]
47
<div id="login_error"><Strong>Error: </strong>Shibboleth login failed</div>
48
[% END %]
49
<p>If you have a shibboleth account, please <a href="[% shibbolethLoginUrl %]">click here</a> to login.</p>
50
[% END %]
51
44
<!-- login prompt time-->
52
<!-- login prompt time-->
45
<form action="[% script_name %]" method="post" name="loginform" id="loginform">
53
<form action="[% script_name %]" method="post" name="loginform" id="loginform">
46
    <input type="hidden" name="koha_login_context" value="intranet" />
54
    <input type="hidden" name="koha_login_context" value="intranet" />
47
- 

Return to bug 12027