Prevent undefined var warning for username
authorDan Scott <dscott@laurentian.ca>
Sun, 16 Jun 2013 13:19:09 +0000 (09:19 -0400)
committerDan Scott <dscott@laurentian.ca>
Sun, 16 Jun 2013 13:19:09 +0000 (09:19 -0400)
EGCatLoader could generate undefined var warnings if submitted without a
username. Probably should just bail early rather than trying to log the
user in.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm

index 992852b..98fd69e 100644 (file)
@@ -357,7 +357,7 @@ sub load_login {
 
     $ctx->{page} = 'login';
 
-    my $username = $cgi->param('username');
+    my $username = $cgi->param('username') || '';
     $username =~ s/\s//g;  # Remove blanks
     my $password = $cgi->param('password');
     my $org_unit = $ctx->{physical_loc} || $ctx->{aou_tree}->()->id;