version 1.14, 2007/12/12 19:47:56
|
version 1.15, 2007/12/12 23:59:41
|
Line 1920 END
|
Line 1920 END
|
$rolefilter = &Apache::lonnet::plaintext($env{'form.showrole'}); |
$rolefilter = &Apache::lonnet::plaintext($env{'form.showrole'}); |
} |
} |
my $results_description = &results_header_row($rolefilter,$statusmode, |
my $results_description = &results_header_row($rolefilter,$statusmode, |
$context); |
$context,$permission); |
$r->print('<b>'.$results_description.'</b><br />'); |
$r->print('<b>'.$results_description.'</b><br />'); |
my ($output,$actionselect); |
my ($output,$actionselect); |
if ($mode eq 'html' || $mode eq 'view') { |
if ($mode eq 'html' || $mode eq 'view') { |
Line 2530 END
|
Line 2530 END
|
} |
} |
|
|
sub results_header_row { |
sub results_header_row { |
my ($rolefilter,$statusmode,$context) = @_; |
my ($rolefilter,$statusmode,$context,$permission) = @_; |
my ($description,$showfilter); |
my ($description,$showfilter); |
if ($rolefilter ne 'Any') { |
if ($rolefilter ne 'Any') { |
$showfilter = $rolefilter; |
$showfilter = $rolefilter; |
Line 2550 sub results_header_row {
|
Line 2550 sub results_header_row {
|
$description .= &mt('All users in course with [_1] roles',$rolefilter); |
$description .= &mt('All users in course with [_1] roles',$rolefilter); |
} |
} |
} |
} |
|
if (exists($permission->{'view_section'})) { |
|
if ($env{'form.showrole'} eq 'st') { |
|
$description .= ' '.&mt('(section [_1] only)',$permission->{'view_section'}); |
|
} elsif ($env{'form.showrole'} eq 'any') { |
|
$description .= ' '.&mt('(section [_1] only)',$permission->{'view_section'}); |
|
} |
|
} |
} elsif ($context eq 'author') { |
} elsif ($context eq 'author') { |
$description = |
$description = |
&mt('Author space for <span class="LC_cusr_emph">[_1]</span>', |
&mt('Author space for <span class="LC_cusr_emph">[_1]</span>', |
Line 3693 ENDSECCODE
|
Line 3700 ENDSECCODE
|
return $setsection_js; |
return $setsection_js; |
} |
} |
|
|
|
sub can_create_user { |
|
my ($dom,$context,$usertype) = @_; |
|
my %domconf = &Apache::lonnet::get_dom('configuration',['usercreation'],$dom); |
|
my $cancreate = 1; |
|
if (ref($domconf{'usercreation'}) eq 'HASH') { |
|
if (ref($domconf{'usercreation'}{'cancreate'}) eq 'HASH') { |
|
if ($context eq 'course' || $context eq 'author') { |
|
my $creation = $domconf{'usercreation'}{'cancreate'}{$context}; |
|
if ($creation eq 'none') { |
|
$cancreate = 0; |
|
} elsif ($creation ne 'any') { |
|
if (defined($usertype)) { |
|
if ($creation ne $usertype) { |
|
$cancreate = 0; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
return $cancreate; |
|
} |
|
|
1; |
1; |
|
|