version 1.136.6.1, 2012/02/08 16:27:28
|
version 1.138, 2012/04/25 21:22:01
|
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 1422 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 2321 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" |
|
'extent' => "extent", |
'extent' => "extent", |
'pr' => "Proceed", |
'pr' => "Proceed", |
'ca' => "check all", |
'ca' => "check all", |
Line 2370 END
|
Line 2369 END
|
push(@cols,'groups'); |
push(@cols,'groups'); |
} |
} |
push(@cols,'email'); |
push(@cols,'email'); |
if ($context eq 'course') { |
|
push(@cols,'lastlogin'); |
|
} |
|
} |
} |
|
|
my $rolefilter = $env{'form.showrole'}; |
my $rolefilter = $env{'form.showrole'}; |
Line 2597 END
|
Line 2593 END
|
Future => 'Future', |
Future => 'Future', |
Expired => 'Expired', |
Expired => 'Expired', |
); |
); |
# If this is for a single course get last course "log-in". |
|
my %crslogins; |
|
if ($context eq 'course') { |
|
%crslogins=&Apache::lonnet::dump('nohist_crslastlogin',$cdom,$cnum); |
|
} |
|
# Get groups, role, permanent e-mail so we can sort on them if |
# Get groups, role, permanent e-mail so we can sort on them if |
# necessary. |
# necessary. |
foreach my $user (keys(%{$userlist})) { |
foreach my $user (keys(%{$userlist})) { |
Line 2750 END
|
Line 2741 END
|
$in{'end'} = &Apache::lonlocal::locallocaltime($in{'end'}); |
$in{'end'} = &Apache::lonlocal::locallocaltime($in{'end'}); |
} |
} |
} |
} |
if ($context eq 'course') { |
|
my $lastlogin = $crslogins{$in{'username'}.':'.$in{'domain'}.':'.$in{'section'}.':'.$role}; |
|
if ($lastlogin ne '') { |
|
$in{'lastlogin'} = &Apache::lonlocal::locallocaltime($lastlogin); |
|
} |
|
} |
|
if ($mode eq 'view' || $mode eq 'html' || $mode eq 'autoenroll' || $mode eq 'pickauthor') { |
if ($mode eq 'view' || $mode eq 'html' || $mode eq 'autoenroll' || $mode eq 'pickauthor') { |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
my $checkval; |
my $checkval; |