--- loncom/auth/lonauth.pm 2010/09/23 23:47:33 1.110
+++ loncom/auth/lonauth.pm 2011/06/10 01:21:36 1.113
@@ -1,7 +1,7 @@
# The LearningOnline Network
# User Authentication Module
#
-# $Id: lonauth.pm,v 1.110 2010/09/23 23:47:33 raeburn Exp $
+# $Id: lonauth.pm,v 1.113 2011/06/10 01:21:36 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -82,9 +82,13 @@ sub success {
my $now=time;
my $then=$env{'user.login.time'};
my $refresh=$env{'user.refresh.time'};
+ my $update=$env{'user.update.time'};
+ if (!$update) {
+ $update = $then;
+ }
if (exists($env{$envkey})) {
my ($role,$where,$trolecode,$tstart,$tend,$tremark,$tstatus);
- &Apache::lonnet::role_status($envkey,$then,$refresh,$now,\$role,\$where,
+ &Apache::lonnet::role_status($envkey,$update,$refresh,$now,\$role,\$where,
\$trolecode,\$tstatus,\$tstart,\$tend);
if ($tstatus eq 'is') {
$destination .= ($destination =~ /\?/) ? '&' : '?';
@@ -111,6 +115,10 @@ sub success {
$destination .= '&destinationurl='.$destsymb;
}
}
+ if ($destination =~ m{^/adm/roles}) {
+ $destination .= ($destination =~ /\?/) ? '&' : '?';
+ $destination .= 'source=login';
+ }
my $windowinfo = Apache::lonhtmlcommon::scripttag('self.name="loncapaclient";');
my $header = '';
@@ -130,15 +138,15 @@ sub success {
my %lt=&Apache::lonlocal::texthash(
'wel' => 'Welcome',
- 'mes' => 'Welcome to the LearningOnline Network with CAPA. Please wait while your session is being set up.',
'pro' => 'Login problems?',
'log' => 'loginproblems.html',
);
+ my $welcome = &mt('Welcome to the Learning[_1]Online[_2] Network with CAPA. Please wait while your session is being set up.','','');
$r->print(<$lt{'wel'}
-$lt{'mes'}
+$welcome
$lt{'pro'}
$continuelink
$end_page
@@ -413,7 +421,7 @@ sub handler {
if ($r->dir_config("lonBalancer") eq 'yes') {
&success($r,$form{'uname'},$form{'udom'},$authhost,'noredirect',undef,
\%form);
- my ($otherserver) = &Apache::lonnet::choose_server($form{'udom'});
+ my $otherserver = &Apache::lonnet::spareserver(30000,undef,1,$form{'udom'});
$r->internal_redirect('/adm/switchserver?otherserver='.$otherserver.'&origurl='.$firsturl);
return OK;
} else {