--- loncom/auth/lonlogin.pm 2010/03/03 17:05:49 1.134 +++ loncom/auth/lonlogin.pm 2010/08/25 22:03:51 1.142 @@ -1,7 +1,7 @@ # The LearningOnline Network # Login Screen # -# $Id: lonlogin.pm,v 1.134 2010/03/03 17:05:49 raeburn Exp $ +# $Id: lonlogin.pm,v 1.142 2010/08/25 22:03:51 raeburn 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].', '','','','').'
' - .'' - .$dom.' '.$end_page + .$end_page ); - return OK; + return OK; + } } # ---------------------------------------------------- No valid token, continue @@ -157,15 +153,8 @@ sub handler { my $loadpercent=sprintf("%.1f",100*$loadavg/$loadlim); my $userloadpercent=&Apache::lonnet::userload(); -# ------------------------------------------------------- Do the load balancing - my $otherserver= &Apache::lonnet::absolute_url($host_name); my $firsturl= ($env{'request.firsturl'}?$env{'request.firsturl'}:$env{'form.firsturl'}); -# ---------------------------------------------------------- Are we overloaded? - if ((($userloadpercent>100.0)||($loadpercent>100.0))) { - my $unloaded=Apache::lonnet::spareserver($loadpercent,$userloadpercent); - if ($unloaded) { $otherserver=$unloaded; } - } # ----------------------------------------------------------- Get announcements my $announcements=&Apache::lonnet::getannounce(); @@ -269,13 +258,12 @@ my $link=&Apache::loncommon::designparm( my $vlink=&Apache::loncommon::designparm('login.vlink',$domain); my $alink=&Apache::loncommon::designparm('login.alink',$domain); my $mainbg=&Apache::loncommon::designparm('login.mainbg',$domain); +my $loginbox_bg=&Apache::loncommon::designparm('login.sidebg',$domain); +my $loginbox_header_bgcol=&Apache::loncommon::designparm('login.bgcol',$domain); +my $loginbox_header_textcol=&Apache::loncommon::designparm('login.textcol',$domain); my $logo=&Apache::loncommon::designparm('login.logo',$domain); my $img=&Apache::loncommon::designparm('login.img',$domain); -my $domainlogo='- $loginform - | -
@@ -510,6 +503,11 @@ $r->print(< |