--- loncom/auth/lonroles.pm 2005/04/07 06:56:21 1.118 +++ loncom/auth/lonroles.pm 2005/06/07 00:24:08 1.123 @@ -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.123 2005/06/07 00:24:08 www 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) = @_; @@ -232,9 +233,6 @@ ENDENTERKEY 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); @@ -264,9 +262,17 @@ ENDENTERKEY $furl = "/adm/helper/course.initialization.helper"; } # Send the user to the course they selected - &redirect_user($r,&mt('Entering Course'), + if (($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'}); + } else { + &redirect_user($r,&mt('Entering Course'), $furl,$msg, $env{'environment.remotenavmap'}); + } return OK; } } @@ -341,7 +347,18 @@ ENDHEADER $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
"); + my $url=$fn; + my $last; + if (tie(my %hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db', + &GDBM_READER(),0640)) { + $last=$hash{'last_known'}; + untie(%hash); + } + if ($last) { $fn.='?symb='.&Apache::lonnet::escape($last); } + + &Apache::londocs::changewarning($r,undef,'You have modified your course recently, [_1] may fix this access problem.', + &Apache::lonenc::check_encrypt($fn)); } else { if ($env{'user.error.msg'}) { $r->print( @@ -502,9 +519,6 @@ ENDHEADER $sortkey=$role; } elsif ($trest) { $ttype='Course'; - if ($tsection) { - $ttype.='
'.&mt('Section/Group').': '.$tsection; - } my $tcourseid=$tdom.'_'.$trest; if ($env{'course.'.$tcourseid.'.description'}) { $twhere=$env{'course.'.$tcourseid.'.description'}; @@ -529,6 +543,10 @@ ENDHEADER $sortkey=$role."\0".$tdom."\0".$twhere."\0".$envkey; } } + if ($tsection) { + $twhere.='
'.&mt('Section/Group').': '.$tsection; + } + if ($role ne 'st') { $twhere.="
".&mt('Domain').":".$tdom; } } elsif ($tdom) { $ttype='Domain'; @@ -574,7 +592,7 @@ ENDHEADER } $r->print('
'); unless ($nochoose) { $r->print(''); } - $r->print(''."\n"); my $doheaders=-1; @@ -602,7 +620,7 @@ ENDHEADER } } if ($output) { - $r->print(""); $r->print($output); $r->print(""); @@ -629,7 +647,7 @@ ENDHEADER if ($output) { if ($doheaders > 0) { $r->print("". - ""); + ""); } $r->print($output); } @@ -651,7 +669,7 @@ ENDHEADER $r->print(''); } } - $r->print(''."\n"); @@ -780,8 +798,7 @@ sub build_roletext { $roletext.=''. ''. + $ccrole.''. ''."\n"; return $output;
 '.&mt('User Role').''.&mt('Extent'). + $r->print(''.&mt('User Role').''.&mt('Extent'). ''.&mt('Start').''.&mt('End').''. &mt('Remarks and Calendar Announcements').'
". + $r->print("
". &mt('Recent Roles')."
".&mt($type)."
".&mt($type)."
 '.&mt('No role specified'). + $r->print(''.&mt('No role specified'). ''.$tremark. ' 
'.$trole. - ''.$ttype. - ''.$twhere. + ''.$twhere. ''.$tpstart. ''.$tpend. ''.$tremark. @@ -944,11 +961,11 @@ sub allcourses_row { 'onClick="verifyCoursePick(this)">'. ''. - $ccrole.''.&mt('Course').''.&mt('All courses').': '. $selectlink.''. '
'.&mt('Domain').':'.$dcdom.'
'. - '
'. + ''. &mt('Course Coordinator access to all courses in domain'). ': '.$dcdom.'