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

raeburn raeburn@source.lon-capa.org
Fri, 24 Dec 2010 20:36:11 -0000


raeburn		Fri Dec 24 20:36:11 2010 EDT

  Modified files:              (Branch: version_2_10_X)
    /loncom/interface	createaccount.pm 
  Log:
  - Backport 1.43, 1.44, 1.45.
  
  
Index: loncom/interface/createaccount.pm
diff -u loncom/interface/createaccount.pm:1.40.2.2 loncom/interface/createaccount.pm:1.40.2.3
--- loncom/interface/createaccount.pm:1.40.2.2	Sun Aug 22 20:06:36 2010
+++ loncom/interface/createaccount.pm	Fri Dec 24 20:36:11 2010
@@ -3,7 +3,7 @@
 # institutional log-in ID (institutional authentication required - localauth
 #  or kerberos) or an e-mail address.
 #
-# $Id: createaccount.pm,v 1.40.2.2 2010/08/22 20:06:36 raeburn Exp $
+# $Id: createaccount.pm,v 1.40.2.3 2010/12/24 20:36:11 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -285,7 +285,7 @@
     }
     my $last_crumb;
     if ($desc ne '') {
-        $last_crumb = &mt('Self-enroll in [_1]','<span class="LC_cusr_emph">'.$desc.'</span>');
+        $last_crumb = &mt('Self-enroll in [_1]',"<span class='LC_cusr_emph'>$desc</span>");
     } else {
         $last_crumb = &mt('Self-enroll');
     }
@@ -1137,32 +1137,38 @@
     my ($error,$domdesc,$contact_name,$contact_email,$msgtext) = @_;
     my $msg = '<h3>'.&mt('Account creation unavailable').'</h3><span class="LC_error">';
     if ($error eq 'baduseremail') {
-        $msg = &mt('The e-mail address you provided does not appear to be a valid address.');
+        $msg .= &mt('The e-mail address you provided does not appear to be a valid address.');
     } elsif ($error eq 'existinguser') {
-        $msg = &mt('The e-mail address you provided is already in use as a username in LON-CAPA at this institution.');
+        $msg .= &mt('The e-mail address you provided is already in use as a username in LON-CAPA at this institution.');
     } elsif ($error eq 'userrules') {
-        $msg = &mt('Username rules at this institution do not allow the e-mail address you provided to be used as a username.');
+        $msg .= &mt('Username rules at this institution do not allow the e-mail address you provided to be used as a username.');
     } elsif ($error eq 'userformat') {
-        $msg = &mt('The e-mail address you provided may not be used as a username at this LON-CAPA institution.');
+        $msg .= &mt('The e-mail address you provided may not be used as a username at this LON-CAPA institution.');
     } elsif ($error eq 'captcha') {
-        $msg = &mt('Validation of the code your entered failed.');
+        $msg .= &mt('Validation of the code you entered failed.');
     } elsif ($error eq 'noemails') {
-        $msg = &mt('Creation of a new user account using an e-mail address as username is not permitted at this LON-CAPA institution.');
+        $msg .= &mt('Creation of a new user account using an e-mail address as username is not permitted at this LON-CAPA institution.');
     }
     $msg .= '</span>';
     if ($msgtext) {
         $msg .= '<br />'.$msgtext;
     }
-    $msg .= &linkto_email_help($contact_email,$domdesc);
+    $msg .= &linkto_email_help($contact_email,$domdesc,$error);
     return $msg;
 }
 
 sub linkto_email_help {
-    my ($contact_email,$domdesc) = @_;
+    my ($contact_email,$domdesc,$error) = @_;
     my $msg;
+    my $href = '/adm/helpdesk';
     if ($contact_email ne '') {
         my $escuri = &HTML::Entities::encode('/adm/createaccount','&<>"');
-        $msg .= '<br />'.&mt('You may wish to contact the [_1]LON-CAPA helpdesk[_2] for [_3].','<a href="/adm/helpdesk?origurl='.$escuri.'">','</a>',$domdesc).'<br />';
+        $href .= '?origurl='.$escuri;
+        if ($error eq 'existinguser') {
+            my $escemail = &HTML::Entities::encode($env{'form.useremail'});
+            $href .= '&useremail='.$escemail.'&useraccount='.$escemail;
+        }
+        $msg .= '<br />'.&mt('You may wish to contact the [_1]LON-CAPA helpdesk[_2] for [_3].','<a href="'.$href.'">','</a>',$domdesc).'<br />';
     } else {
         $msg .= '<br />'.&mt('You may wish to send an e-mail to the server administrator: [_1] for [_2].',$Apache::lonnet::perlvar{'AdminEmail'},$domdesc).'<br />';
     }