[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface loncommon.pm
raeburn
raeburn at source.lon-capa.org
Thu May 22 08:26:50 EDT 2014
raeburn Thu May 22 12:26:50 2014 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface loncommon.pm
Log:
- For 2.11
- Backport 1.1190, 1.1191.
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1075.2.73 loncom/interface/loncommon.pm:1.1075.2.74
--- loncom/interface/loncommon.pm:1.1075.2.73 Fri May 16 18:36:05 2014
+++ loncom/interface/loncommon.pm Thu May 22 12:26:49 2014
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1075.2.73 2014/05/16 18:36:05 raeburn Exp $
+# $Id: loncommon.pm,v 1.1075.2.74 2014/05/22 12:26:49 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -15630,6 +15630,26 @@
return $outgoing;
}
+# Checks for critical messages and returns a redirect url if one exists.
+# $interval indicates how often to check for messages.
+sub critical_redirect {
+ my ($interval) = @_;
+ if ((time-$env{'user.criticalcheck.time'})>$interval) {
+ my @what=&Apache::lonnet::dump('critical', $env{'user.domain'},
+ $env{'user.name'});
+ &Apache::lonnet::appenv({'user.criticalcheck.time'=>time});
+ my $redirecturl;
+ if ($what[0]) {
+ if (($what[0] ne 'con_lost') && ($what[0]!~/^error\:/)) {
+ $redirecturl='/adm/email?critical=display';
+ my $url=&Apache::lonnet::absolute_url().$redirecturl;
+ return (1, $url);
+ }
+ }
+ }
+ return ();
+}
+
# Use:
# my $answer=reply("encrypt:passwd:$udom:$uname:$upass",$tryserver);
#
More information about the LON-CAPA-cvs
mailing list