--- loncom/auth/lonlogin.pm 2009/12/04 13:50:48 1.131
+++ loncom/auth/lonlogin.pm 2010/09/02 09:24:42 1.145
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Login Screen
#
-# $Id: lonlogin.pm,v 1.131 2009/12/04 13:50:48 jms Exp $
+# $Id: lonlogin.pm,v 1.145 2010/09/02 09:24:42 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -69,39 +69,35 @@ sub handler {
return OK;
}
+ $env{'form.firsturl'} =~ s/(`)/'/g;
# -------------------------------- Prevent users from attempting to login twice
my $handle = &Apache::lonnet::check_for_valid_session($r);
- if ($handle=~/^publicuser\_/) {
+ if ($handle ne '') {
+ my $lonidsdir=$r->dir_config('lonIDsDir');
+ if ($handle=~/^publicuser\_/) {
# For "public user" - remove it, we apparently really want to login
- unlink($r->dir_config('lonIDsDir')."/$handle.id");
- } elsif ($handle ne '') {
+ unlink($r->dir_config('lonIDsDir')."/$handle.id");
+ } else {
# Indeed, a valid token is found
- my $start_page =
- &Apache::loncommon::start_page('Already logged in');
- my $end_page =
- &Apache::loncommon::end_page();
- my $dest = '/adm/roles';
- if ($env{'form.firsturl'} ne '') {
- $dest = $env{'form.firsturl'};
- }
-
- my $dom = &Apache::lonnet::default_login_domain();
- my %helpconfig = &Apache::lonnet::get_dom('configuration',['helpsettings'],$dom);
-
- my $loginhelp_page = $helpconfig{'helpsettings'}{'loginhelpurl'};
- if ($loginhelp_page eq '') {
- $loginhelp_page = '/adm/loginproblems.html';
- }
- $r->print(
+ &Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle);
+ my $start_page =
+ &Apache::loncommon::start_page('Already logged in');
+ my $end_page =
+ &Apache::loncommon::end_page();
+ my $dest = '/adm/roles';
+ if ($env{'form.firsturl'} ne '') {
+ $dest = $env{'form.firsturl'};
+ }
+ $r->print(
$start_page
.'
'.&mt('Please either [_1]continue the current session[_2] or [_3]log out[_4].',
'','','','').'
'
- .'');
+ '
'
+);
#
# If the loadbalancing yielded just http:// because perhaps there's no loadbalancing?
@@ -381,7 +381,7 @@ $r->print(
#
$r->print(<
+
LFORM
@@ -433,55 +432,45 @@ LFORM
if ($showbanner) {
$r->print(<
-
-
-
-
- |
-
-
+
+
+
HEADER
}
$r->print(<
-
-
+
+
$logintitle
-
- $noscript_warning
+ $loginform
+ $noscript_warning
-
- $loginhelp
- $forgotpw
-
- $contactblock
-
- $newuserlink
+
+ $loginhelp
+ $forgotpw
+ $contactblock
+ $newuserlink
$coursecatalog
+
+
ENDTOP
if ($showmainlogo) {
$r->print('
'."\n");
}
$r->print(<
+
+
ENDTOP
$r->print(<
- $lt{'dom'}:
+ $lt{'dom'}:
|
$domain
@@ -489,7 +478,7 @@ $r->print(<
- $lt{'serv'}:
+ $lt{'serv'}:
|
$lonhost ($role)
@@ -497,7 +486,7 @@ $r->print(<
- $lt{'load'}:
+ $lt{'load'}:
|
$loadpercent $lt{'perc'}
@@ -505,13 +494,23 @@ $r->print(<
- $lt{'userload'}:
+ $lt{'userload'}:
|
$userloadpercent $lt{'perc'}
|
+
+
+ $version
+ |
+
| | |
+
+
+ $domainlogo
+
+
ENDSCRIPT
}
- $contactblock .= $version;
return $contactblock;
}
@@ -587,17 +627,20 @@ sub forgotpwdisplay {
}
sub loginhelpdisplay {
- my (%lt) = @_;
+ my ($authdomain,%lt) = @_;
my $login_help = 1;
if ($login_help) {
- my $dom = &Apache::lonnet::default_login_domain();
- my %helpconfig = &Apache::lonnet::get_dom('configuration',['helpsettings'],$dom);
- my $loginhelp_url = $helpconfig{'helpsettings'}{'loginhelpurl'};
- if ($loginhelp_url ne '') {
- return '
'.$lt{'help'}.'';
+ my $dom = $authdomain;
+ if ($dom eq '') {
+ $dom = &Apache::lonnet::default_login_domain();
+ }
+ my %helpconfig = &Apache::lonnet::get_dom('configuration',['helpsettings'],$dom);
+ my $loginhelp_url = $helpconfig{'helpsettings'}{'loginhelpurl'};
+ if ($loginhelp_url ne '') {
+ return '
'.$lt{'help'}.'';
} else {
- return '
'.$lt{'help'}.'';
- }
+ return '
'.$lt{'help'}.'';
+ }
}
return;
}