[LON-CAPA-cvs] cvs: loncom /auth lonacc.pm lonlogout.pm migrateuser.pm switchserver.pm
raeburn
lon-capa-cvs@mail.lon-capa.org
Fri, 12 Jan 2007 15:44:28 -0000
raeburn Fri Jan 12 10:44:28 2007 EDT
Modified files:
/loncom/auth lonacc.pm migrateuser.pm switchserver.pm lonlogout.pm
Log:
Look for lonSSOReloginServer set in an apache conf file (e.g., sentinel.conf at MSU), so the "login again" link displayed on logout points to a SSO-enabled server if the user's login was originally SSO-authenticated.
Index: loncom/auth/lonacc.pm
diff -u loncom/auth/lonacc.pm:1.105 loncom/auth/lonacc.pm:1.106
--- loncom/auth/lonacc.pm:1.105 Fri Jan 12 10:06:18 2007
+++ loncom/auth/lonacc.pm Fri Jan 12 10:44:27 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Cookie Based Access Handler
#
-# $Id: lonacc.pm,v 1.105 2007/01/12 15:06:18 raeburn Exp $
+# $Id: lonacc.pm,v 1.106 2007/01/12 15:44:27 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -165,6 +165,10 @@
# machine
&Apache::lonauth::success($r,$user,$domain,$home,'noredirect');
$env{'request.sso.login'} = 1;
+ if (defined($r->dir_config("lonSSOReloginServer"))) {
+ $env{'request.sso.reloginserver'} =
+ $r->dir_config('lonSSOReloginServer');
+ }
$r->internal_redirect('/adm/switchserver');
$r->set_handlers('PerlHandler'=> undef);
} else {
@@ -176,6 +180,10 @@
'server' => $r->dir_config('lonHostID'),
'sso.login' => 1
);
+ if (defined($r->dir_config("lonSSOReloginServer"))) {
+ $info{'sso.reloginserver'} =
+ $r->dir_config('lonSSOReloginServer');
+ }
my $token =
&Apache::lonnet::tmpput(\%info,
$r->dir_config('lonHostID'));
Index: loncom/auth/migrateuser.pm
diff -u loncom/auth/migrateuser.pm:1.9 loncom/auth/migrateuser.pm:1.10
--- loncom/auth/migrateuser.pm:1.9 Wed Jul 5 14:37:41 2006
+++ loncom/auth/migrateuser.pm Fri Jan 12 10:44:27 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Starts a user off based of an existing token.
#
-# $Id: migrateuser.pm,v 1.9 2006/07/05 18:37:41 albertel Exp $
+# $Id: migrateuser.pm,v 1.10 2007/01/12 15:44:27 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -55,6 +55,10 @@
if ($data->{'sso.login'}) {
$extra_env{'request.sso.login'} = $data->{'sso.login'};
}
+ if ($data->{'sso.reloginserver'}) {
+ $extra_env{'request.sso.reloginserver'} =
+ $data->{'sso.reloginserver'};
+ }
return \%extra_env;
}
Index: loncom/auth/switchserver.pm
diff -u loncom/auth/switchserver.pm:1.10 loncom/auth/switchserver.pm:1.11
--- loncom/auth/switchserver.pm:1.10 Wed Nov 22 20:49:41 2006
+++ loncom/auth/switchserver.pm Fri Jan 12 10:44:27 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Switch Servers Handler
#
-# $Id: switchserver.pm,v 1.10 2006/11/23 01:49:41 albertel Exp $
+# $Id: switchserver.pm,v 1.11 2007/01/12 15:44:27 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -105,6 +105,9 @@
if ($env{'request.sso.login'}) {
$info{'sso.login'} = $env{'request.sso.login'};
}
+ if ($env{'request.sso.reloginserver'}) {
+ $info{'sso.reloginserver'} = $env{'request.sso.reloginserver'};
+ }
my $token = &Apache::lonnet::tmpput(\%info,$env{'form.otherserver'});
my $switch='<meta HTTP-EQUIV="Refresh" CONTENT="0.5; url=http://'.$switch_to.'/adm/login?domain='.$env{'user.domain'}.'&username='.$env{'user.name'}.'&token='.$token.'">';
my $start_page = &Apache::loncommon::start_page('Switching Server ...',
Index: loncom/auth/lonlogout.pm
diff -u loncom/auth/lonlogout.pm:1.22 loncom/auth/lonlogout.pm:1.23
--- loncom/auth/lonlogout.pm:1.22 Wed Nov 22 20:49:41 2006
+++ loncom/auth/lonlogout.pm Fri Jan 12 10:44:27 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Logout Handler
#
-# $Id: lonlogout.pm,v 1.22 2006/11/23 01:49:41 albertel Exp $
+# $Id: lonlogout.pm,v 1.23 2007/01/12 15:44:27 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -91,9 +91,13 @@
'li' => 'log in again',
'pe' => 'Please either',
'or' => 'or');
- my $login_url = '/adm/'.($env{'request.sso.login'} ? 'roles'
- : 'login');
-
+ my $relogin_server;
+ if ($env{'request.sso.reloginserver'}) {
+ $relogin_server = 'http://'.$env{'request.sso.reloginserver'};
+ }
+ my $login_url = $relogin_server.'/adm/'.
+ ($env{'request.sso.login'} ? 'roles': 'login');
+
$relogmessage=(<<ENDRELOG);
<h1>$lt{'gb'}!</h1>
$lt{'pe'} <a href="javascript:self.close();">$lt{'cw'}</a> $lt{'or'}