version 1.140, 2012/08/21 01:50:34
|
version 1.142, 2012/10/02 18:08:12
|
Line 1691 sub print_userlist {
|
Line 1691 sub print_userlist {
|
} |
} |
} |
} |
if (keys(%userlist) == 0) { |
if (keys(%userlist) == 0) { |
|
my $msg = ''; |
if ($context eq 'author') { |
if ($context eq 'author') { |
$r->print(&mt('There are no co-authors to display.')."\n"); |
$msg = &mt('There are no co-authors to display.'); |
} elsif ($context eq 'domain') { |
} elsif ($context eq 'domain') { |
if ($env{'form.roletype'} eq 'domain') { |
if ($env{'form.roletype'} eq 'domain') { |
$r->print(&mt('There are no users with domain roles to display.')."\n"); |
$msg = &mt('There are no users with domain roles to display.'); |
} elsif ($env{'form.roletype'} eq 'author') { |
} elsif ($env{'form.roletype'} eq 'author') { |
$r->print(&mt('There are no authors or co-authors to display.')."\n"); |
$msg = &mt('There are no authors or co-authors to display.'); |
} elsif ($env{'form.roletype'} eq 'course') { |
} elsif ($env{'form.roletype'} eq 'course') { |
$r->print(&mt('There are no course users to display')."\n"); |
$msg = &mt('There are no course users to display'); |
} elsif ($env{'form.roletype'} eq 'community') { |
} elsif ($env{'form.roletype'} eq 'community') { |
$r->print(&mt('There are no community users to display')."\n"); |
$msg = &mt('There are no community users to display'); |
} |
} |
} elsif ($context eq 'course') { |
} elsif ($context eq 'course') { |
$r->print(&mt('There are no course users to display.')."\n"); |
$r->print(&mt('There are no course users to display.')."\n"); |
} |
} |
|
$r->print('<p class="LC_info"'.$msg.'</p>'."\n") if $msg; |
} else { |
} else { |
# Print out the available choices |
# Print out the available choices |
my $usercount; |
my $usercount; |
Line 1717 sub print_userlist {
|
Line 1719 sub print_userlist {
|
$permission,$env{'form.Status'},\%userlist,$keylist); |
$permission,$env{'form.Status'},\%userlist,$keylist); |
} |
} |
if (!$usercount) { |
if (!$usercount) { |
$r->print('<br /><span class="LC_warning">' |
$r->print('<br /><span class="LC_info">' |
.&mt('There are no users matching the search criteria.') |
.&mt('There are no users matching the search criteria.') |
.'</span>' |
.'</span>' |
); |
); |
Line 2539 END
|
Line 2541 END
|
if (&Apache::lonnet::allowed('c'.$role,$env{'request.course.id'}.'/'.$env{'request.course.sec'})) { |
if (&Apache::lonnet::allowed('c'.$role,$env{'request.course.id'}.'/'.$env{'request.course.sec'})) { |
$canchangesec{$role} = $env{'request.course.sec'}; |
$canchangesec{$role} = $env{'request.course.sec'}; |
} |
} |
|
} elsif ((($role eq 'co') && ($crstype eq 'Community')) || |
|
(($role eq 'cc') && ($crstype eq 'Course'))) { |
|
if (&is_courseowner($env{'request.course.id'}, |
|
$env{'course.'.$env{'request.course.id'}.'.internal.courseowner'})) { |
|
$canchange{$role} = 1; |
|
} |
} |
} |
} |
} |
} |
} |
Line 2854 END
|
Line 2862 END
|
if ($showcheckbox) { |
if ($showcheckbox) { |
$checkval = $user; |
$checkval = $user; |
if ($context eq 'course') { |
if ($context eq 'course') { |
if ($role eq 'st') { |
if (($role eq 'co' || $role eq 'cc') && |
$checkval .= ':st'; |
($user =~ /^\Q$env{'user.name'}:$env{'user.domain'}:$role\E/)) { |
} |
$showcheckbox = 0; |
$checkval .= ':'.$in{'section'}; |
} else { |
if ($role eq 'st') { |
if ($role eq 'st') { |
$checkval .= ':'.$in{'type'}.':'. |
$checkval .= ':st'; |
$in{'lockedtype'}; |
} |
} |
$checkval .= ':'.$in{'section'}; |
|
if ($role eq 'st') { |
|
$checkval .= ':'.$in{'type'}.':'. |
|
$in{'lockedtype'}; |
|
} |
|
} |
|
} |
|
if ($showcheckbox) { |
|
$r->print('<td><input type="checkbox" name="'. |
|
'actionlist" value="'.$checkval.'" /></td>'); |
|
} else { |
|
$r->print('<td> </td>'); |
} |
} |
$r->print('<td><input type="checkbox" name="'. |
|
'actionlist" value="'.$checkval.'" /></td>'); |
|
} else { |
} else { |
$r->print('<td> </td>'); |
$r->print('<td> </td>'); |
} |
} |
Line 3110 sub select_actions {
|
Line 3127 sub select_actions {
|
} |
} |
if ($context eq 'course') { |
if ($context eq 'course') { |
if ($env{'form.showrole'} ne 'Any') { |
if ($env{'form.showrole'} ne 'Any') { |
if (!&Apache::lonnet::allowed('c'.$env{'form.showrole'}, |
my $showactions; |
$env{'request.course.id'})) { |
if (&Apache::lonnet::allowed('c'.$env{'form.showrole'}, |
if ($env{'request.course.sec'} eq '') { |
$env{'request.course.id'})) { |
return; |
$showactions = 1; |
} else { |
} elsif ($env{'request.course.sec'} ne '') { |
if (!&Apache::lonnet::allowed('c'.$env{'form.showrole'},$env{'request.course.id'}.'/'.$env{'request.course.sec'})) { |
if (&Apache::lonnet::allowed('c'.$env{'form.showrole'},$env{'request.course.id'}.'/'.$env{'request.course.sec'})) { |
return; |
$showactions = 1; |
} |
} |
} |
} |
|
unless ($showactions) { |
|
unless (&is_courseowner($env{'request.course.id'}, |
|
$env{'course.'.$env{'request.course.id'}.'.internal.courseowner'})) { |
|
return; |
|
} |
} |
} |
} |
} |
} |
} |
Line 5751 sub authcheck_alerts {
|
Line 5773 sub authcheck_alerts {
|
return %alerts; |
return %alerts; |
} |
} |
|
|
|
sub is_courseowner { |
|
my ($thiscourse,$courseowner) = @_; |
|
if ($courseowner eq '') { |
|
if ($env{'request.course.id'} eq $thiscourse) { |
|
$courseowner = $env{'course.'.$env{'request.course.id'}.'.internal.courseowner'}; |
|
} |
|
} |
|
if ($courseowner ne '') { |
|
if ($courseowner eq $env{'user.name'}.':'.$env{'user.domain'}) { |
|
return 1; |
|
} |
|
} |
|
return; |
|
} |
|
|
1; |
1; |
|
|