From: Dan Scott Date: Wed, 8 May 2013 14:49:05 +0000 (-0400) Subject: Merge remote-tracking branch 'conifer/feature/ldap_osul_2_4' into rel_2_4_mergery X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e3f4c3a32eee3765fc7b4fe7ff1e6e153939a9f6;p=contrib%2FConifer.git Merge remote-tracking branch 'conifer/feature/ldap_osul_2_4' into rel_2_4_mergery --- e3f4c3a32eee3765fc7b4fe7ff1e6e153939a9f6 diff --cc Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index 77b1543da5,4dc638f2aa..74c0700da2 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@@ -361,43 -359,11 +361,46 @@@ sub load_login my $persist = $cgi->param('persist'); # initial log form only + my $ticket = $cgi->param('ticket'); + my $cas_redirect_to = $cgi->param('redirect_to'); + if ($cgi->cookie(COOKIE_URL_CAS)) { + $cas_redirect_to = $cgi->cookie(COOKIE_URL_CAS); + } + my $cas_flag = '0'; + + # initial log form only + if ($ticket) { + # CAS does not have either username or password at this point, so we fudge these + # values for the other checks + $username = '_CAS_'; + $password = '_CAS_'; + + } + + my $login_page = sprintf('%s://%s%s/login',($self->ctx->{is_staff} ? 'oils' : 'https'), $self->ctx->{hostname}, $self->ctx->{opac_root}); + + # CAS does not handle complex URLs, so we put the URL in a cookie + if (!$cgi->cookie(COOKIE_URL_CAS) && $cas_redirect_to && !$username && !$password) { + return $self->generic_redirect( + "$login_page?redirect_to=$cas_redirect_to", + [ + # contains the service url for CAS + $cgi->cookie( + -name => COOKIE_URL_CAS, + -path => '/', + -secure => 0, + -value => $cas_redirect_to, + -expires => '+10m' + ) + ] + ); + } + return Apache2::Const::OK unless $username and $password; + # Should we append an email hostname to the username? + my $ou_email_host = $cgi->param('ou_email_host') || ''; + my $auth_proxy_enabled = 0; # default false try { # if the service is not running, just let this fail silently $auth_proxy_enabled = $U->simplereq(