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