--- loncom/interface/loncreateuser.pm 2017/01/30 18:37:34 1.406.2.12 +++ loncom/interface/loncreateuser.pm 2017/03/26 23:33:46 1.406.2.13 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.406.2.12 2017/01/30 18:37:34 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.406.2.13 2017/03/26 23:33:46 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -749,6 +749,7 @@ sub print_username_entry_form { } } else { my $actiontext = $lt{'srad'}; + my $fixeddom; if ($env{'form.action'} eq 'singlestudent') { if ($crstype eq 'Community') { $actiontext = $lt{'srme'}; @@ -757,6 +758,7 @@ sub print_username_entry_form { } } elsif ($env{'form.action'} eq 'accesslogs') { $actiontext = $lt{'srva'}; + $fixeddom = 1; } elsif (($env{'form.action'} eq 'singleuser') && ($context eq 'domain') && (!&Apache::lonnet::allowed('mau',$defdom))) { $actiontext = $lt{'srvu'}; @@ -768,7 +770,7 @@ sub print_username_entry_form { '
'); } } - $r->print(&entry_form($defdom,$srch,$forcenewuser,$context,$response,$crstype,1)); + $r->print(&entry_form($defdom,$srch,$forcenewuser,$context,$response,$crstype,$fixeddom)); } } @@ -6753,6 +6755,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); @@ -6839,7 +6859,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 ''); @@ -6891,8 +6911,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(