--- loncom/interface/loncreateuser.pm 2007/07/20 23:52:55 1.157 +++ loncom/interface/loncreateuser.pm 2007/07/20 23:57:06 1.159 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.157 2007/07/20 23:52:55 albertel Exp $ +# $Id: loncreateuser.pm,v 1.159 2007/07/20 23:57:06 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -65,7 +65,6 @@ use Apache::lonnet; use Apache::loncommon; use Apache::lonlocal; use Apache::longroup; -use lib '/home/httpd/lib/perl/'; use LONCAPA qw(:DEFAULT :match); my $loginscript; # piece of javascript used in two separate instances @@ -429,9 +428,8 @@ ENDSCRIPT var checkcurr = str.match(re1); if (checkcurr != null) { if (document.cu.elements[i-1].checked == true) { - var re2 = /^currsec_[a-zA-Z0-9]+_[a-zA-Z0-9]+_(\\w+)\$/; - match = re2.exec(str); - var role = match[1]; + var match = str.split('_'); + var role = match[3]; if (role == 'cc') { alert("Section designations do not apply to Course Coordinator roles.\\nA course coordinator role will be added with access to all sections."); } @@ -1346,14 +1344,14 @@ END if ($2 eq 'st') { $1=~m{^/($match_domain)/($match_courseid)}; my $cid=$1.'_'.$2; - $r->print(&mt('Drop from classlist').': '. - &Apache::lonnet::critical('put:'. - $env{'course.'.$cid.'.domain'}.':'. - $env{'course.'.$cid.'.num'}.':classlist:'. - &escape($env{'form.ccuname'}.':'. - $env{'form.ccdomain'}).'='. - &escape($now.':'), - $env{'course.'.$cid.'.home'}).'
'); + my $user = $env{'form.ccuname'}.':'.$env{'form.ccdomain'}; + my $result = + &Apache::lonnet::cput('classlist', + { $user => $now }, + $env{'course.'.$cid.'.domain'}, + $env{'course.'.$cid.'.num'}); + $r->print(&mt('Drop from classlist: [_1]', + ''.$result.'').'
'); } } if ($key=~m{^form\.rev\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) { @@ -1373,14 +1371,14 @@ END if ($2 eq 'st') { $1=~m{^/($match_domain)/($match_courseid)}; my $cid=$1.'_'.$2; - $r->print(&mt('Drop from classlist').': '. - &Apache::lonnet::critical('put:'. - $env{'course.'.$cid.'.domain'}.':'. - $env{'course.'.$cid.'.num'}.':classlist:'. - &escape($env{'form.ccuname'}.':'. - $env{'form.ccdomain'}).'='. - &escape($now.':'), - $env{'course.'.$cid.'.home'}).'
'); + my $user = $env{'form.ccuname'}.':'.$env{'form.ccdomain'}; + my $result = + &Apache::lonnet::cput('classlist', + { $user => $now }, + $env{'course.'.$cid.'.domain'}, + $env{'course.'.$cid.'.num'}); + $r->print(&mt('Drop from classlist: [_1]', + ''.$result.'').'
'); } } if ($key=~m{^form\.del\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) {