--- loncom/interface/createaccount.pm 2012/02/13 05:24:22 1.40.2.5.2.5
+++ loncom/interface/createaccount.pm 2010/12/02 22:05:17 1.44
@@ -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.5.2.5 2012/02/13 05:24:22 raeburn Exp $
+# $Id: createaccount.pm,v 1.44 2010/12/02 22:05:17 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -39,7 +39,7 @@ use Apache::lonhtmlcommon;
use Apache::lonlocal;
use Apache::lonauth;
use Apache::resetpw;
-use Captcha::reCAPTCHA;
+use Authen::Captcha;
use DynaLoader; # for Crypt::DES version
use Crypt::DES;
use LONCAPA qw(:DEFAULT :match);
@@ -128,8 +128,7 @@ sub handler {
return OK;
} else {
$start_page =
- &Apache::loncommon::start_page($title,$js,
- {'no_inline_link' => 1,});
+ &Apache::loncommon::start_page($title,$js);
&print_header($r,$start_page,$courseid);
$r->print($output);
&print_footer($r);
@@ -137,8 +136,8 @@ sub handler {
}
}
$start_page =
- &Apache::loncommon::start_page($title,$js,
- {'no_inline_link' => 1,});
+ &Apache::loncommon::start_page($title,$js);
+
my %domconfig =
&Apache::lonnet::get_dom('configuration',['usercreation'],$domain);
my ($cancreate,$statustocreate) = &get_creation_controls($domain,$domconfig{'usercreation'});
@@ -146,7 +145,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 [_1].',$domdesc).'
';
+ &mt('Creation of a new user account using an e-mail address or an institutional log-in ID as username is not permitted at this institution ([_1]).',$domdesc).'
';
$r->print($output);
&print_footer($r);
return OK;
@@ -245,15 +244,6 @@ 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);
@@ -294,7 +284,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');
}
@@ -382,13 +372,6 @@ 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;
}
@@ -399,50 +382,35 @@ 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',
- 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 %lt = &Apache::lonlocal::texthash(
+ unam => 'username',
+ udom => 'domain',
+ uemail => 'E-mail address in LON-CAPA',
+ proc => 'Proceed');
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 = '
'.$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.',' ').
- '
'.$lt{'type'}.'
';
+ $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.').'
'.&mt('Create account with an e-mail address as your username').'
';
+ my $captchaform = &create_captcha();
if ($captchaform) {
- my $submit_text = &mt('Sign-up');
+ my $submit_text = &mt('Request LON-CAPA account');
my $emailform = '';
if (grep(/^login$/,@{$cancreate})) {
- $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.',' ').'
';
+ $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.',' ').'