--- loncom/interface/loncreateuser.pm 2017/03/26 22:11:54 1.436 +++ loncom/interface/loncreateuser.pm 2017/03/26 22:19:24 1.437 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.436 2017/03/26 22:11:54 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.437 2017/03/26 22:19:24 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -6767,6 +6767,24 @@ ENDSCRIPT return; } + if (&Apache::lonnet::privileged($uname,$udom, + [$env{'request.role.domain'}],['dc','su'])) { + unless (&Apache::lonnet::privileged($env{'user.name'},$env{'user.domain'}, + [$env{'request.role.domain'}],['dc','su'])) { + $r->print('

' + .&mt('You need to be a privileged user to display user access logs for [_1]', + &Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$udom), + $uname,$udom)) + .'

'); + if ($env{'form.popup'}) { + $r->print('

'.&mt('Close window').'

'); + } else { + $r->print(&earlyout_accesslog_form($formname,$prevphasestr,$udom)); + } + return; + } + } + # set defaults my $now = time(); my $defstart = $now - (7*24*3600); @@ -6853,7 +6871,7 @@ ENDSCRIPT $showntableheader = 1; } my ($shown,$extra); - my ($event,$data) = split(/\s+/,&unescape($event)); + my ($event,$data) = split(/\s+/,&unescape($event),2); if ($event eq 'Role') { my ($rolecode,$extent) = split(/\./,$data,2); next if ($extent eq ''); @@ -6905,8 +6923,17 @@ ENDSCRIPT $shown = &mt('Role selection: [_1]',$rolename); } else { $shown = &mt($event); - if ($data ne '') { - $extra = &mt('Client IP address: [_1]',$data); + if ($data =~ /^webdav/) { + my ($path,$clientip) = split(/\s+/,$data,2); + $path =~ s/^webdav//; + if ($clientip ne '') { + $extra = &mt('Client IP address: [_1]',$clientip); + } + if ($path ne '') { + $shown .= ' '.&mt('(WebDAV access to [_1])',$path); + } + } elsif ($data ne '') { + $extra = &mt('Client IP address: [_1]',$data); } } $r->print(