--- loncom/interface/createaccount.pm 2009/12/06 23:48:34 1.37.2.1
+++ loncom/interface/createaccount.pm 2010/12/02 02:15:11 1.37.2.5
@@ -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.1 2009/12/06 23:48:34 raeburn Exp $
+# $Id: createaccount.pm,v 1.37.2.5 2010/12/02 02:15:11 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -374,6 +374,13 @@ function validate_email() {
if (validmail(field) == false) {
alert("$lt{'email'}: "+field.value+" $lt{'notv'}.");
return false;
+ } else {
+ var emailaddr = field.value;
+ var lcemail = emailaddr.toLowerCase();
+ if (emailaddr != lcemail) {
+ field.value = lcemail;
+ alert("WebCenter usernames are all lower case.\\nAccordingly your username will be "+lcemail+" once activated.");
+ }
}
return true;
}
@@ -420,7 +427,8 @@ sub print_username_form {
&Apache::lonhtmlcommon::row_closure(1).
&Apache::lonhtmlcommon::row_title(&mt('Validation'),
'LC_pick_box_title')."\n".
- $captchaform."\n".'
';
+ $captchaform."\n".
+ &mt('If either word is hard to read, [_1] will replace them.','
';
if ($courseid ne '') {
$output .= ''."\n";
}
@@ -497,7 +505,7 @@ sub login_box {
sub process_email_request {
my ($useremail,$domain,$domdesc,$contact_name,$contact_email,$cancreate,
$server,$settings,$courseid) = @_;
- $useremail = $env{'form.useremail'};
+ $useremail = lc($env{'form.useremail'});
my $output;
if (ref($cancreate) eq 'ARRAY') {
if (!grep(/^email$/,@{$cancreate})) {
@@ -512,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;
@@ -589,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') {
@@ -1121,20 +1129,24 @@ 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 = '