|
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 |
} |