version 1.178, 2016/11/09 00:32:45
|
version 1.180, 2017/01/02 19:44:07
|
Line 2572 function username_display_launch(usernam
|
Line 2572 function username_display_launch(usernam
|
} |
} |
} |
} |
} |
} |
if (target == 'modify') { |
if ((target == 'modify') || (target == 'activity')) { |
|
var nextaction = 'singleuser'; |
|
if (target == 'activity') { |
|
nextaction = 'accesslogs'; |
|
} |
if (document.$formname.userwin.checked == true) { |
if (document.$formname.userwin.checked == true) { |
var url = '/adm/createuser?srchterm='+username+'&srchdomain='+domain+'&phase=get_user_info&action=singleuser&srchin=dom&srchby=uname&srchtype=exact&popup=1'; |
var url = '/adm/createuser?srchterm='+username+'&srchdomain='+domain+'&phase=get_user_info&srchin=dom&srchby=uname&srchtype=exact&popup=1&action='+nextaction; |
var options = 'height=600,width=800,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no'; |
var options = 'height=600,width=800,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no'; |
modifywin = window.open(url,'',options,1); |
modifywin = window.open(url,'',options,1); |
modifywin.focus(); |
modifywin.focus(); |
Line 2583 function username_display_launch(usernam
|
Line 2587 function username_display_launch(usernam
|
document.$formname.srchterm.value=username; |
document.$formname.srchterm.value=username; |
document.$formname.srchdomain.value=domain; |
document.$formname.srchdomain.value=domain; |
document.$formname.phase.value='get_user_info'; |
document.$formname.phase.value='get_user_info'; |
document.$formname.action.value = 'singleuser'; |
document.$formname.action.value = nextaction; |
document.$formname.submit(); |
document.$formname.submit(); |
} |
} |
} |
} |
Line 2629 END
|
Line 2633 END
|
'owin' => "Open in a new window", |
'owin' => "Open in a new window", |
'modify' => "Modify a user's information", |
'modify' => "Modify a user's information", |
'track' => "View a user's recent activity", |
'track' => "View a user's recent activity", |
|
'activity' => "View a user's access log", |
); |
); |
my %lt = (%coltxt,%acttxt); |
my %lt = (%coltxt,%acttxt); |
my $rolefilter = $env{'form.showrole'}; |
my $rolefilter = $env{'form.showrole'}; |
Line 2719 END
|
Line 2724 END
|
if ($permission->{'cusr'}) { |
if ($permission->{'cusr'}) { |
unshift (@linkdests,'modify'); |
unshift (@linkdests,'modify'); |
} |
} |
if (&Apache::lonnet::allowed('vsa', $env{'request.course.id'}) || |
if ($context eq 'course') { |
&Apache::lonnet::allowed('vsa', $env{'request.course.id'}.'/'. |
if (&Apache::lonnet::allowed('vsa', $env{'request.course.id'}) || |
$env{'request.course.sec'})) { |
&Apache::lonnet::allowed('vsa', $env{'request.course.id'}.'/'. |
push(@linkdests,'track'); |
$env{'request.course.sec'})) { |
|
push(@linkdests,'track'); |
|
} |
|
} elsif ($context eq 'domain') { |
|
if (&Apache::lonnet::allowed('vac',$env{'request.role.domain'})) { |
|
push(@linkdests,'activity'); |
|
} |
} |
} |
|
|
$output .= '<td>'; |
$output .= '<td>'; |
my $usernamelink = $env{'form.usernamelink'}; |
my $usernamelink = $env{'form.usernamelink'}; |
if ($usernamelink eq '') { |
if ($usernamelink eq '') { |
Line 5881 sub get_permission {
|
Line 5891 sub get_permission {
|
} |
} |
} |
} |
} |
} |
|
if ($env{'request.course.id'}) { |
|
my $user = $env{'user.name'}.':'.$env{'user.domain'}; |
|
if (($user ne '') && ($env{'course.'.$env{'request.course.id'}.'.internal.courseowner'} eq |
|
$user)) { |
|
$permission{'owner'} = 1; |
|
} elsif (($user ne '') && ($env{'course.'.$env{'request.course.id'}.'.internal.co-owners'} ne '')) { |
|
if (grep(/^\Q$user\E$/,split(/,/,$env{'course.'.$env{'request.course.id'}.'.internal.co-owners'}))) { |
|
$permission{'co-owner'} = 1; |
|
} |
|
} |
|
} |
} elsif ($context eq 'author') { |
} elsif ($context eq 'author') { |
$permission{'cusr'} = &authorpriv($env{'user.name'},$env{'request.role.domain'}); |
$permission{'cusr'} = &authorpriv($env{'user.name'},$env{'request.role.domain'}); |
$permission{'view'} = $permission{'cusr'}; |
$permission{'view'} = $permission{'cusr'}; |
Line 5906 sub get_permission {
|
Line 5927 sub get_permission {
|
if (&Apache::lonnet::allowed('vur',$env{'request.role.domain'})) { |
if (&Apache::lonnet::allowed('vur',$env{'request.role.domain'})) { |
$permission{'view'} = 1; |
$permission{'view'} = 1; |
} |
} |
|
if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) { |
|
$permission{'owner'} = 1; |
|
} |
} |
} |
my $allowed = 0; |
my $allowed = 0; |
foreach my $perm (values(%permission)) { |
foreach my $perm (values(%permission)) { |
Line 6401 END
|
Line 6425 END
|
} |
} |
|
|
sub custom_role_table { |
sub custom_role_table { |
my ($crstype,$full,$levels,$levelscurrent,$prefix) = @_; |
my ($crstype,$full,$levels,$levelscurrent,$prefix,$add_class,$id) = @_; |
return unless ((ref($full) eq 'HASH') && (ref($levels) eq 'HASH') && |
return unless ((ref($full) eq 'HASH') && (ref($levels) eq 'HASH') && |
(ref($levelscurrent) eq 'HASH')); |
(ref($levelscurrent) eq 'HASH')); |
my %lt=&Apache::lonlocal::texthash ( |
my %lt=&Apache::lonlocal::texthash ( |
Line 6415 sub custom_role_table {
|
Line 6439 sub custom_role_table {
|
system => '_s', |
system => '_s', |
); |
); |
|
|
my $output=&Apache::loncommon::start_data_table(). |
my $output=&Apache::loncommon::start_data_table($add_class,$id). |
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table_header_row(). |
'<th>'.$lt{'prv'}.'</th><th>'.$lt{'crl'}.'</th><th>'.$lt{'dml'}. |
'<th>'.$lt{'prv'}.'</th><th>'.$lt{'crl'}.'</th><th>'.$lt{'dml'}. |
'</th><th>'.$lt{'ssl'}.'</th>'. |
'</th><th>'.$lt{'ssl'}.'</th>'. |
Line 6672 sub custom_role_update {
|
Line 6696 sub custom_role_update {
|
return %privs; |
return %privs; |
} |
} |
|
|
|
sub adhoc_status_types { |
|
my ($cdom,$context,$role,$selectedref,$othertitle,$usertypes,$types,$disabled) = @_; |
|
my $output = &Apache::loncommon::start_data_table(); |
|
my $numinrow = 3; |
|
my $rem; |
|
if (ref($types) eq 'ARRAY') { |
|
for (my $i=0; $i<@{$types}; $i++) { |
|
if (defined($usertypes->{$types->[$i]})) { |
|
my $rem = $i%($numinrow); |
|
if ($rem == 0) { |
|
if ($i > 0) { |
|
$output .= &Apache::loncommon::end_data_table_row(); |
|
} |
|
$output .= &Apache::loncommon::start_data_table_row(); |
|
} |
|
my $check; |
|
if (ref($selectedref) eq 'ARRAY') { |
|
if (grep(/^\Q$types->[$i]\E$/,@{$selectedref})) { |
|
$check = ' checked="checked"'; |
|
} |
|
} |
|
$output .= '<td>'. |
|
'<span class="LC_nobreak"><label>'. |
|
'<input type="checkbox" name="'.$context.$role.'_status" '. |
|
'value="'.$types->[$i].'"'.$check.$disabled.' />'. |
|
$usertypes->{$types->[$i]}.'</label></span></td>'; |
|
} |
|
} |
|
$rem = @{$types}%($numinrow); |
|
} |
|
my $colsleft = $numinrow - $rem; |
|
if (($rem == 0) && (@{$types} > 0)) { |
|
$output .= &Apache::loncommon::start_data_table_row(); |
|
} |
|
if ($colsleft > 1) { |
|
$output .= '<td colspan="'.$colsleft.'">'; |
|
} else { |
|
$output .= '<td>'; |
|
} |
|
my $defcheck; |
|
if (ref($selectedref) eq 'ARRAY') { |
|
if (grep(/^default$/,@{$selectedref})) { |
|
$defcheck = ' checked="checked"'; |
|
} |
|
} |
|
$output .= '<span class="LC_nobreak"><label>'. |
|
'<input type="checkbox" name="'.$context.$role.'_status"'. |
|
'value="default"'.$defcheck.$disabled.' />'. |
|
$othertitle.'</label></span></td>'. |
|
&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::end_data_table(); |
|
return $output; |
|
} |
|
|
|
sub adhoc_staff { |
|
my ($access,$context,$role,$selectedref,$adhocref,$disabled) = @_; |
|
my $output; |
|
if (ref($adhocref) eq 'HASH') { |
|
my %by_fullname; |
|
my $numinrow = 4; |
|
my $rem; |
|
my @personnel = keys(%{$adhocref}); |
|
if (@personnel) { |
|
foreach my $person (@personnel) { |
|
my ($uname,$udom) = split(/:/,$person); |
|
my $fullname = &Apache::loncommon::plainname($uname,$udom,'lastname'); |
|
$by_fullname{$fullname} = $person; |
|
} |
|
my @sorted = sort(keys(%by_fullname)); |
|
my $count = scalar(@sorted); |
|
$output = &Apache::loncommon::start_data_table(); |
|
for (my $i=0; $i<$count; $i++) { |
|
my $rem = $i%($numinrow); |
|
if ($rem == 0) { |
|
if ($i > 0) { |
|
$output .= &Apache::loncommon::end_data_table_row(); |
|
} |
|
$output .= &Apache::loncommon::start_data_table_row(); |
|
} |
|
my $check; |
|
my $user = $by_fullname{$sorted[$i]}; |
|
if (ref($selectedref) eq 'ARRAY') { |
|
if (grep(/^\Q$user\E$/,@{$selectedref})) { |
|
$check = ' checked="checked"'; |
|
} |
|
} |
|
if ($i == $count-1) { |
|
my $colsleft = $numinrow - $rem; |
|
if ($colsleft > 1) { |
|
$output .= '<td colspan="'.$colsleft.'">'; |
|
} else { |
|
$output .= '<td>'; |
|
} |
|
} else { |
|
$output .= '<td>'; |
|
} |
|
$output .= '<span class="LC_nobreak"><label>'. |
|
'<input type="checkbox" name="'.$context.$role.'_staff_'.$access.'" '. |
|
'value="'.$user.'"'.$check.$disabled.' />'.$sorted[$i]. |
|
'</label></span></td>'; |
|
if ($i == $count-1) { |
|
$output .= &Apache::loncommon::end_data_table_row(); |
|
} |
|
} |
|
$output .= &Apache::loncommon::end_data_table(); |
|
} |
|
} |
|
return $output; |
|
} |
|
|
|
|
1; |
1; |
|
|