--- loncom/interface/lonuserutils.pm 2016/10/14 23:26:21 1.177
+++ loncom/interface/lonuserutils.pm 2017/01/02 19:44:07 1.180
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Utility functions for managing LON-CAPA user accounts
#
-# $Id: lonuserutils.pm,v 1.177 2016/10/14 23:26:21 raeburn Exp $
+# $Id: lonuserutils.pm,v 1.180 2017/01/02 19:44:07 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2572,9 +2572,13 @@ 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) {
- 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';
modifywin = window.open(url,'',options,1);
modifywin.focus();
@@ -2583,7 +2587,7 @@ function username_display_launch(usernam
document.$formname.srchterm.value=username;
document.$formname.srchdomain.value=domain;
document.$formname.phase.value='get_user_info';
- document.$formname.action.value = 'singleuser';
+ document.$formname.action.value = nextaction;
document.$formname.submit();
}
}
@@ -2629,6 +2633,7 @@ END
'owin' => "Open in a new window",
'modify' => "Modify a user's information",
'track' => "View a user's recent activity",
+ 'activity' => "View a user's access log",
);
my %lt = (%coltxt,%acttxt);
my $rolefilter = $env{'form.showrole'};
@@ -2719,12 +2724,17 @@ END
if ($permission->{'cusr'}) {
unshift (@linkdests,'modify');
}
- if (&Apache::lonnet::allowed('vsa', $env{'request.course.id'}) ||
- &Apache::lonnet::allowed('vsa', $env{'request.course.id'}.'/'.
- $env{'request.course.sec'})) {
- push(@linkdests,'track');
+ if ($context eq 'course') {
+ if (&Apache::lonnet::allowed('vsa', $env{'request.course.id'}) ||
+ &Apache::lonnet::allowed('vsa', $env{'request.course.id'}.'/'.
+ $env{'request.course.sec'})) {
+ push(@linkdests,'track');
+ }
+ } elsif ($context eq 'domain') {
+ if (&Apache::lonnet::allowed('vac',$env{'request.role.domain'})) {
+ push(@linkdests,'activity');
+ }
}
-
$output .= '
';
my $usernamelink = $env{'form.usernamelink'};
if ($usernamelink eq '') {
@@ -2993,6 +3003,12 @@ END
} (keys(%$userlist));
}
my $rowcount = 0;
+ my $disabled;
+ if ($mode eq 'autoenroll') {
+ unless ($permission->{'cusr'}) {
+ $disabled = ' disabled="disabled"';
+ }
+ }
foreach my $user (@sorted_users) {
my %in;
my $sdata = $userlist->{$user};
@@ -3029,16 +3045,16 @@ END
if ($mode eq 'autoenroll') {
my $cellentry;
if ($in{'type'} eq 'auto') {
- $cellentry = ''.&mt('auto').' ';
+ $cellentry = ''.&mt('auto').' ';
$autocount ++;
} else {
- $cellentry = ''.&mt('manual').' | | ';
+ $cellentry = '';
@@ -5416,13 +5432,13 @@ sub set_login {
}
sub course_sections {
- my ($sections_count,$role,$current_sec) = @_;
+ my ($sections_count,$role,$current_sec,$disabled) = @_;
my $output = '';
my @sections = (sort {$a <=> $b} keys(%{$sections_count}));
my $numsec = scalar(@sections);
my $is_selected = ' selected="selected"';
if ($numsec <= 1) {
- $output = ' |
|