--- loncom/auth/lonlogin.pm 2009/05/14 10:21:10 1.120 +++ loncom/auth/lonlogin.pm 2009/09/11 23:04:45 1.125 @@ -1,7 +1,7 @@ # The LearningOnline Network # Login Screen # -# $Id: lonlogin.pm,v 1.120 2009/05/14 10:21:10 foxr Exp $ +# $Id: lonlogin.pm,v 1.125 2009/09/11 23:04:45 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -46,7 +46,7 @@ sub handler { (join('&',$ENV{'QUERY_STRING'},$env{'request.querystring'}, $ENV{'REDIRECT_QUERY_STRING'}), ['interface','username','domain','firsturl','localpath','localres', - 'token']); + 'token','role','symb']); if (!defined($env{'form.firsturl'})) { &Apache::lonacc::get_posted_cgi($r,['firsturl']); } @@ -81,11 +81,15 @@ sub handler { &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('You are already logged in!').'

' .'

'.&mt('Please either [_1]continue the current session[_2] or [_3]log out[_4].', - '','','','').'

' + '','','','').'

' .'

'.&mt('Login problems?').'

' .$end_page ); @@ -170,8 +174,18 @@ sub handler { if ($uextkey>2147483647) { $uextkey-=4294967296; } # -------------------------------------------------------- Store away log token + my $tokenextras; + if ($env{'form.role'}) { + $tokenextras = '&role='.&escape($env{'form.role'}); + } + if ($env{'form.symb'}) { + if (!$tokenextras) { + $tokenextras = '&'; + } + $tokenextras .= '&symb='.&escape($env{'form.symb'}); + } my $logtoken=Apache::lonnet::reply( - 'tmpput:'.$ukey.$lkey.'&'.$firsturl, + 'tmpput:'.$ukey.$lkey.'&'.$firsturl.$tokenextras, $lonhost); # ------------------- If we cannot talk to ourselves, we are in serious trouble @@ -264,6 +278,7 @@ my $now=time; my $js = (< +// ENDSCRIPT @@ -344,10 +360,6 @@ $r->print( # then just us a relative link to authenticate: # -if ($otherserver eq "http://") { - $otherserver=""; -} - $r->print(< @@ -385,7 +397,7 @@ my $contactblock = &contactdisplay(\%lt, $version,$authdomain,\$helpdeskscript); my $loginform=(< +
:
@@ -481,8 +493,10 @@ $r->print(< $helpdeskscript @@ -509,6 +523,7 @@ sub contactdisplay { my $thisurl = &escape('/adm/login'); $$helpdeskscript = <<"ENDSCRIPT"; ENDSCRIPT }