[LON-CAPA-cvs] cvs: loncom /auth lonacc.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 07 Sep 2006 20:57:10 -0000


albertel		Thu Sep  7 16:57:10 2006 EDT

  Modified files:              
    /loncom/auth	lonacc.pm 
  Log:
  - clean $r->user just in case
  
  
Index: loncom/auth/lonacc.pm
diff -u loncom/auth/lonacc.pm:1.96 loncom/auth/lonacc.pm:1.97
--- loncom/auth/lonacc.pm:1.96	Tue Sep  5 13:33:06 2006
+++ loncom/auth/lonacc.pm	Thu Sep  7 16:57:04 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Cookie Based Access Handler
 #
-# $Id: lonacc.pm,v 1.96 2006/09/05 17:33:06 albertel Exp $
+# $Id: lonacc.pm,v 1.97 2006/09/07 20:57:04 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -154,20 +154,22 @@
 	return undef;
     }
 
+    my ($user) = ($r->user =~ m/([a-zA-Z0-9_\-@.]*)/);
+
     my $domain = $r->dir_config('lonDefDomain');
-    my $home=&Apache::lonnet::homeserver($r->user,$domain);
+    my $home=&Apache::lonnet::homeserver($user,$domain);
     if ($home !~ /(con_lost|no_host|no_such_host)/) {
 	if ($r->dir_config("lonBalancer") eq 'yes') {
 	    # login but immeaditly go to switch server to find us a new 
 	    # machine
-	    &Apache::lonauth::success($r,$r->user,$domain,$home,'noredirect');
+	    &Apache::lonauth::success($r,$user,$domain,$home,'noredirect');
 	    $r->internal_redirect('/adm/switchserver');
 	} else {
 	    # need to login them in, so generate the need data that
 	    # migrate expects to do login
 	    my %info=('ip'        => $r->connection->remote_ip(),
 		      'domain'    => $domain,
-		      'username'  => $r->user,
+		      'username'  => $user,
 		      'server'    => $r->dir_config('lonHostID'),
 		      'sso.login' => 1
 		      );