--- loncom/interface/loncreateuser.pm 2005/01/11 20:49:05 1.95 +++ loncom/interface/loncreateuser.pm 2005/01/11 22:12:22 1.98 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.95 2005/01/11 20:49:05 albertel Exp $ +# $Id: loncreateuser.pm,v 1.98 2005/01/11 22:12:22 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -173,8 +173,8 @@ sub print_user_modification_page { my $ccuname=$ENV{'form.ccuname'}; my $ccdomain=$ENV{'form.ccdomain'}; - $ccuname=~s/[\W|_]//gs; - $ccdomain=~s/[\W|_]//gs; + $ccuname=~s/\W//g; + $ccdomain=~s/\W//g; unless (($ccuname) && ($ccdomain)) { &print_username_entry_form($r); @@ -1176,7 +1176,7 @@ END $r->print(&commit_customrole($securl,$three,$four,$five,$start,$end)); } } - } elsif ($_=~/^form\.act\_([^\_]+)\_([^\_]+)\_([^\_]+)$/) { + } elsif ($_=~/^form\.act\_([^\_]+)\_(\w+)\_([^\_]+)$/) { # Activate roles for sections with 3 id numbers # set start, end times, and the url for the class my ($one,$two,$three)=($1,$2,$3); @@ -1237,14 +1237,6 @@ END $r->print(&commit_standardrole($url,$2,$start,$end,$1,undef,'')); } } - # Assign the role and report it. - $r->print(&mt('Assigning').' '.$2.' in '.$url.': '. - ($start?', '.&mt('starting').' '.localtime($start):''). - ($end?', '.&mt('ending').' '.localtime($end):'').': '. - &Apache::lonnet::assignrole( - $ENV{'form.ccdomain'},$ENV{'form.ccuname'}, - $url,$2,$end,$start) - .'
'); } else { $r->print('

'.&mt('ERROR').': '.&mt('Unknown command').' '.$_.'


'); } @@ -1256,7 +1248,7 @@ END } sub commit_customrole { - my ($url,$three,$four,$five,$end,$start) = @_; + my ($url,$three,$four,$five,$start,$end) = @_; my $output = &mt('Assigning custom role').' "'.$five.'" by '.$four.'@'.$three.' in '.$url. ($start?', '.&mt('starting').' '.localtime($start):''). ($end?', ending '.localtime($end):'').': '.