[LON-CAPA-cvs] cvs: loncom /interface loncreateuser.pm londropadd.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 19 Jul 2004 17:58:10 -0000


albertel		Mon Jul 19 13:58:10 2004 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm londropadd.pm 
  Log:
  - _ seems to be bad in usernames
  - enroll single student wasn't protecting the username from bad caharacters
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.84 loncom/interface/loncreateuser.pm:1.85
--- loncom/interface/loncreateuser.pm:1.84	Sat Jul  3 16:45:23 2004
+++ loncom/interface/loncreateuser.pm	Mon Jul 19 13:58:10 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.84 2004/07/03 20:45:23 albertel Exp $
+# $Id: loncreateuser.pm,v 1.85 2004/07/19 17:58:10 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -174,8 +174,8 @@
     my $ccuname=$ENV{'form.ccuname'};
     my $ccdomain=$ENV{'form.ccdomain'};
 
-    $ccuname=~s/\W//gs;
-    $ccdomain=~s/\W//gs;
+    $ccuname=~s/[\W|_]//gs;
+    $ccdomain=~s/[\W|_]//gs;
 
     unless (($ccuname) && ($ccdomain)) {
 	&print_username_entry_form($r);
Index: loncom/interface/londropadd.pm
diff -u loncom/interface/londropadd.pm:1.115 loncom/interface/londropadd.pm:1.116
--- loncom/interface/londropadd.pm:1.115	Tue Jun 29 00:30:00 2004
+++ loncom/interface/londropadd.pm	Mon Jul 19 13:58:10 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to drop and add students in courses 
 #
-# $Id: londropadd.pm,v 1.115 2004/06/29 04:30:00 raeburn Exp $
+# $Id: londropadd.pm,v 1.116 2004/07/19 17:58:10 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -924,6 +924,8 @@
     #
     my $username = $ENV{'form.cuname'};
     my $domain   = $ENV{'form.cudomain'};
+    $username=~s/[\W|_]//gs;
+    $domain=~s/[\W|_]//gs;
     my $home = &Apache::lonnet::homeserver($username,$domain);
     # $new_user flags whether we are creating a new user or using an old one
     my $new_user = 1;