--- loncom/auth/lonlogin.pm 2007/01/14 02:00:04 1.87
+++ loncom/auth/lonlogin.pm 2007/04/06 22:06:02 1.91
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Login Screen
#
-# $Id: lonlogin.pm,v 1.87 2007/01/14 02:00:04 raeburn Exp $
+# $Id: lonlogin.pm,v 1.91 2007/04/06 22:06:02 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -128,17 +128,18 @@ ENDFAILED
$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
@@ -200,33 +201,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(<
@@ -242,8 +246,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
@@ -376,6 +385,10 @@ ENDSCRIPT
ENDSERVERFORM
+ my $coursecatalog;
+ if ($showcoursecat eq '' || $showcoursecat)) {
+ $coursecatalog = &coursecatalog_link($lt{'catalog'});
+ }
if ($fullgraph) { $r->print(<
@@ -412,11 +425,7 @@ ENDSERVERFORM
|
$lt{'about'} |
-
-
- |
- $lt{'catalog'} |
-
+ $coursecatalog
|
@@ -505,7 +514,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(<
@@ -601,13 +611,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');
@@ -649,5 +663,15 @@ sub loginhelpdisplay {
return;
}
+sub coursecatalog_link {
+ my ($linkname) = @_;
+ return <<"END";
+
+ |
+ $linkname |
+
+END
+}
+
1;
__END__