--- loncom/interface/createaccount.pm 2010/11/29 15:13:08 1.37.2.3
+++ loncom/interface/createaccount.pm 2010/12/02 22:51:27 1.37.2.6
@@ -3,7 +3,7 @@
# institutional log-in ID (institutional authentication required - localauth
# or kerberos) or an e-mail address.
#
-# $Id: createaccount.pm,v 1.37.2.3 2010/11/29 15:13:08 raeburn Exp $
+# $Id: createaccount.pm,v 1.37.2.6 2010/12/02 22:51:27 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -520,7 +520,7 @@ sub process_email_request {
my $uhome = &Apache::lonnet::homeserver($useremail,$domain);
if ($uhome ne 'no_host') {
$output = &invalid_state('existinguser',$domdesc,
- $contact_name,$contact_email);
+ $contact_name,$contact_email,'',$useremail);
return $output;
} else {
my $captcha = Captcha::reCAPTCHA->new;
@@ -597,9 +597,9 @@ sub send_token {
if ($token !~ /^error/ && $token ne 'no_such_host') {
my $esc_token = &escape($token);
my $showtime = localtime(time);
- my $mailmsg = &mt('A request was submitted on [_1] for creation of a GCI WebCenter account.',$showtime).' '.
+ my $mailmsg = &mt('A request was submitted on [_1] for creation of a GCI WebCenter account.',$showtime)." \n".
&mt('To complete this process please open a web browser and enter the following URL in the address/location box: [_1]',
- &Apache::lonnet::absolute_url().'/adm/createaccount?token='.$esc_token);
+ "\n\n".&Apache::lonnet::absolute_url().'/adm/createaccount?token='.$esc_token);
my $result = &Apache::resetpw::send_mail($domdesc,$email,$mailmsg,$contact_name,
$contact_email);
if ($result eq 'ok') {
@@ -1129,18 +1129,22 @@ sub check_id {
}
sub invalid_state {
- my ($error,$domdesc,$contact_name,$contact_email,$msgtext) = @_;
+ my ($error,$domdesc,$contact_name,$contact_email,$msgtext,$useremail) = @_;
my $msg = '
'.&mt('Account creation unavailable').'
';
if ($error eq 'baduseremail') {
$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.');
+ my $uname = &HTML::Entities::encode($useremail);
+ $msg .= &mt('The e-mail address you provided is already in use as a username in LON-CAPA at this institution.').'
'.&mt('You can either:').''.
+ '- '.&mt('Return to the [_1]log-in page[_2] and enter your password.','','').'
'.
+ '- '.&mt('or, if you do not remember your password, visit the "[_1]Forgot your password?[_2]" page.','','').
+ '
';
} 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.');
} elsif ($error eq 'userformat') {
$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.');
}
@@ -1148,16 +1152,21 @@ sub invalid_state {
if ($msgtext) {
$msg .= '
'.$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;
if ($contact_email ne '') {
my $escuri = &HTML::Entities::encode('/adm/createaccount','&<>"');
- $msg .= '
'.&mt('You may wish to contact the [_1]LON-CAPA helpdesk[_2] for [_3].','','',$domdesc).'
';
+ my $href = '/adm/helpdesk?origurl='.$escuri;
+ if ($error eq 'existinguser') {
+ my $escemail = &HTML::Entities::encode($env{'form.useremail'});
+ $href .= '&useremail='.$escemail.'&useraccount='.$escemail;
+ }
+ $msg .= '
'.&mt('You may wish to contact the [_1]LON-CAPA helpdesk[_2] for [_3].','','',$domdesc).'
';
} else {
$msg .= '
'.&mt('You may wish to send an e-mail to the server administrator: [_1] for [_2].',$Apache::lonnet::perlvar{'AdminEmail'},$domdesc).'
';
}