version 1.136.6.2, 2012/02/08 19:35:20
|
version 1.139, 2012/08/19 00:18:16
|
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 $extra = &Apache::lonnet::freeze_escape({'skipcheck' => 1}); |
my %roles = &Apache::lonnet::dump('roles',$udom,$unam); |
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 342 sub print_upload_manager_header {
|
Line 341 sub print_upload_manager_header {
|
."</p>\n"); |
."</p>\n"); |
$r->print('<div class="LC_left_float"><h3>'. |
$r->print('<div class="LC_left_float"><h3>'. |
&mt('Identify fields in uploaded list')."</h3>\n"); |
&mt('Identify fields in uploaded list')."</h3>\n"); |
$r->print(&mt('Enter as many fields as you can.').'<br />'. |
$r->print(&mt('Enter as many fields as you can.<br /> The system will inform you and bring you back to this page, <br /> if the data selected are insufficient to add users.')."<br />\n"); |
&mt('The system will inform you and bring you back to this page, [_1]if the data selected are insufficient to add users.','<br />')."<br />\n"); |
|
$r->print(&hidden_input('action','upload'). |
$r->print(&hidden_input('action','upload'). |
&hidden_input('state','got_file'). |
&hidden_input('state','got_file'). |
&hidden_input('associate',''). |
&hidden_input('associate',''). |
Line 1423 sub curr_role_permissions {
|
Line 1421 sub curr_role_permissions {
|
sub my_custom_roles { |
sub my_custom_roles { |
my ($crstype) = @_; |
my ($crstype) = @_; |
my %returnhash=(); |
my %returnhash=(); |
|
my $extra = &Apache::lonnet::freeze_escape({'skipcheck' => 1}); |
my %rolehash=&Apache::lonnet::dump('roles'); |
my %rolehash=&Apache::lonnet::dump('roles'); |
foreach my $key (keys(%rolehash)) { |
foreach my $key (keys(%rolehash)) { |
if ($key=~/^rolesdef\_(\w+)$/) { |
if ($key=~/^rolesdef\_(\w+)$/) { |
Line 2322 END
|
Line 2321 END
|
'type' => "enroll type/action", |
'type' => "enroll type/action", |
'email' => "e-mail address", |
'email' => "e-mail address", |
'photo' => "photo", |
'photo' => "photo", |
'lastlogin' => "last login" |
'lastlogin' => "last login", |
'extent' => "extent", |
'extent' => "extent", |
'pr' => "Proceed", |
'pr' => "Proceed", |
'ca' => "check all", |
'ca' => "check all", |
Line 4181 sub upfile_drop_add {
|
Line 4180 sub upfile_drop_add {
|
} |
} |
$checkid = 1; |
$checkid = 1; |
$newuser = 1; |
$newuser = 1; |
if ($username =~/^[^\@]+\@[^\@]+$/) { |
my $user = $username.':'.$newuserdom; |
if ($email eq '') { |
|
$email = $username; |
|
} |
|
my $lc_email; |
|
if ($username eq $email) { |
|
$lc_email = lc($email); |
|
} |
|
my $lc_username = lc($username); |
|
if ($lc_username ne $username) { |
|
if ($username eq $email) { |
|
$email = $lc_username; |
|
} |
|
$username = $lc_username; |
|
$uhome=&Apache::lonnet::homeserver($username,$userdomain); |
|
if ($uhome ne 'no_host') { |
|
$newuser = 0; |
|
} |
|
} |
|
} |
|
} |
|
my $user = $username.':'.$newuserdom; |
|
if ($newuser) { |
|
my $checkhash; |
my $checkhash; |
my $checks = { 'username' => 1 }; |
my $checks = { 'username' => 1 }; |
$checkhash->{$user} = { 'newuser' => 1, }; |
$checkhash->{$username.':'.$newuserdom} = { 'newuser' => 1, }; |
&Apache::loncommon::user_rule_check($checkhash,$checks, |
&Apache::loncommon::user_rule_check($checkhash,$checks, |
\%alerts,\%rulematch,\%inst_results,\%curr_rules, |
\%alerts,\%rulematch,\%inst_results,\%curr_rules, |
\%got_rules); |
\%got_rules); |
Line 4228 sub upfile_drop_add {
|
Line 4205 sub upfile_drop_add {
|
} |
} |
unless ($cancreate{$usertype}) { |
unless ($cancreate{$usertype}) { |
my $showtype = $longtypes{$usertype}; |
my $showtype = $longtypes{$usertype}; |
if ($usertype eq 'unofficial') { |
$r->print('<br />'. |
$r->print('<br />'. |
&mt('[_1]: The user does not exist, and you are not permitted to create users of type: [_2].','<b>'.$username.'</b>',$showtype)); |
&mt("[_1]: The user does not exist, and the new user's username must be an e-mail address.",'<b>'.$username.'</b>')); |
|
} else { |
|
$r->print('<br />'. |
|
&mt("[_1]: The user does not exist, and you are not permitted to create users of type: [_2].",'<b>'.$username.'</b>',$showtype)); |
|
} |
|
next; |
next; |
} |
} |
} else { |
} else { |