--- loncom/auth/lonroles.pm 2005/04/07 06:56:21 1.118 +++ loncom/auth/lonroles.pm 2005/09/16 19:47:42 1.129 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.118 2005/04/07 06:56:21 albertel Exp $ +# $Id: lonroles.pm,v 1.129 2005/09/16 19:47:42 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -39,6 +39,7 @@ use Apache::loncommon; use Apache::lonhtmlcommon; use Apache::lonannounce; use Apache::lonlocal; +use GDBM_File; sub redirect_user { my ($r,$title,$url,$msg,$launch_nav) = @_; @@ -49,7 +50,8 @@ sub redirect_user { my $swinfo=&Apache::lonmenu::rawconfig(); my $navwindow; if ($launch_nav eq 'on') { - $navwindow.=&Apache::lonnavmaps::launch_win('now'); + $navwindow.=&Apache::lonnavmaps::launch_win('now',undef,undef, + ($url eq '/adm/whatsnew')); } else { $navwindow.=&Apache::lonnavmaps::close(); } @@ -226,15 +228,12 @@ ENDENTERKEY my $tadv=0; my $msg=&mt('Entering course ...'); - if (($cnum) && ($role ne 'ca')) { + if (($cnum) && ($role ne 'ca') && ($role ne 'aa')) { my ($furl,$ferr)= &Apache::lonuserstate::readmap($cdom.'/'.$cnum); if (($env{'form.orgurl'}) && ($env{'form.orgurl'}!~/^\/adm\/flip/)) { my $dest=$env{'form.orgurl'}; - if ( &Apache::lonnet::mod_perl_version() == 2 ) { - &Apache::lonnet::cleanenv(); - } if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; } &Apache::lonnet::appenv('request.role.adv'=>$tadv); $r->internal_redirect($dest); @@ -262,17 +261,24 @@ ENDENTERKEY if ($role eq 'cc' && $env{'course.' . $courseid . '.course.helper.not.run'}) { $furl = "/adm/helper/course.initialization.helper"; + # Send the user to the course they selected + } elsif (($env{'request.course.fn'}) + && ($role eq 'cc' && ($env{'environment.course_init_display'} ne 'firstres'))) { + $msg = &mt('Entering course ....'); + &redirect_user($r,&mt('New in course'), + '/adm/whatsnew',$msg, + $env{'environment.remotenavmap'}); + return OK; } - # Send the user to the course they selected - &redirect_user($r,&mt('Entering Course'), + &redirect_user($r,&mt('Entering Course'), $furl,$msg, $env{'environment.remotenavmap'}); - return OK; + return OK; } } # # Send the user to the construction space they selected - if ($role =~ /^(au|ca)$/) { + if ($role =~ /^(au|ca|aa)$/) { my $redirect_url = '/priv/'; if ($role eq 'au') { $redirect_url.=$env{'user.name'}; @@ -338,10 +344,21 @@ ENDHEADER # --------------------------------------------------------------- Error Header? if ($error) { $r->print("
Access : ". + $r->print("Access : ". Apache::lonnet::plaintext($priv)."\n"); $r->print("Resource: ".&Apache::lonenc::check_encrypt($fn)."\n"); - $r->print("Action : $msg\n
"); + $r->print("Action : $msg\n
'); } - $r->print(' | '.&mt('User Role').' | '.&mt('Extent'). + $r->print(' | '.&mt('User Role').' | '.&mt('Extent'). ' | '.&mt('Start').' | '.&mt('End').' | '. &mt('Remarks and Calendar Announcements').' | |||
---|---|---|---|---|---|---|---|---|---|---|
". - &mt('Recent Roles')." | "); + $r->print("||||||||||
". + &mt('Recent Roles')." | "); $r->print($output); $r->print("||||||||||
".&mt($type)." | ||||||||||
".&mt($type)." | '); } } - $r->print(' | '.&mt('No role specified'). + $r->print(' | '.&mt('No role specified'). ' | '.$tremark. ' | '."\n"); @@ -661,7 +679,7 @@ ENDHEADER } # ------------------------------------------------------------ Privileges Info if (($advanced) && (($env{'user.error.msg'}) || ($error))) { - $r->print(''.$trole. - ' | '.$ttype. - ' | '.$twhere. + ' | '.$twhere. ' | '.$tpstart. ' | '.$tpend. ' | '.$tremark.
@@ -938,17 +955,17 @@ sub allcourses_row {
my $dcdom = shift;
my $ccrole = Apache::lonnet::plaintext('cc');
my $selectlink = &courselink($dcdom);
- my $output = ''.
' | '.
''.
- $ccrole.' | '.&mt('Course').' | '.
+ $ccrole.''.
''.&mt('All courses').': '.
$selectlink.''.
' | '.&mt('Domain').':'.$dcdom.''. - ' '.
+ ' | '.
&mt('Course Coordinator access to all courses in domain').
': '.$dcdom.' | |