--- loncom/auth/lonlogin.pm 2010/03/05 17:37:21 1.106.4.6 +++ loncom/auth/lonlogin.pm 2010/03/31 23:11:48 1.136 @@ -1,7 +1,7 @@ # The LearningOnline Network # Login Screen # -# $Id: lonlogin.pm,v 1.106.4.6 2010/03/05 17:37:21 raeburn Exp $ +# $Id: lonlogin.pm,v 1.136 2010/03/31 23:11:48 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -72,28 +72,31 @@ sub handler { # -------------------------------- 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'}; - } - $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].', '','','','').'
' - .'' .$end_page ); - return OK; + return OK; + } } # ---------------------------------------------------- No valid token, continue @@ -106,21 +109,21 @@ sub handler { # ----------------------------------------------------------- Process Interface $env{'form.interface'}=~s/\W//g; - my $textbrowsers=$r->dir_config('lonTextBrowsers'); my $httpbrowser=$ENV{"HTTP_USER_AGENT"}; - - foreach (split(/\:/,$textbrowsers)) { - if ($httpbrowser=~/$_/i) { - $env{'form.interface'}='textual'; - } - } - - my $fullgraph=($env{'form.interface'} ne 'textual'); my $iconpath= &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL')); + my $lonhost = $r->dir_config('lonHostID'); my $domain = &Apache::lonnet::default_login_domain(); + if ($lonhost ne '') { + my $redirect = &check_loginvia($domain,$lonhost); + if ($redirect) { + $r->print($redirect); + return OK; + } + } + if (($env{'form.domain'}) && (&Apache::lonnet::domain($env{'form.domain'},'description'))) { $domain=$env{'form.domain'}; @@ -128,7 +131,6 @@ sub handler { my $role = $r->dir_config('lonRole'); my $loadlim = $r->dir_config('lonLoadLim'); my $servadm = $r->dir_config('lonAdmEMail'); - my $lonhost = $r->dir_config('lonHostID'); my $tabdir = $r->dir_config('lonTabDir'); my $include = $r->dir_config('lonIncludes'); my $expire = $r->dir_config('lonExpire'); @@ -218,461 +220,292 @@ sub handler { ' '.&mt('(preferred)').''.$/; $last=$hostname; } - $spares.= ''.&mt('Please attempt to login to one of the following servers:').'
' - .$spares - .'' - .'' - ); - return OK; - } +$spares.= ''.&mt('Please attempt to login to one of the following servers:').'
' + .$spares + .'' + .'' +); +return OK; +} # ----------------------------------------------- Apparently we are in business - $servadm=~s/\,/\
-HEADER
- if ($showbanner) {
- $r->print(< | |||||||||
- - - | - - - | - - - | - | ||||||
-
|
-
-
- - - - - |
-ENDSTART
- if ($showmainlogo) {
- $r->print(< + + : + + : + + + +LFORM - -
- | | ||||||
+ if ($showbanner) {
+ $r->print(<
+
+
+HEADER
+ }
+ $r->print(<
+
+ENDTOP
+ if ($showmainlogo) {
+ $r->print(' '."\n");
+ }
+$r->print(<
+ $logintitle
+
+
+
+ $loginhelp
+ $forgotpw
+ $contactblock
+ $newuserlink
+ $coursecatalog
+
+The LearningOnline Network with CAPA' - .''.&mt('Text-based Interface Login').'' - .$announcements); - } - $r->print(' |
- $lt{'dom'}: + | + $lt{'serv'}: | -- $domain + | + $lonhost ($role) |
- $lt{'serv'}: + | + $lt{'load'}: | -- $lonhost ($role) + | + $loadpercent $lt{'perc'} |
- $lt{'load'}: + | + $lt{'userload'}: | -- $loadpercent% + | + $userloadpercent $lt{'perc'} |
- $lt{'userload'}: - | -- $userloadpercent% + | + $version |