--- loncom/interface/createaccount.pm 2009/09/23 02:05:38 1.36.10.1
+++ loncom/interface/createaccount.pm 2012/02/13 05:24:22 1.40.2.5.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.36.10.1 2009/09/23 02:05:38 gci Exp $
+# $Id: createaccount.pm,v 1.40.2.5.2.5 2012/02/13 05:24:22 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -139,7 +139,6 @@ sub handler {
$start_page =
&Apache::loncommon::start_page($title,$js,
{'no_inline_link' => 1,});
-
my %domconfig =
&Apache::lonnet::get_dom('configuration',['usercreation'],$domain);
my ($cancreate,$statustocreate) = &get_creation_controls($domain,$domconfig{'usercreation'});
@@ -147,7 +146,7 @@ sub handler {
&print_header($r,$start_page,$courseid);
my $output = '
'.&mt('Account creation unavailable').'
'.
''.
- &mt('Creation of a new user account using an e-mail address or an institutional log-in ID as username is not permitted for the GCI WebCenter.').'
';
+ &mt('Creation of a new user account using an e-mail address or an institutional log-in ID as username is not permitted for [_1].',$domdesc).'
';
$r->print($output);
&print_footer($r);
return OK;
@@ -246,6 +245,15 @@ sub handler {
return OK;
}
+sub get_custom_name {
+ my ($domain) = @_;
+ if ($domain eq 'relate') {
+ return 'Mechanics Online';
+ } else {
+ return lc($domain);
+ }
+}
+
sub print_header {
my ($r,$start_page,$courseid) = @_;
$r->print($start_page);
@@ -278,7 +286,7 @@ sub selfenroll_crumbs {
my ($r,$courseid,$desc) = @_;
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"javascript:ToCatalog('backupcrumbs','')",
- text=>"Course Catalog"});
+ text=>"Course/Community Catalog"});
if ($env{'form.coursenum'} ne '') {
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"javascript:ToCatalog('backupcrumbs','details')",
@@ -286,7 +294,7 @@ sub selfenroll_crumbs {
}
my $last_crumb;
if ($desc ne '') {
- $last_crumb = &mt('Self-enroll in [_1]',''.$desc.'');
+ $last_crumb = &mt('Self-enroll in [_1]',"$desc");
} else {
$last_crumb = &mt('Self-enroll');
}
@@ -374,6 +382,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("Mechanics Online usernames are all lower case.\\nAccordingly your username will be "+lcemail+" once activated.");
+ }
}
return true;
}
@@ -384,35 +399,50 @@ ENDSCRIPT
sub print_username_form {
my ($domain,$domdesc,$cancreate,$now,$lonhost,$courseid) = @_;
- my %lt = &Apache::lonlocal::texthash(
- unam => 'username',
- udom => 'domain',
- uemail => 'E-mail address in LON-CAPA',
- proc => 'Proceed');
+ my %lt = &Apache::lonlocal::texthash (
+ unam => 'username',
+ udom => 'domain',
+ uemail => 'E-mail address in LON-CAPA',
+ proc => 'Proceed',
+ crea => 'Create account with a username provided by this institution',
+ crlc => 'Create LON-CAPA account',
+ type => 'Type in your log-in ID and password to find out.',
+ sign => 'You are about to sign-up for the Mechanics Online course.',
+ plse => 'Please enter a valid e-mail address below.',
+ inst => 'Instructions on how to activate your account will be sent to the e-mail address you provide.',
+ aftr => 'After completing the activation process you will have access to a "self test" that will help you assess your readiness for the course.',
+ thes => 'The same account will be used for access to the Mechanics Online course, once it becomes available on March 1, 2012',
+ );
my $output;
if (ref($cancreate) eq 'ARRAY') {
if (grep(/^login$/,@{$cancreate})) {
my %domdefaults = &Apache::lonnet::get_domain_defaults($domain);
if ((($domdefaults{'auth_def'} =~/^krb/) && ($domdefaults{'auth_arg_def'} ne '')) || ($domdefaults{'auth_def'} eq 'localauth')) {
- $output = '
'.&mt('Create account with a username provided by this institution').'
';
- my $submit_text = &mt('Create LON-CAPA account');
- $output .= &mt('If you already have a log-in ID at this institution,[_1] you may be able to use it for LON-CAPA.',' ').'
'.&mt('Type in your log-in ID and password to find out.').'
';
+ $output = '
'.$lt{'crea'}.'
';
+ my $submit_text = $lt{'crlc'};
+ $output .= &mt('If you already have a log-in ID at this institution,[_1] you may be able to use it for LON-CAPA.',' ').
+ '
';
}
}
if (grep(/^email$/,@{$cancreate})) {
- $output .= '
'.&mt('Create account with an e-mail address as your username').'
';
+ $output .= '
'.&mt('Create account with an e-mail address as your username').'
'.
+ $lt{'sign'}.' '.
+ $lt{'plse'}.' '.
+ $lt{'inst'}.' '.
+ $lt{'aftr'}.' '.
+ $lt{'thes'}.' ';
my $captchaform = &create_recaptcha();
if ($captchaform) {
- my $submit_text = &mt('Request LON-CAPA account');
+ my $submit_text = &mt('Sign-up');
my $emailform = '';
if (grep(/^login$/,@{$cancreate})) {
- $output .= &mt('Provide your e-mail address to request a LON-CAPA account,[_1] if you do not have a log-in ID at your institution.',' ').'
';
+ $output .= &mt('Provide your e-mail address to sign up for a Mechanics Online account [_1]if you do not have a log-in ID at your institution.',' ').'