Diff for /loncom/auth/lonroles.pm between versions 1.256 and 1.256.2.1

version 1.256, 2010/08/01 18:34:19 version 1.256.2.1, 2010/08/12 23:40:49
Line 57  course they should act on, etc. Both in Line 57  course they should act on, etc. Both in
 handler determines via C<lonnet>'s C<&allowed> function that a certain  handler determines via C<lonnet>'s C<&allowed> function that a certain
 action is not allowed, C<lonroles> is used as error handler. This  action is not allowed, C<lonroles> is used as error handler. This
 allows the user to select another role which may have permission to do  allows the user to select another role which may have permission to do
 what they were trying to do.  what they were trying to do. C<lonroles> can also be accessed via the
   B<CRS> button in the Remote Control. 
   
 =begin latex  =begin latex
   
Line 144  use HTML::Entities; Line 145  use HTML::Entities;
     
   
 sub redirect_user {  sub redirect_user {
     my ($r,$title,$url,$msg) = @_;      my ($r,$title,$url,$msg,$launch_nav) = @_;
     $msg = $title if (! defined($msg));      $msg = $title if (! defined($msg));
     &Apache::loncommon::content_type($r,'text/html');      &Apache::loncommon::content_type($r,'text/html');
     &Apache::loncommon::no_cache($r);      &Apache::loncommon::no_cache($r);
     $r->send_http_header;      $r->send_http_header;
       my $swinfo=&Apache::lonmenu::rawconfig();
       my $navwindow;
       if ($launch_nav eq 'on') {
           $navwindow.=&Apache::lonnavdisplay::launch_win('now',undef,undef,
                                                          ($url =~ m-^/adm/whatsnew-));
       } else {
           $navwindow.=&Apache::lonnavmaps::close();
       }
   
     # Breadcrumbs      # Breadcrumbs
     my $brcrum = [{'href' => $url,      my $brcrum = [{'href' => $url,
Line 163  sub redirect_user { Line 172  sub redirect_user {
     $url=~s/ /\%20/g;      $url=~s/ /\%20/g;
     $r->print(<<ENDREDIR);      $r->print(<<ENDREDIR);
 $start_page  $start_page
   <script type="text/javascript">
   // <![CDATA[
   $swinfo
   // ]]>
   </script>
   $navwindow
 <p>$msg</p>  <p>$msg</p>
 $end_page  $end_page
 ENDREDIR  ENDREDIR
Line 542  ENDENTERKEY Line 557  ENDENTERKEY
                                         }                                          }
                                         &redirect_user($r, &mt('Entering [_1]',                                          &redirect_user($r, &mt('Entering [_1]',
                                                        $env{'course.'.$courseid.'.description'}),                                                         $env{'course.'.$courseid.'.description'}),
                                                        $dest, $msg);                                                         $dest, $msg,
                                                          $env{'environment.remotenavmap'});
                                         return OK;                                          return OK;
                                     }                                      }
     if (&Apache::lonnet::allowed('whn',      if (&Apache::lonnet::allowed('whn',
Line 555  ENDENTERKEY Line 571  ENDENTERKEY
  unless ($startpage eq 'firstres') {            unless ($startpage eq 'firstres') {         
     $msg = &mt('Entering [_1] ...',      $msg = &mt('Entering [_1] ...',
        $env{'course.'.$courseid.'.description'});         $env{'course.'.$courseid.'.description'});
     &redirect_user($r, &mt('New in course'),                                              &redirect_user($r,&mt('New in course'),
                                        '/adm/whatsnew?refpage=start', $msg);                                                             '/adm/whatsnew?refpage=start',$msg,
                                                              $env{'environment.remotenavmap'});
     return OK;      return OK;
  }   }
     }      }
Line 568  ENDENTERKEY Line 585  ENDENTERKEY
  }   }
                                 $msg = &mt('Entering [_1] ...',                                  $msg = &mt('Entering [_1] ...',
    $env{'course.'.$courseid.'.description'});     $env{'course.'.$courseid.'.description'});
  &redirect_user($r, &mt('Entering [_1]',                                  &redirect_user($r,&mt('Entering [_1]',
                                $env{'course.'.$courseid.'.description'}),                                                        $env{'course.'.$courseid.'.description'}),
                                $furl, $msg);                                                 $furl,$msg,
                                                  $env{'environment.remotenavmap'});
     }      }
     return OK;      return OK;
  }   }
Line 1814  course they should act on, etc. Both in Line 1832  course they should act on, etc. Both in
 handler determines via C<lonnet>'s C<&allowed> function that a certain  handler determines via C<lonnet>'s C<&allowed> function that a certain
 action is not allowed, C<lonroles> is used as error handler. This  action is not allowed, C<lonroles> is used as error handler. This
 allows the user to select another role which may have permission to do  allows the user to select another role which may have permission to do
 what they were trying to do.  what they were trying to do. C<lonroles> can also be accessed via the
   B<CRS> button in the Remote Control.
   
 =begin latex  =begin latex
   

Removed from v.1.256  
changed lines
  Added in v.1.256.2.1


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>