--- loncom/auth/lonlogin.pm 2007/01/13 20:39:57 1.86
+++ loncom/auth/lonlogin.pm 2007/08/30 22:07:45 1.94
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Login Screen
#
-# $Id: lonlogin.pm,v 1.86 2007/01/13 20:39:57 raeburn Exp $
+# $Id: lonlogin.pm,v 1.94 2007/08/30 22:07:45 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -40,17 +40,6 @@ use Apache::migrateuser();
use lib '/home/httpd/lib/perl/';
use LONCAPA;
-
-sub additional_machine_domains {
- my @domains;
- open(my $fh,"<".$Apache::lonnet::perlvar{'lonTabDir'}.'/expected_domains.tab');
- while( my $line = <$fh>) {
- $line =~ s/\s//g;
- push(@domains,$line);
- }
- return @domains;
-}
-
sub handler {
my $r = shift;
@@ -131,30 +120,24 @@ ENDFAILED
}
my $fullgraph=($env{'form.interface'} ne 'textual');
- my $port_to_use=$r->dir_config('lonhttpdPort');
- if (!defined($port_to_use)) {
- $port_to_use='8080';
- }
- my $iconpath= 'http://'.$ENV{'HTTP_HOST'}.':'.$port_to_use.
- $r->dir_config('lonIconsURL');
- my $domain = $r->dir_config('lonDefDomain');
- my $testdomain=(split(/\./,$ENV{'HTTP_HOST'}))[0];
- foreach my $posdom (&Apache::lonnet::current_machine_domains(),
- &additional_machine_domains()) {
- if (lc($posdom) eq lc($testdomain)) { $domain=$posdom; }
- }
+
+ my $iconpath=
+ &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));
+
+ my $domain = &Apache::lonnet::default_login_domain();
if (($env{'form.domain'}) &&
- ($Apache::lonnet::domaindescription{$env{'form.domain'}})) {
+ (&Apache::lonnet::domain($env{'form.domain'},'description'))) {
$domain=$env{'form.domain'};
}
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');
my $version = $r->dir_config('lonVersion');
- my $host_name = $Apache::lonnet::hostname{$lonhost};
+ my $host_name = &Apache::lonnet::hostname($lonhost);
# --------------------------------------------- Default values for login fields
@@ -216,33 +199,36 @@ ENDFAILED
my $last;
foreach my $hostid (sort
{
- $Apache::lonnet::hostname{$a} cmp
- $Apache::lonnet::hostname{$b};
+ &Apache::lonnet::hostname($a) cmp
+ &Apache::lonnet::hostname($b);
}
keys(%Apache::lonnet::spareid)) {
next if ($hostid eq $lonhost);
- next if ($last eq $Apache::lonnet::hostname{$hostid});
+ my $hostname = &Apache::lonnet::hostname($hostid);
+ next if ($last eq $hostname);
$spares.='
'.
- $Apache::lonnet::hostname{$hostid}.''.
+ $hostname.''.
' (preferred)'.$/;
- $last=$Apache::lonnet::hostname{$hostid};
+ $last=$hostname;
}
$spares.= '
';
+ my %all_hostnames = &Apache::lonnet::all_hostnames();
foreach my $hostid (sort
{
- $Apache::lonnet::hostname{$a} cmp
- $Apache::lonnet::hostname{$b};
+ &Apache::lonnet::hostname($a) cmp
+ &Apache::lonnet::hostname($b);
}
- keys(%Apache::lonnet::hostname)) {
+ keys(%all_hostnames)) {
next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid});
- next if ($last eq $Apache::lonnet::hostname{$hostid});
+ my $hostname = &Apache::lonnet::hostname($hostid);
+ next if ($last eq $hostname);
$spares.='
'.
- $Apache::lonnet::hostname{$hostid}.'';
- $last=$Apache::lonnet::hostname{$hostid};
+ $hostname.'';
+ $last=$hostname;
}
$r->print(<
@@ -258,8 +244,7 @@ ENDTROUBLE
}
# ----------------------------------------------- Apparently we are in business
-
- my $domainlogo=&Apache::loncommon::domainlogo($domain);
+ $servadm=~s/\,/\
/g;
# --------------------------------------------------- Print login screen header
$r->print(< 'Log in',
'help' => 'Log-in Help',
'serv' => 'Server',
+ 'servadm' => 'Server Administration',
'helpdesk' => 'Contact Helpdesk',
'forgotpw' => 'Forgot password?');
# -------------------------------------------------- Change password field name
@@ -392,6 +383,10 @@ ENDSCRIPT
ENDSERVERFORM
+ my $coursecatalog;
+ if (($showcoursecat eq '') || ($showcoursecat)) {
+ $coursecatalog = &coursecatalog_link($lt{'catalog'});
+ }
if ($fullgraph) { $r->print(<
@@ -428,11 +423,7 @@ ENDSERVERFORM
|
$lt{'about'} |
-
-
- |
- $lt{'catalog'} |
-
+ $coursecatalog
|
@@ -491,15 +482,15 @@ ENDNOOPT
|
- $lt{'un'}: |
+ : |
|
- $lt{'pw'}: |
+ : |
|
- $lt{'dom'}: |
+ : |
|
@@ -521,7 +512,8 @@ ENDNOOPT
ENDLOGIN
if ($fullgraph) {
my $helpdeskscript;
- my $contactblock = &contactdisplay(\%lt,$version,$authdomain,\$helpdeskscript);
+ my $contactblock = &contactdisplay(\%lt,$servadm,$showadminmail,
+ $version,$authdomain,\$helpdeskscript);
$r->print(<
@@ -617,13 +609,17 @@ ENDDOCUMENT
}
sub contactdisplay {
- my ($lt,$version,$authdomain,$helpdeskscript) = @_;
+ my ($lt,$servadm,$showadminmail,$version,$authdomain,$helpdeskscript) = @_;
my $contactblock;
my $showhelpdesk = 0;
my $requestmail = $Apache::lonnet::perlvar{'lonSupportEMail'};
if ($requestmail =~ m/^[^\@]+\@[^\@]+$/) {
$showhelpdesk = 1;
}
+ if ($servadm && $showadminmail) {
+ $contactblock .= ' '.$$lt{'servadm'}.':
'.
+ ' '.$servadm.'
';
+ }
if ($showhelpdesk) {
$contactblock .= ' '.$lt->{'helpdesk'}.'
';
my $thisurl = &escape('/adm/login');
@@ -665,5 +661,15 @@ sub loginhelpdisplay {
return;
}
+sub coursecatalog_link {
+ my ($linkname) = @_;
+ return <<"END";
+
+ |
+ $linkname |
+
+END
+}
+
1;
__END__