[LON-CAPA-cvs] cvs: loncom /interface loncreateuser.pm lonuserutils.pm
raeburn
raeburn at source.lon-capa.org
Sun Nov 13 16:09:57 EST 2016
raeburn Sun Nov 13 21:09:57 2016 EDT
Modified files:
/loncom/interface lonuserutils.pm loncreateuser.pm
Log:
- When listing users in domain context, actions available when clicking user's
username link can include display of access log information.
Index: loncom/interface/lonuserutils.pm
diff -u loncom/interface/lonuserutils.pm:1.178 loncom/interface/lonuserutils.pm:1.179
--- loncom/interface/lonuserutils.pm:1.178 Wed Nov 9 00:32:45 2016
+++ loncom/interface/lonuserutils.pm Sun Nov 13 21:09:56 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Utility functions for managing LON-CAPA user accounts
#
-# $Id: lonuserutils.pm,v 1.178 2016/11/09 00:32:45 raeburn Exp $
+# $Id: lonuserutils.pm,v 1.179 2016/11/13 21:09:56 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2572,9 +2572,13 @@
}
}
}
- 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 @@
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 @@
'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 @@
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 .= '<td>';
my $usernamelink = $env{'form.usernamelink'};
if ($usernamelink eq '') {
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.422 loncom/interface/loncreateuser.pm:1.423
--- loncom/interface/loncreateuser.pm:1.422 Sat Nov 12 00:39:39 2016
+++ loncom/interface/loncreateuser.pm Sun Nov 13 21:09:56 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.422 2016/11/12 00:39:39 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.423 2016/11/13 21:09:56 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -6861,6 +6861,9 @@
my $bread_crumbs_component = 'User Access Logs';
my $args = { bread_crumbs => $brcrum,
bread_crumbs_component => 'User Management'};
+ if ($env{'form.popup'}) {
+ $args->{'no_nav_bar'} = 1;
+ }
# set javascript
my ($jsback,$elements) = &crumb_utilities();
@@ -7066,6 +7069,10 @@
.'</p>');
}
+ if ($env{'form.popup'} == 1) {
+ $r->print('<input type="hidden" name="popup" value="1" />'."\n");
+ }
+
# Form Footer
$r->print(
'<input type="hidden" name="currstate" value="" />'
More information about the LON-CAPA-cvs
mailing list