version 1.124, 2010/09/20 00:10:29
|
version 1.131, 2010/11/14 20:29:34
|
Line 47 sub modifystudent {
|
Line 47 sub modifystudent {
|
# this one. If $csec is defined, drop them from all other sections of |
# this one. If $csec is defined, drop them from all other sections of |
# this course and add them to section $csec |
# this course and add them to section $csec |
my ($cnum,$cdom) = &get_course_identity($courseid); |
my ($cnum,$cdom) = &get_course_identity($courseid); |
my %roles = &Apache::lonnet::dump('roles',$udom,$unam); |
my $extra = &Apache::lonnet::freeze_escape({'skipcheck' => 1}); |
|
my %roles = &Apache::lonnet::dump('roles',$udom,$unam,'.',undef,$extra); |
my ($tmp) = keys(%roles); |
my ($tmp) = keys(%roles); |
# Bail out if we were unable to get the students roles |
# Bail out if we were unable to get the students roles |
return "$1" if ($tmp =~ /^(con_lost|error|no_such_host)/i); |
return "$1" if ($tmp =~ /^(con_lost|error|no_such_host)/i); |
Line 533 END
|
Line 534 END
|
if (message!='') { |
if (message!='') { |
message+='\\n'; |
message+='\\n'; |
} |
} |
|
message+='$alert{'section'}'; |
} |
} |
if (foundemail==0) { |
if (foundemail==0) { |
if (message!='') { |
if (message!='') { |
Line 735 function verify(vf,sec_caller) {
|
Line 737 function verify(vf,sec_caller) {
|
var foundname=0; |
var foundname=0; |
var foundid=0; |
var foundid=0; |
var foundsec=0; |
var foundsec=0; |
|
var foundemail=0; |
var foundrole=0; |
var foundrole=0; |
var founddomain=0; |
var founddomain=0; |
var foundinststatus=0; |
var foundinststatus=0; |
Line 746 function verify(vf,sec_caller) {
|
Line 749 function verify(vf,sec_caller) {
|
if (i==6 && tw!=0) { foundid=1; } |
if (i==6 && tw!=0) { foundid=1; } |
if (i==7 && tw!=0) { foundsec=1; } |
if (i==7 && tw!=0) { foundsec=1; } |
if (i==8 && tw!=0) { foundpwd=1; } |
if (i==8 && tw!=0) { foundpwd=1; } |
if (i==9 && tw!=0) { foundrole=1; } |
if (i==9 && tw!=0) { foundemail=1; } |
if (i==10 && tw!=0) { founddomain=1; } |
if (i==10 && tw!=0) { foundrole=1; } |
if (i==13 && tw!=0) { foundinstatus=1; } |
if (i==11 && tw!=0) { founddomain=1; } |
|
if (i==12 && tw!=0) { foundinstatus=1; } |
} |
} |
verify_message(vf,founduname,foundpwd,foundname,foundid,foundsec,foundrole,founddomain,foundinststatus); |
verify_message(vf,founduname,foundpwd,foundname,foundid,foundsec,foundemail,foundrole,founddomain,foundinststatus); |
} |
} |
|
|
function flip(vf,tf) { |
function flip(vf,tf) { |
Line 3971 sub upfile_drop_add {
|
Line 3975 sub upfile_drop_add {
|
my @secs; |
my @secs; |
my %entries=&Apache::loncommon::record_sep($line); |
my %entries=&Apache::loncommon::record_sep($line); |
# Determine user name |
# Determine user name |
|
$entries{$fields{'username'}} =~ s/^\s+|\s+$//g; |
unless (($entries{$fields{'username'}} eq '') || |
unless (($entries{$fields{'username'}} eq '') || |
(!defined($entries{$fields{'username'}}))) { |
(!defined($entries{$fields{'username'}}))) { |
my ($fname, $mname, $lname,$gen) = ('','','',''); |
my ($fname, $mname, $lname,$gen) = ('','','',''); |
Line 3991 sub upfile_drop_add {
|
Line 3996 sub upfile_drop_add {
|
$gen=$entries{$fields{'gen'}}; |
$gen=$entries{$fields{'gen'}}; |
} |
} |
} |
} |
|
|
if ($entries{$fields{'username'}} |
if ($entries{$fields{'username'}} |
ne &LONCAPA::clean_username($entries{$fields{'username'}})) { |
ne &LONCAPA::clean_username($entries{$fields{'username'}})) { |
|
my $nowhitespace; |
|
if ($entries{$fields{'username'}} =~ /\s/) { |
|
$nowhitespace = ' - '.&mt('usernames may not contain spaces.'); |
|
} |
$r->print('<br />'. |
$r->print('<br />'. |
&mt('[_1]: Unacceptable username for user [_2] [_3] [_4] [_5]', |
&mt('[_1]: Unacceptable username for user [_2] [_3] [_4] [_5]', |
'<b>'.$entries{$fields{'username'}}.'</b>',$fname,$mname,$lname,$gen)); |
'<b>'.$entries{$fields{'username'}}.'</b>',$fname,$mname,$lname,$gen). |
|
$nowhitespace); |
next; |
next; |
} else { |
} else { |
|
$entries{$fields{'domain'}} =~ s/^\s+|\s+$//g; |
if ($entries{$fields{'domain'}} |
if ($entries{$fields{'domain'}} |
ne &LONCAPA::clean_domain($entries{$fields{'domain'}})) { |
ne &LONCAPA::clean_domain($entries{$fields{'domain'}})) { |
$r->print('<br />'. '<b>'.$entries{$fields{'domain'}}. |
$r->print('<br />'. '<b>'.$entries{$fields{'domain'}}. |
Line 4056 sub upfile_drop_add {
|
Line 4068 sub upfile_drop_add {
|
# determine email address |
# determine email address |
my $email=''; |
my $email=''; |
if (defined($fields{'email'})) { |
if (defined($fields{'email'})) { |
|
$entries{$fields{'email'}} =~ s/^\s+|\s+$//g; |
if (defined($entries{$fields{'email'}})) { |
if (defined($entries{$fields{'email'}})) { |
$email=$entries{$fields{'email'}}; |
$email=$entries{$fields{'email'}}; |
unless ($email=~/^[^\@]+\@[^\@]+$/) { $email=''; } |
unless ($email=~/^[^\@]+\@[^\@]+$/) { $email=''; } |
Line 4102 sub upfile_drop_add {
|
Line 4115 sub upfile_drop_add {
|
$role = $defaultrole; |
$role = $defaultrole; |
} |
} |
# Clean up whitespace |
# Clean up whitespace |
foreach (\$id,\$fname,\$mname,\$lname,\$gen) { |
foreach (\$id,\$fname,\$mname,\$lname,\$gen,\$inststatus) { |
$$_ =~ s/(\s+$|^\s+)//g; |
$$_ =~ s/(\s+$|^\s+)//g; |
} |
} |
# check against rules |
# check against rules |
Line 4299 sub upfile_drop_add {
|
Line 4312 sub upfile_drop_add {
|
} |
} |
} # end of foreach (@userdata) |
} # end of foreach (@userdata) |
# Flush the course logs so reverse user roles immediately updated |
# Flush the course logs so reverse user roles immediately updated |
$r->register_cleanup(\&Apache::lonnet::flushcourselogs()); |
$r->register_cleanup(\&Apache::lonnet::flushcourselogs); |
$r->print("</p>\n<p>\n".&mt('Processed [quant,_1,user].',$counts{'user'}). |
$r->print("</p>\n<p>\n".&mt('Processed [quant,_1,user].',$counts{'user'}). |
"</p>\n"); |
"</p>\n"); |
if ($counts{'role'} > 0) { |
if ($counts{'role'} > 0) { |
Line 4791 sub update_user_list {
|
Line 4804 sub update_user_list {
|
$r->print('<p>'.&mt('Re-enabling will re-activate data for the role.').'</p>'); |
$r->print('<p>'.&mt('Re-enabling will re-activate data for the role.').'</p>'); |
} |
} |
# Flush the course logs so reverse user roles immediately updated |
# Flush the course logs so reverse user roles immediately updated |
&Apache::lonnet::flushcourselogs(); |
$r->register_cleanup(\&Apache::lonnet::flushcourselogs); |
} |
} |
if ($env{'form.makedatesdefault'}) { |
if ($env{'form.makedatesdefault'}) { |
if ($choice eq 'chgdates' || $choice eq 'reenable' || $choice eq 'activate') { |
if ($choice eq 'chgdates' || $choice eq 'reenable' || $choice eq 'activate') { |
Line 5006 sub setsections_javascript {
|
Line 5019 sub setsections_javascript {
|
accr => 'A course coordinator role will be added with access to all sections.', |
accr => 'A course coordinator role will be added with access to all sections.', |
acor => 'A coordinator role will be added with access to all sections', |
acor => 'A coordinator role will be added with access to all sections', |
inea => 'In each course, each user may only have one student role at a time.', |
inea => 'In each course, each user may only have one student role at a time.', |
inec => 'In each community, each user may only have one member role at a time.', |
inco => 'In each community, each user may only have one member role at a time.', |
youh => 'You had selected ', |
youh => 'You had selected ', |
secs => 'sections.', |
secs => 'sections.', |
plmo => 'Please modify your selections so they include no more than one section.', |
plmo => 'Please modify your selections so they include no more than one section.', |