--- rat/lonpageflip.pm 2014/04/28 20:23:35 1.80.8.4 +++ rat/lonpageflip.pm 2014/06/26 18:21:24 1.80.8.5 @@ -2,7 +2,7 @@ # # Page flip handler # -# $Id: lonpageflip.pm,v 1.80.8.4 2014/04/28 20:23:35 raeburn Exp $ +# $Id: lonpageflip.pm,v 1.80.8.5 2014/06/26 18:21:24 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -436,29 +436,13 @@ sub handler { if ($direction eq 'back') { &Apache::lonnet::linklog($redirecturl,$currenturl); } -# ------------------------------------------------- Check for critical messages - if ((time-$env{'user.criticalcheck.time'})>300) { - my @what=&Apache::lonnet::dump - ('critical',$env{'user.domain'}, - $env{'user.name'}); - if ($what[0]) { - if (($what[0] ne 'con_lost') && - ($what[0]!~/^error\:/)) { - $redirecturl='/adm/email?critical=display'; - $redirectsymb=''; - } - } - &Apache::lonnet::appenv({'user.criticalcheck.time'=>time}); - } - - if (($redirecturl =~ m{^/adm/navmaps}) && - ($env{'environment.remotenavmap'} eq 'on')) { - &navlaunch($r); - return OK; +# ------------------------------------- Check for and display critical messages + my ($redirect, $url) = &Apache::loncommon::critical_redirect(300); + unless ($redirect) { + $url=&Apache::lonnet::absolute_url().$redirecturl; + $url = &add_get_param($url, { 'symb' => $redirectsymb}); } - &Apache::loncommon::content_type($r,'text/html'); - my $url=&Apache::lonnet::absolute_url().$redirecturl; - $url = &add_get_param($url, { 'symb' => $redirectsymb}); + &Apache::loncommon::content_type($r,'text/html'); $r->header_out(Location => $url); return REDIRECT; } else {