version 1.73, 2006/01/19 22:14:38
|
version 1.74, 2006/04/05 22:39:55
|
Line 210 sub success {
|
Line 210 sub success {
|
my $remoteinfo=&Apache::lonmenu::load_remote_msg($lowerurl); |
my $remoteinfo=&Apache::lonmenu::load_remote_msg($lowerurl); |
my $setflags=&Apache::lonmenu::setflags(); |
my $setflags=&Apache::lonmenu::setflags(); |
my $maincall=&Apache::lonmenu::maincall(); |
my $maincall=&Apache::lonmenu::maincall(); |
my $bodytag=&Apache::loncommon::bodytag('Successful Login'); |
my $start_page=&Apache::loncommon::start_page('Successful Login', |
my $add=&addcontent(); |
$startupremote); |
|
my $end_page =&Apache::loncommon::end_page(); |
|
|
my $continuelink; |
my $continuelink; |
if (($env{'browser.interface'} eq 'textual') || |
if (($env{'browser.interface'} eq 'textual') || |
($env{'environment.remote'} eq 'off')) { |
($env{'environment.remote'} eq 'off')) { |
Line 219 sub success {
|
Line 221 sub success {
|
} |
} |
# ------------------------------------------------- Output for successful login |
# ------------------------------------------------- Output for successful login |
|
|
$r->send_cgi_header(<<ENDHEADER); |
&Apache::loncommon::content_type($r,'text/html'); |
Content-type: text/html$add |
$r->header_out('Set-cookie' => $cookie); |
Set-cookie: $cookie |
$r->send_http_header; |
|
|
ENDHEADER |
|
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'wel' => 'Welcome', |
'wel' => 'Welcome', |
'mes' => 'Welcome to the Learning<i>Online</i> Network with CAPA. Please wait while your session is being set up', |
'mes' => 'Welcome to the Learning<i>Online</i> Network with CAPA. Please wait while your session is being set up', |
Line 231 ENDHEADER
|
Line 232 ENDHEADER
|
'log' => 'loginproblems.html', |
'log' => 'loginproblems.html', |
); |
); |
$r->print(<<ENDSUCCESS); |
$r->print(<<ENDSUCCESS); |
<html> |
$start_page |
<head> |
|
<title>Successful Login to the LearningOnline Network with CAPA</title> |
|
$startupremote |
|
</head> |
|
$bodytag |
|
$setflags |
$setflags |
$windowinfo |
$windowinfo |
<h1>$lt{'wel'}</h1> |
<h1>$lt{'wel'}</h1> |
Line 245 $lt{'mes'}.<p>
|
Line 241 $lt{'mes'}.<p>
|
$remoteinfo |
$remoteinfo |
$maincall |
$maincall |
$continuelink |
$continuelink |
</body> |
$end_page |
</html> |
|
ENDSUCCESS |
ENDSUCCESS |
} |
} |
|
|
Line 254 ENDSUCCESS
|
Line 249 ENDSUCCESS
|
|
|
sub failed { |
sub failed { |
my ($r,$message) = @_; |
my ($r,$message) = @_; |
my $bodytag=&Apache::loncommon::bodytag('Unsuccessful Login'); |
my $start_page = &Apache::loncommon::start_page('Unsuccessful Login'); |
my $add=&addcontent(); |
my $end_page = &Apache::loncommon::end_page(); |
$r->send_cgi_header(<<ENDFHEADER); |
|
Content-type: text/html$add |
my %lt=('sorry' => &mt('Sorry ...'), |
|
'please' => |
|
&mt('Please [_1]log in again[_2].', |
|
"<a href=\"/adm/login?username=$FORM{'uname'}&domain=$FORM{'udom'}\">", |
|
'</a>'), |
|
'problemspage' => &mt('loginproblems.html'), |
|
'problems' => 'Problems', |
|
); |
|
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
|
ENDFHEADER |
|
$r->print(<<ENDFAILED); |
$r->print(<<ENDFAILED); |
<html> |
$start_page |
<head> |
<h1>$lt{'sorry'}</h1> |
<title>Unsuccessful Login to the LearningOnline Network with CAPA</title> |
|
</head> |
|
$bodytag |
|
<h1>Sorry ...</h1> |
|
<p><b>$message</b></p> |
<p><b>$message</b></p> |
<p>Please <a href="/adm/login?username=$FORM{'uname'}&domain=$FORM{'udom'}">log in again</a>.</p> |
<p>$lt{'please'}</p> |
<p> |
<p> |
<a href="/adm/loginproblems.html">Problems?</a></p> |
<a href="/adm/$lt{'problemspage'}">$lt{'problems'}</a></p> |
</body> |
$end_page |
</html> |
|
ENDFAILED |
ENDFAILED |
} |
} |
|
|
# --------------------------------------------------------------------- Charset |
|
|
|
sub addcontent { |
|
my $encoding=&Apache::lonlocal::current_encoding; |
|
if ($encoding) { |
|
return '; charset='.$encoding; |
|
} else { |
|
return ''; |
|
} |
|
} |
|
|
|
# ------------------------------------------------------------------ Rerouting! |
# ------------------------------------------------------------------ Rerouting! |
|
|
sub reroute { |
sub reroute { |
my $r=shift; |
my ($r) = @_; |
my $bodytag=&Apache::loncommon::bodytag('Rerouting'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_cgi_header(<<ENDRFHEADER); |
$r->send_http_header; |
Content-type: text/html |
my $msg='<h1>Sorry ...</h1> |
|
Please <a href="/">log in again</a>.'; |
ENDRFHEADER |
&Apache::loncommon::simple_error_page($r,'Rerouting',$msg); |
$r->print(<<ENDRFAILED); |
|
<html> |
|
<head> |
|
<title>Rerouting Login to the LearningOnline Network with CAPA</title> |
|
</head> |
|
$bodytag |
|
<h1>Sorry ...</h1> |
|
Please <a href="/">log in again</a>. |
|
</body> |
|
</html> |
|
ENDRFAILED |
|
} |
} |
|
|
# ---------------------------------------------------------------- Main handler |
# ---------------------------------------------------------------- Main handler |
Line 332 sub handler {
|
Line 308 sub handler {
|
my $lonidsdir=$r->dir_config('lonIDsDir'); |
my $lonidsdir=$r->dir_config('lonIDsDir'); |
if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) { |
if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) { |
# Indeed, a valid token is found |
# Indeed, a valid token is found |
$r->send_cgi_header(<<ENDFHEADER); |
&Apache::loncommon::content_type($r,'text/html'); |
Content-type: text/html |
$r->send_http_header; |
|
my $start_page = |
ENDFHEADER |
&Apache::loncommon::start_page('Already logged in'); |
my $bodytag=&Apache::loncommon::bodytag('Already logged in'); |
my $end_page = |
|
&Apache::loncommon::end_page(); |
$r->print(<<ENDFAILED); |
$r->print(<<ENDFAILED); |
<html> |
$start_page |
<head> |
|
<title>Already logged in</title> |
|
</head> |
|
$bodytag |
|
<h1>You are already logged in</h1> |
<h1>You are already logged in</h1> |
<p>Please either <a href="/adm/roles">continue the current session</a> or |
<p>Please either <a href="/adm/roles">continue the current session</a> or |
<a href="/adm/logout">logout</a>.</p> |
<a href="/adm/logout">logout</a>.</p> |
<p> |
<p> |
<a href="/adm/loginproblems.html">Problems?</a></p> |
<a href="/adm/loginproblems.html">Problems?</a></p> |
</body> |
$end_page |
</html> |
|
ENDFAILED |
ENDFAILED |
return OK; |
return OK; |
} |
} |