--- loncom/auth/lonlogin.pm 2012/08/27 00:52:45 1.152 +++ loncom/auth/lonlogin.pm 2013/01/11 17:35:10 1.153 @@ -1,7 +1,7 @@ # The LearningOnline Network # Login Screen # -# $Id: lonlogin.pm,v 1.152 2012/08/27 00:52:45 raeburn Exp $ +# $Id: lonlogin.pm,v 1.153 2013/01/11 17:35:10 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -289,11 +289,17 @@ sub handler { if (defined(&Apache::loncommon::designparm('login.showlogo_logo',$domain))) { $showmainlogo = &Apache::loncommon::designparm('login.showlogo_logo',$domain); } - my $showadminmail=&Apache::loncommon::designparm('login.adminmail',$domain); + my $showadminmail; + my @possdoms = &Apache::lonnet::current_machine_domains(); + if (grep(/^\Q$domain\E$/,@possdoms)) { + $showadminmail=&Apache::loncommon::designparm('login.adminmail',$domain); + } my $showcoursecat = &Apache::loncommon::designparm('login.coursecatalog',$domain); my $shownewuserlink = &Apache::loncommon::designparm('login.newuser',$domain); + my $showhelpdesk = + &Apache::loncommon::designparm('login.helpdesk',$domain); my $now=time; my $js = (<'; my $helpdeskscript; my $contactblock = &contactdisplay(\%lt,$servadm,$showadminmail, - $authdomain,\$helpdeskscript); + $authdomain,\$helpdeskscript, + $showhelpdesk,\@possdoms); my $loginform=(< @@ -617,12 +624,22 @@ sub redirect_page { } sub contactdisplay { - my ($lt,$servadm,$showadminmail,$authdomain,$helpdeskscript) = @_; + my ($lt,$servadm,$showadminmail,$authdomain,$helpdeskscript,$showhelpdesk, + $possdoms) = @_; my $contactblock; - my $showhelpdesk = 0; - my $requestmail = $Apache::lonnet::perlvar{'lonSupportEMail'}; - if ($requestmail =~ m/^[^\@]+\@[^\@]+$/) { - $showhelpdesk = 1; + my $origmail; + if (ref($possdoms) eq 'ARRAY') { + if (grep(/^\Q$authdomain\E$/,@{$possdoms})) { + $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'}; + } + } + my $requestmail = + &Apache::loncommon::build_recipient_list(undef,'helpdeskmail', + $authdomain,$origmail); + if ($showhelpdesk) { + unless ($requestmail =~ m/[^\@]+\@[^\@]+/) { + $showhelpdesk = 0; + } } if ($servadm && $showadminmail) { $contactblock .= $$lt{'servadm'}.':
'.