--- loncom/auth/lonlogin.pm 2003/07/16 20:42:31 1.43
+++ loncom/auth/lonlogin.pm 2003/09/20 17:44:22 1.53
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Login Screen
#
-# $Id: lonlogin.pm,v 1.43 2003/07/16 20:42:31 www Exp $
+# $Id: lonlogin.pm,v 1.53 2003/09/20 17:44:22 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -40,19 +40,29 @@ use Apache::Constants qw(:common);
use Apache::File ();
use Apache::lonnet();
use Apache::loncommon();
+use Apache::lonauth();
+use Apache::lonlocal;
sub handler {
my $r = shift;
- $r->content_type('text/html');
&Apache::loncommon::no_cache($r);
+ &Apache::lonlocal::get_language_handle($r);
+ $r->content_type('text/html');
$r->send_http_header;
return OK if $r->header_only;
+# Are we re-routing?
+ if (-e '/home/httpd/html/lon-status/reroute.txt') {
+ &Apache::lonauth::reroute($r);
+ return OK;
+ }
+
&Apache::loncommon::get_unprocessed_cgi
($ENV{'QUERY_STRING'}.'&'.$ENV{'request.querystring'},
['interface','username','domain','firsturl','localpath','localres']);
+
# ----------------------------------------------------------- Process Interface
$ENV{'form.interface'}=~s/\W//g;
@@ -73,6 +83,10 @@ sub handler {
my $iconpath= 'http://'.$ENV{'HTTP_HOST'}.':'.$port_to_use.
$r->dir_config('lonIconsURL');
my $domain = $r->dir_config('lonDefDomain');
+ if (($ENV{'form.domain'}) &&
+ ($Apache::lonnet::domaindescription{$ENV{'form.domain'}})) {
+ $domain=$ENV{'form.domain'};
+ }
my $role = $r->dir_config('lonRole');
my $loadlim = $r->dir_config('lonLoadLim');
my $servadm = $r->dir_config('lonAdmEMail');
@@ -81,6 +95,7 @@ sub handler {
my $tabdir = $r->dir_config('lonTabDir');
my $include = $r->dir_config('lonIncludes');
my $expire = $r->dir_config('lonExpire');
+ my $version = $r->dir_config('lonVersion');
# --------------------------------------------- Default values for login fields
@@ -104,9 +119,12 @@ sub handler {
# ---------------------------------------- Are we access server and overloaded?
if (($role eq 'access') &&
(($userloadpercent>100.0)||($loadpercent>100.0))) {
- $otherserver=Apache::lonnet::spareserver($loadpercent,$userloadpercent);
+ my $unloaded=Apache::lonnet::spareserver($loadpercent,$userloadpercent);
+ if ($unloaded) { $otherserver=$unloaded; }
}
+# ----------------------------------------------------------- Get announcements
+ my $announcements=&Apache::lonnet::getannounce();
# -------------------------------------------------------- Set login parameters
my @hexstr=('0','1','2','3','4','5','6','7',
@@ -162,7 +180,7 @@ ENDTROUBLE
# ----------------------------------------------- Apparently we are in business
- my $domainlogo=&Apache::loncommon::domainlogo();
+ my $domainlogo=&Apache::loncommon::domainlogo($domain);
$servadm=~s/\,/\
/g;
$sysadm=~s/\,/\
/g;
@@ -182,20 +200,38 @@ ENDHEADER
# ----------------------------------------------------------- Front page design
my $pgbg=
- ($fullgraph?&Apache::loncommon::designparm('login.pgbg'):'#FFFFFF');
+ ($fullgraph?&Apache::loncommon::designparm('login.pgbg',$domain):'#FFFFFF');
my $font=
- ($fullgraph?&Apache::loncommon::designparm('login.font'):'#000000');
+ ($fullgraph?&Apache::loncommon::designparm('login.font',$domain):'#000000');
my $link=
- ($fullgraph?&Apache::loncommon::designparm('login.link'):'#0000FF');
+ ($fullgraph?&Apache::loncommon::designparm('login.link',$domain):'#0000FF');
my $vlink=
- ($fullgraph?&Apache::loncommon::designparm('login.vlink'):'#0000FF');
- my $alink=&Apache::loncommon::designparm('login.alink');
+ ($fullgraph?&Apache::loncommon::designparm('login.vlink',$domain):'#0000FF');
+ my $alink=&Apache::loncommon::designparm('login.alink',$domain);
my $mainbg=
- ($fullgraph?&Apache::loncommon::designparm('login.mainbg'):'#FFFFFF');
+ ($fullgraph?&Apache::loncommon::designparm('login.mainbg',$domain):'#FFFFFF');
my $sidebg=
- ($fullgraph?&Apache::loncommon::designparm('login.sidebg'):'#FFFFFF');
- my $logo=&Apache::loncommon::designparm('login.logo');
- my $img=&Apache::loncommon::designparm('login.img');
+ ($fullgraph?&Apache::loncommon::designparm('login.sidebg',$domain):'#FFFFFF');
+ my $logo=&Apache::loncommon::designparm('login.logo',$domain);
+ my $img=&Apache::loncommon::designparm('login.img',$domain);
+
+# ----------------------------------------------------------------------- Texts
+
+my %lt=&Apache::lonlocal::texthash(
+ 'un' => 'Username',
+ 'pw' => 'Password',
+ 'dom' => 'Domain',
+ 'perc' => 'percent',
+ 'load' => 'Load',
+ 'userload' => 'User Load',
+ 'about' => 'aboutlon.gif',
+ 'access' => 'accessbutton.gif',
+ 'auth' => 'userauthentication.gif',
+ 'log' => 'Log in',
+ 'help' => 'Help',
+ 'serv' => 'Server',
+ 'servadm' => 'Server Administration',
+ 'sysadm' => 'System Administration');
# ---------------------------------------------------------- Serve rest of page
@@ -295,9 +331,9 @@ ENDSERVERFORM