[LON-CAPA-cvs] cvs: loncom /auth lonlogout.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Sat, 18 Aug 2007 00:34:28 -0000


albertel		Fri Aug 17 20:34:28 2007 EDT

  Modified files:              
    /loncom/auth	lonlogout.pm 
  Log:
  - add ability to completely switch off stadard logout messages
  - add ability to have per domain Logout Message files
  
  
Index: loncom/auth/lonlogout.pm
diff -u loncom/auth/lonlogout.pm:1.25 loncom/auth/lonlogout.pm:1.26
--- loncom/auth/lonlogout.pm:1.25	Thu Mar  1 18:14:12 2007
+++ loncom/auth/lonlogout.pm	Fri Aug 17 20:34:27 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Logout Handler
 #
-# $Id: lonlogout.pm,v 1.25 2007/03/01 23:14:12 albertel Exp $
+# $Id: lonlogout.pm,v 1.26 2007/08/18 00:34:27 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -99,21 +99,33 @@
 					   'li' => 'log in again',
 					   'pe' => 'Please either',
 					   'or' => 'or');
-        my $relogin_server;
-        if ($env{'request.sso.reloginserver'}) {
-            $relogin_server = $env{'request.sso.reloginserver'};
-        }
-	my $login_url = $relogin_server.'/adm/'.
-                        ($env{'request.sso.login'} ? 'roles': 'login');
- 
-	$relogmessage=(<<ENDRELOG);
+	
+	$relogmessage.=(<<ENDRELOG);
 	<h1>$lt{'gb'}!</h1>
+ENDRELOG
+
+	if (!$env{'request.sso.norelogin'}) {
+	    my $relogin_server;
+	    if ($env{'request.sso.reloginserver'}) {
+		$relogin_server = $env{'request.sso.reloginserver'};
+	    }
+	    my $login_url = $relogin_server.'/adm/'.
+		($env{'request.sso.login'} ? 'roles': 'login');
+
+	    $relogmessage.=(<<ENDRELOG);
 	    $lt{'pe'} <a href="javascript:self.close();">$lt{'cw'}</a> $lt{'or'}
 	<a href="$login_url?domain=$env{'user.domain'}">$lt{'li'}</a>.
 ENDRELOG
 
+        }
+	my $domain = $env{'user.domain'};
         if ($env{'request.sso.login'}
-	    && defined($r->dir_config('lonSSOUserLogoutMessageFile'))) {
+	    && defined($r->dir_config("lonSSOUserLogoutMessageFile_$domain"))) {
+	    open(my $fh,$r->dir_config("lonSSOUserLogoutMessageFile_$domain"));
+	    $relogmessage.= join('',<$fh>);
+	}
+	if ($env{'request.sso.login'}
+	    || defined($r->dir_config('lonSSOUserLogoutMessageFile'))) {
 	    open(my $fh,$r->dir_config('lonSSOUserLogoutMessageFile'));
 	    $relogmessage.= join('',<$fh>);
 	}