Bugzilla – Attachment 3551 Details for
Bug 5630
CAS improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Follow up 2
0003-Bug-5630-add-PSGI-ability-to-C4-Auth.patch (text/plain), 3.62 KB, created by
Chris Cormack
on 2011-03-30 21:29:37 UTC
(
hide
)
Description:
Follow up 2
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2011-03-30 21:29:37 UTC
Size:
3.62 KB
patch
obsolete
>From f690488b26bfbd7982463d407012f8466d902afc Mon Sep 17 00:00:00 2001 >From: Marc Chantreux <marc.chantreux@biblibre.com> >Date: Thu, 27 May 2010 00:02:14 +0200 >Subject: [PATCH] Bug 5630 add PSGI ability to C4::Auth > >--- > C4/Auth.pm | 45 ++++++++++++++++++++++++++++++--------------- > 1 files changed, 30 insertions(+), 15 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index fa4fd04..347012e 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -32,23 +32,30 @@ use C4::Koha; > use C4::Branch; # GetBranches > use C4::VirtualShelves; > use POSIX qw/strftime/; >+use List::MoreUtils qw/ any /; > > # use utf8; > use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $debug $ldap $cas $caslogout); > > BEGIN { >- $VERSION = 3.02; # set version for version checking >- $debug = $ENV{DEBUG}; >- @ISA = qw(Exporter); >- @EXPORT = qw(&checkauth &get_template_and_user &haspermission &get_user_subpermissions); >- @EXPORT_OK = qw(&check_api_auth &get_session &check_cookie_auth &checkpw &get_all_subpermissions &get_user_subpermissions); >- %EXPORT_TAGS = (EditPermissions => [qw(get_all_subpermissions get_user_subpermissions)]); >- $ldap = C4::Context->config('useldapserver') || 0; >- $cas = C4::Context->preference('casAuthentication'); >- $caslogout = C4::Context->preference('casLogout'); >+ sub psgi_env { any { /^psgi\./ } keys %ENV } >+ sub safe_exit { >+ if ( psgi_env ) { die 'psgi:exit' } >+ else { exit } >+ } >+ >+ $VERSION = 3.02; # set version for version checking >+ $debug = $ENV{DEBUG}; >+ @ISA = qw(Exporter); >+ @EXPORT = qw(&checkauth &get_template_and_user &haspermission &get_user_subpermissions); >+ @EXPORT_OK = qw(&check_api_auth &get_session &check_cookie_auth &checkpw &get_all_subpermissions &get_user_subpermissions); >+ %EXPORT_TAGS = ( EditPermissions => [qw(get_all_subpermissions get_user_subpermissions)] ); >+ $ldap = C4::Context->config('useldapserver') || 0; >+ $cas = C4::Context->preference('casAuthentication'); >+ $caslogout = C4::Context->preference('casLogout'); > if ($ldap) { >- require C4::Auth_with_ldap; # no import >- import C4::Auth_with_ldap qw(checkpw_ldap); >+ require C4::Auth_with_ldap; >+ # no import import C4::Auth_with_ldap qw(checkpw_ldap); > } > if ($cas) { > require C4::Auth_with_cas; # no import >@@ -547,8 +554,16 @@ sub _version_check ($$) { > if (C4::Context->preference('OpacMaintenance') && $type eq 'opac') { > warn "OPAC Install required, redirecting to maintenance"; > print $query->redirect("/cgi-bin/koha/maintenance.pl"); >- } >- exit; >+ } >+ unless ( $version = C4::Context->preference('Version') ) { # assignment, not comparison >+ if ( $type ne 'opac' ) { >+ warn "Install required, redirecting to Installer"; >+ print $query->redirect("/cgi-bin/koha/installer/install.pl"); >+ } else { >+ warn "OPAC Install required, redirecting to maintenance"; >+ print $query->redirect("/cgi-bin/koha/maintenance.pl"); >+ } >+ safe_exit; > } > > # check that database and koha version are the same >@@ -568,7 +583,7 @@ sub _version_check ($$) { > warn sprintf("OPAC: " . $warning, 'maintenance'); > print $query->redirect("/cgi-bin/koha/maintenance.pl"); > } >- exit; >+ safe_exit; > } > } > >@@ -984,7 +999,7 @@ sub checkauth { > -cookie => $cookie > ), > $template->output; >- exit; >+ safe_exit; > } > > =head2 check_api_auth >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5630
:
3549
|
3550
|
3551
|
3552
|
3553
|
3813
|
4716
|
5219
|
5297