[LON-CAPA-cvs] cvs: loncom /auth lonlogin.pm /interface domainprefs.pm

raeburn raeburn at source.lon-capa.org
Fri Jan 11 12:35:11 EST 2013


raeburn		Fri Jan 11 17:35:11 2013 EDT

  Modified files:              
    /loncom/interface	domainprefs.pm 
    /loncom/auth	lonlogin.pm 
  Log:
  - Log-in page
    - Domain configuration to disable display of "Contact Helpdesk" link
      on log-in page (default is to display).
    - Don't display server administrator's e-mail address, if configured to be 
      hidden, in the case where a user's self-declared domain is not the
      server's own domain.
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.187 loncom/interface/domainprefs.pm:1.188
--- loncom/interface/domainprefs.pm:1.187	Wed Jan  9 21:34:26 2013
+++ loncom/interface/domainprefs.pm	Fri Jan 11 17:35:03 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.187 2013/01/09 21:34:26 raeburn Exp $
+# $Id: domainprefs.pm,v 1.188 2013/01/11 17:35:03 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -882,10 +882,11 @@
     } elsif ($caller eq 'page') {
         my %defaultchecked = ( 
                                'coursecatalog' => 'on',
+                               'helpdesk'      => 'on',
                                'adminmail'     => 'off',
                                'newuser'       => 'off',
                              );
-        my @toggles = ('coursecatalog','adminmail','newuser');
+        my @toggles = ('coursecatalog','adminmail','helpdesk','newuser');
         my (%checkedon,%checkedoff);
         foreach my $item (@toggles) {
             if ($defaultchecked{$item} eq 'on') { 
@@ -1101,6 +1102,7 @@
         &Apache::lonlocal::texthash (
             coursecatalog => 'Display Course/Community Catalog link?',
             adminmail     => "Display Administrator's E-mail Address?",
+            helpdesk      => 'Display "Contact Helpdesk" link',
             disallowlogin => "Login page requests redirected",
             hostid        => "Server",
             server        => "Redirect to:",
@@ -4663,6 +4665,7 @@
         %curr_loginvia,%loginhash, at currlangs, at newlangs,$addedfile,%title, at offon);
     %title = ( coursecatalog => 'Display course catalog',
                adminmail => 'Display administrator E-mail address',
+               helpdesk  => 'Display "Contact Helpdesk" link',
                newuser => 'Link for visitors to create a user account',
                loginheader => 'Log-in box header');
     @offon = ('off','on');
@@ -4675,7 +4678,7 @@
     }
     ($errors,%colchanges) = &modify_colors($r,$dom,$confname,['login'],
                                            \%domconfig,\%loginhash);
-    my @toggles = ('coursecatalog','adminmail','newuser');
+    my @toggles = ('coursecatalog','adminmail','helpdesk','newuser');
     foreach my $item (@toggles) {
         $loginhash{login}{$item} = $env{'form.'.$item};
     }
@@ -4863,9 +4866,10 @@
     my $putresult = &Apache::lonnet::put_dom('configuration',\%loginhash,
                                              $dom);
     if ($putresult eq 'ok') {
-        my @toggles = ('coursecatalog','adminmail','newuser');
+        my @toggles = ('coursecatalog','adminmail','helpdesk','newuser');
         my %defaultchecked = (
                     'coursecatalog' => 'on',
+                    'helpdesk'      => 'on',
                     'adminmail'     => 'off',
                     'newuser'       => 'off',
         );
Index: loncom/auth/lonlogin.pm
diff -u loncom/auth/lonlogin.pm:1.152 loncom/auth/lonlogin.pm:1.153
--- loncom/auth/lonlogin.pm:1.152	Mon Aug 27 00:52:45 2012
+++ loncom/auth/lonlogin.pm	Fri Jan 11 17:35:10 2013
@@ -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 @@
     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$/, at 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 = (<<ENDSCRIPT);
 
@@ -424,7 +430,8 @@
                         .'</b></span></noscript>';
     my $helpdeskscript;
     my $contactblock = &contactdisplay(\%lt,$servadm,$showadminmail,
-                                       $authdomain,\$helpdeskscript);
+                                       $authdomain,\$helpdeskscript,
+                                       $showhelpdesk,\@possdoms);
 
     my $loginform=(<<LFORM);
 <form name="client" action="" onsubmit="return(send())">
@@ -617,12 +624,22 @@
 }
 
 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'}.':<br />'.




More information about the LON-CAPA-cvs mailing list