use C4::Branch; # GetBranches
use C4::Search::History;
use Koha;
-use Koha::AuthUtils qw(hash_password);
+use Koha::AuthUtils qw(get_script_name hash_password);
use POSIX qw/strftime/;
use List::MoreUtils qw/ any /;
use Encode qw( encode is_utf8);
$template->param(
loginprompt => 1,
- script_name => _get_script_name(),
+ script_name => get_script_name(),
);
print $in->{query}->header(
{ type => 'text/html',
opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
login => 1,
INPUTS => \@inputs,
- script_name => _get_script_name(),
+ script_name => get_script_name(),
casAuthentication => C4::Context->preference("casAuthentication"),
shibbolethAuthentication => $shib,
SessionRestrictionByIP => C4::Context->preference("SessionRestrictionByIP"),
return 0;
}
-=head2 _get_script_name
-
-This returns the correct script name, for use in redirecting back to the correct page after showing
-the login screen. It depends on details of the package Plack configuration, and should not be used
-outside this context.
-
-=cut
-
-sub _get_script_name {
- # This is the method about.pl uses to detect Plack; now that two places use it, it MUST be
- # right.
- if ( ( any { /(^psgi\.|^plack\.)/i } keys %ENV ) && $ENV{SCRIPT_NAME} =~ m,^/(intranet|opac)(.*), ) {
- return '/cgi-bin/koha' . $2;
- } else {
- return $ENV{SCRIPT_NAME};
- }
-}
-
END { } # module clean-up code here (global destructor)
1;
__END__
use C4::Debug;
use C4::Context;
+use Koha::AuthUtils qw(get_script_name);
use Authen::CAS::Client;
use CGI qw ( -utf8 );
use FindBin;
my $type = shift;
my $uri_base_part = ($type eq 'opac') ?
- C4::Context->preference('OPACBaseURL') . $query->script_name():
+ C4::Context->preference('OPACBaseURL') . get_script_name() :
C4::Context->preference('staffClientBaseURL');
my $uri_params_part = '';
use C4::Debug;
use C4::Context;
+use Koha::AuthUtils qw(get_script_name);
use Koha::Database;
use Carp;
use CGI;
sub login_shib_url {
my ($query) = @_;
- my $param = _get_uri() . $query->script_name();
+ my $param = _get_uri() . get_script_name();
if ( $query->query_string() ) {
$param = $param . '%3F' . $query->query_string();
}
use Crypt::Eksblowfish::Bcrypt qw(bcrypt en_base64);
use Encode qw( encode is_utf8 );
use Fcntl qw/O_RDONLY/; # O_RDONLY is used in generate_salt
+use List::MoreUtils qw/ any /;
use base 'Exporter';
our $VERSION = '1.01';
-our @EXPORT_OK = qw(hash_password);
+our @EXPORT_OK = qw(hash_password get_script_name);
=head1 NAME
close SOURCE;
return $string;
}
+
+=head2 get_script_name
+
+This returns the correct script name, for use in redirecting back to the correct page after showing
+the login screen. It depends on details of the package Plack configuration, and should not be used
+outside this context.
+
+=cut
+
+sub get_script_name {
+ # This is the method about.pl uses to detect Plack; now that two places use it, it MUST be
+ # right.
+ if ( ( any { /(^psgi\.|^plack\.)/i } keys %ENV ) && $ENV{SCRIPT_NAME} =~ m,^/(intranet|opac)(.*), ) {
+ return '/cgi-bin/koha' . $2;
+ } else {
+ return $ENV{SCRIPT_NAME};
+ }
+}
+
1;
__END__