[LON-CAPA-cvs] cvs: loncom /interface createaccount.pm

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Thu, 10 Jul 2008 00:18:09 -0000


raeburn		Wed Jul  9 20:18:09 2008 EDT

  Modified files:              
    /loncom/interface	createaccount.pm 
  Log:
  - Contact e-mail address should be for domain in whihc user is creating the account, not the default domain of the server hosting the session.
  - Set contact e-mail address to the first address in the comma-separated list from loncommon::build_recipient_list().
  - Added "Account creation unavailable" where username_check() reported failure for uauthenticated SSO users creating LON-CAPA accounts.    
  
  
Index: loncom/interface/createaccount.pm
diff -u loncom/interface/createaccount.pm:1.14 loncom/interface/createaccount.pm:1.15
--- loncom/interface/createaccount.pm:1.14	Wed Jul  9 13:30:59 2008
+++ loncom/interface/createaccount.pm	Wed Jul  9 20:18:05 2008
@@ -3,7 +3,7 @@
 # institutional log-in ID (institutional authentication required - localauth
 #  or kerberos) or an e-mail address.
 #
-# $Id: createaccount.pm,v 1.14 2008/07/09 17:30:59 raeburn Exp $
+# $Id: createaccount.pm,v 1.15 2008/07/10 00:18:05 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -65,7 +65,11 @@
     }
     my $domdesc = &Apache::lonnet::domain($domain,'description');
     my $contact_name = &mt('LON-CAPA helpdesk');
-    my $contact_email =  $r->dir_config('lonSupportEMail');
+    my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'};
+    my $contacts =
+        &Apache::loncommon::build_recipient_list(undef,'helpdeskmail',
+                                                 $domain,$origmail);
+    my ($contact_email) = split(',',$contacts);
     my $lonhost = $r->dir_config('lonHostID');
     my $include = $r->dir_config('lonIncludes');
     my $start_page;
@@ -131,6 +135,7 @@
                                                        $domdesc,$courseid,
                                                        $lonhost,$contact_email);
             if ($checkfail) {
+                $msg .= '<h4>'.&mt('Account creation unavailable');'</h4>';
                 if ($checkfail eq 'username') {
                     $msg .= '<span class="LC_warning">'.
                             &mt('A LON-CAPA account may not be created with the username you use.').'</span>';
@@ -146,7 +151,7 @@
             $msg .= '<h3>'.&mt('Account creation unavailable').'</h3>'.
                     '<span class="LC_warning">'.&mt("Although your username and password were authenticated by your institution's Single Sign On system, you do not currently have a LON-CAPA account in this domain, and you are not permitted to create one.").'</span><br /><br />'.&mt('Please contact the [_1] ([_2]) for assistance.',$contact_name,$contact_email);
         }
-        $r->print('<h4>'.$msg.'</h4>'.$output);
+        $r->print($msg.'<br />'.$output);
         $r->print(&Apache::loncommon::end_page());
         return OK;
     }