[open-ils-commits] [GIT] Evergreen ILS branch master updated. 3670571e47fba3dc38aeec11a5f73ddc6cbea0ce

Evergreen Git git at git.evergreen-ils.org
Sun Jul 29 23:56:44 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  3670571e47fba3dc38aeec11a5f73ddc6cbea0ce (commit)
       via  a93650be26cfcd0118c8c816955a2cb2e8724acc (commit)
      from  d128743dccb6a252f2765d93fcd5cefc0e7f958d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3670571e47fba3dc38aeec11a5f73ddc6cbea0ce
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Tue Jul 24 12:39:49 2012 -0400

    TPAC: Fix org_unit location detection for login
    
    The TPAC login function currently looks for a 'loc' param to pass
    to the login service.  This isn't right because:
    
    A. 'loc' is a search-related param, and shouldn't affect logins
    B. The login form doesn't actually pass through the 'loc' param
    C. The 'loc' param has been more or less replaced by 'locg'
    
    No, this isn't multiple choice, it's all of the above.  Our best
    option at this point is to use the 'physical_loc' value instead.
    This matches what was done in JSPAC (though it was called 'ol' for
    "original location" back then).
    
    Finally, this commit is 95% the work of Dan Scott, including the
    additions of logging info and a few whitespace fixes.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Dan Scott <dan at coffeecode.net>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
index af25ecd..64903e9 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
@@ -339,11 +339,13 @@ sub load_login {
     my $cgi = $self->cgi;
     my $ctx = $self->ctx;
 
+    $self->timelog("Load login begins");
+
     $ctx->{page} = 'login';
 
     my $username = $cgi->param('username');
     my $password = $cgi->param('password');
-    my $org_unit = $cgi->param('loc') || $ctx->{aou_tree}->()->id;
+    my $org_unit = $ctx->{physical_loc} || $ctx->{aou_tree}->()->id;
     my $persist = $cgi->param('persist');
 
     # initial log form only
@@ -356,7 +358,9 @@ sub load_login {
             'open-ils.auth_proxy.enabled');
     } catch Error with {};
 
-    my $args = {	
+    $self->timelog("Checked for auth proxy: $auth_proxy_enabled; org = $org_unit; username = $username");
+
+    my $args = {
         type => ($persist) ? 'persist' : 'opac',
         org => $org_unit,
         agent => 'opac'
@@ -379,14 +383,15 @@ sub load_login {
             'open-ils.auth',
             'open-ils.auth.authenticate.init', $username);
         $args->{password} = md5_hex($seed . md5_hex($password));
-	    $response = $U->simplereq(
+        $response = $U->simplereq(
             'open-ils.auth', 'open-ils.auth.authenticate.complete', $args);
     } else {
         $args->{password} = $password;
-	    $response = $U->simplereq(
+        $response = $U->simplereq(
             'open-ils.auth_proxy',
             'open-ils.auth_proxy.login', $args);
     }
+    $self->timelog("Checked password");
 
     if($U->event_code($response)) { 
         # login failed, report the reason to the template

commit a93650be26cfcd0118c8c816955a2cb2e8724acc
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Fri Jun 15 16:11:57 2012 -0400

    Extend AuthProxy.pm Support to TPAC
    
    AuthProxy-enabled logins (e.g. LDAP) were not yet wired into TPAC.
    This adds TPAC support equivalent to that in JSPAC.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Dan Scott <dan at coffeecode.net>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
index 7154f66..af25ecd 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
@@ -349,14 +349,16 @@ sub load_login {
     # initial log form only
     return Apache2::Const::OK unless $username and $password;
 
-	my $seed = $U->simplereq(
-        'open-ils.auth', 
-		'open-ils.auth.authenticate.init', $username);
+    my $auth_proxy_enabled = 0; # default false
+    try { # if the service is not running, just let this fail silently
+        $auth_proxy_enabled = $U->simplereq(
+            'open-ils.auth_proxy',
+            'open-ils.auth_proxy.enabled');
+    } catch Error with {};
 
     my $args = {	
-        username => $username, 
-        password => md5_hex($seed . md5_hex($password)), 
         type => ($persist) ? 'persist' : 'opac',
+        org => $org_unit,
         agent => 'opac'
     };
 
@@ -365,11 +367,26 @@ sub load_login {
     # To avoid surprises, default to "Barcodes start with digits"
     $bc_regex = '^\d' unless $bc_regex;
 
-    $args->{barcode} = delete $args->{username} 
-        if $bc_regex and ($username =~ /$bc_regex/);
+    if ($bc_regex and ($username =~ /$bc_regex/)) {
+        $args->{barcode} = $username;
+    } else {
+        $args->{username} = $username;
+    }
 
-	my $response = $U->simplereq(
-        'open-ils.auth', 'open-ils.auth.authenticate.complete', $args);
+    my $response;
+    if (!$auth_proxy_enabled) {
+        my $seed = $U->simplereq(
+            'open-ils.auth',
+            'open-ils.auth.authenticate.init', $username);
+        $args->{password} = md5_hex($seed . md5_hex($password));
+	    $response = $U->simplereq(
+            'open-ils.auth', 'open-ils.auth.authenticate.complete', $args);
+    } else {
+        $args->{password} = $password;
+	    $response = $U->simplereq(
+            'open-ils.auth_proxy',
+            'open-ils.auth_proxy.login', $args);
+    }
 
     if($U->event_code($response)) { 
         # login failed, report the reason to the template

-----------------------------------------------------------------------

Summary of changes:
 .../src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm    |   44 +++++++++++++++-----
 1 files changed, 33 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list