--- loncom/interface/lonuserutils.pm 2009/08/03 16:26:09 1.96 +++ loncom/interface/lonuserutils.pm 2009/09/12 17:10:44 1.97.2.3 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.96 2009/08/03 16:26:09 bisitz Exp $ +# $Id: lonuserutils.pm,v 1.97.2.3 2009/09/12 17:10:44 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -788,23 +788,21 @@ sub print_upload_manager_footer { &Apache::loncommon::help_open_topic('Auth_Options'). "

\n"; } - $Str .= &set_login($defdom,$krbform,$intform,$locform) - .&Apache::lonhtmlcommon::row_closure(); + $Str .= &set_login($defdom,$krbform,$intform,$locform); my ($home_server_pick,$numlib) = &Apache::loncommon::home_server_form_item($defdom,'lcserver', 'default','hide'); -#FIXME: Broken?!? $home_server_pick returns empty value on prod (2.8.1) and on dev server. SB 2009-08-03 if ($numlib > 1) { - $Str .= &Apache::lonhtmlcommon::row_title( + $Str .= &Apache::lonhtmlcommon::row_closure() + .&Apache::lonhtmlcommon::row_title( &mt('LON-CAPA Home Server for New Users')) .&mt('LON-CAPA domain: [_1] with home server:','"'.$defdom.'"') .$home_server_pick .&Apache::lonhtmlcommon::row_closure(); } else { - $Str .= &Apache::lonhtmlcommon::row_title(&mt('Home Server')) - .$home_server_pick - .&Apache::lonhtmlcommon::row_closure(); + $Str .= $home_server_pick. + &Apache::lonhtmlcommon::row_closure(); } $Str .= &Apache::lonhtmlcommon::row_title(&mt('Default domain')) @@ -2124,6 +2122,17 @@ function username_display_launch(usernam document.location.href = '/adm/'+domain+'/'+username+'/aboutme'; } } + if (target == 'track') { + if (document.$formname.userwin.checked == true) { + var url = '/adm/trackstudent?selected_student='+username+':'+domain+'&only_body=1'; + var options = 'height=600,width=800,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no'; + var trackwin = window.open(url,'',options,1); + trackwin.focus(); + return; + } else { + document.location.href = '/adm/trackstudent?selected_student='+username+':'+domain; + } + } } // ]]> @@ -2158,6 +2167,7 @@ END 'aboutme' => "Display a user's personal information page", 'owin' => "Open in a new window", 'modify' => "Modify a user's information", + 'track' => "View a user's recent activity", 'clicker' => "Clicker-ID", ); if ($context eq 'domain' && $env{'form.roletype'} eq 'course') { @@ -2220,7 +2230,7 @@ END END if ($actionselect) { $output .= <<"END"; -
$lt{'ac'} +
$lt{'ac'} $actionselect

 
@@ -2265,12 +2275,17 @@ END } } } - $output .= '
'.$lt{'link'}.''. + $output .= '
'.$lt{'link'}.''. ''; my @linkdests = ('aboutme'); 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'); + } $output .= '
'; my $usernamelink = $env{'form.usernamelink'}; if ($usernamelink eq '') { @@ -4729,7 +4744,7 @@ sub can_create_user { } if (ref($domconf{'usercreation'}) eq 'HASH') { if (ref($domconf{'usercreation'}{'cancreate'}) eq 'HASH') { - if ($context eq 'course' || $context eq 'author') { + if ($context eq 'course' || $context eq 'author' || $context eq 'requestcrs') { my $creation = $domconf{'usercreation'}{'cancreate'}{$context}; if ($creation eq 'none') { $cancreate = 0; @@ -4830,14 +4845,18 @@ sub roles_by_context { my ($context,$custom) = @_; my @allroles; if ($context eq 'course') { - @allroles = ('st','ad','ta','ep','in','cc'); + @allroles = ('st'); + if ($env{'request.role'} =~ m{^dc\./}) { + push(@allroles,'ad'); + } + push(@allroles,('ta','ep','in','cc')); if ($custom) { push(@allroles,'cr'); } } elsif ($context eq 'author') { @allroles = ('ca','aa'); } elsif ($context eq 'domain') { - @allroles = ('li','dg','sc','au','dc'); + @allroles = ('li','ad','dg','sc','au','dc'); } return @allroles; }