[LON-CAPA-cvs] cvs: rat / lonpageflip.pm
musolffc
musolffc at source.lon-capa.org
Tue May 20 16:40:46 EDT 2014
musolffc Tue May 20 20:40:46 2014 EDT
Modified files:
/rat lonpageflip.pm
Log:
Calls critical_redirect() to check for critical messages
Index: rat/lonpageflip.pm
diff -u rat/lonpageflip.pm:1.84 rat/lonpageflip.pm:1.85
--- rat/lonpageflip.pm:1.84 Mon Apr 28 20:04:55 2014
+++ rat/lonpageflip.pm Tue May 20 20:40:46 2014
@@ -2,7 +2,7 @@
#
# Page flip handler
#
-# $Id: lonpageflip.pm,v 1.84 2014/04/28 20:04:55 raeburn Exp $
+# $Id: lonpageflip.pm,v 1.85 2014/05/20 20:40:46 musolffc Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -405,24 +405,13 @@
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});
- }
-
+# ------------------------------------- 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});
$r->header_out(Location => $url);
return REDIRECT;
} else {
More information about the LON-CAPA-cvs
mailing list