';
- }
+ }
} elsif ($type eq 'statustocreate') {
if ((ref($cancreate{'selfcreate'}) eq 'ARRAY') &&
(ref($cancreate{'statustocreate'}) eq 'ARRAY')) {
@@ -11599,7 +11736,7 @@ sub modify_selfcreation {
&mt("However, no institutional affiliations (including 'other') are currently permitted to create accounts.").
'';
}
- } elsif (ref($usertypes) eq 'HASH') {
+ } elsif (keys(%usertypes) > 0) {
if (grep(/^(login|sso)$/,@{$cancreate{'selfcreate'}})) {
$chgtext .= &mt('Creation of a new account for an institutional user is restricted to the following institutional affiliation(s):');
} else {
@@ -11610,12 +11747,12 @@ sub modify_selfcreation {
if ($case eq 'default') {
$chgtext .= '
'.$othertitle.'
';
} else {
- $chgtext .= '
'.$usertypes->{$case}.'
';
+ $chgtext .= '
'.$usertypes{$case}.'
';
}
}
$chgtext .= '';
if (!grep(/^(login|sso)$/,@{$cancreate{'selfcreate'}})) {
- $chgtext .= ' '.
+ $chgtext .= ''.
&mt('However, users authenticated by institutional login/single sign on are not currently permitted to create accounts.').
'';
}
@@ -11627,26 +11764,109 @@ sub modify_selfcreation {
$chgtext .= &mt('Although institutional affiliations permitted to create accounts were changed, self creation of accounts is not currently permitted for any authentication types.');
}
}
+ $chgtext .= ' ';
}
} elsif ($type eq 'selfcreateprocessing') {
my %choices = &Apache::lonlocal::texthash (
automatic => 'Automatic approval',
approval => 'Queued for approval',
+ notinuse => 'Unavailable',
);
if (@statuses > 1) {
- $chgtext .= &mt('Processing of requests to create account with e-mail address as username set as follows:').
- '
';
- foreach my $type (@statuses) {
- if ($type eq 'default') {
- $chgtext .= '
';
+ }
+ } else {
+ if ($cancreate{'emailverified'}{'default'} eq 'other') {
+ if ($cancreate{'emaildomain'}{'default'} eq '') {
+ $chgtext .= &mt('No restriction on e-mail domain for self-created accounts verified by e-mail address, where username is chosen by user.');
+ } else {
+ $chgtext .= &mt('For self-created accounts verified by e-mail address, where username is chosen by user, e-mail domain needs to be: [_1],
+ $cancreate{'selfcreateprocessing'}{'default'});
+ }
+ }
}
} elsif ($type eq 'captcha') {
if ($savecaptcha{$type} eq 'notused') {
@@ -11683,11 +11903,11 @@ sub modify_selfcreation {
}
} elsif ($type eq 'emailusername') {
if (ref($cancreate{'emailusername'}) eq 'HASH') {
- if (ref($types) eq 'ARRAY') {
- foreach my $type (@{$types}) {
+ if (@types) {
+ foreach my $type (@types) {
if (ref($cancreate{'emailusername'}{$type}) eq 'HASH') {
if (keys(%{$cancreate{'emailusername'}{$type}}) > 0) {
- $chgtext .= &mt('When self-creating account with e-mail as username, the following information will be provided by [_1]:',"'$usertypes->{$type}'").
+ $chgtext .= &mt('When self-creating account with e-mail verification, the following information will be provided by [_1]:',"'$usertypes{$type}'").
'
';
foreach my $field (@{$infofields}) {
if ($cancreate{'emailusername'}{$type}{$field}) {
@@ -11696,23 +11916,27 @@ sub modify_selfcreation {
}
$chgtext .= '
';
} else {
- $chgtext .= &mt('When self creating account with e-mail as username, no information besides e-mail address will be provided by [_1].',"'$usertypes->{$type}'").' ';
+ $chgtext .= &mt('When self creating account with e-mail verification, no information besides e-mail address will be provided by [_1].',"'$usertypes{$type}'").' ';
}
} else {
- $chgtext .= &mt('When self creating account with e-mail as username, no information besides e-mail address will be provided by [_1].',"'$usertypes->{$type}'").' ';
+ $chgtext .= &mt('When self creating account with e-mail verification, no information besides e-mail address will be provided by [_1].',"'$usertypes{$type}'").' ';
}
}
}
}
} elsif ($type eq 'notify') {
- $chgtext = &mt('No Domain Coordinators will receive notification of username requests requiring approval.');
+ my $numapprove = 0;
if (ref($changes{'cancreate'}) eq 'ARRAY') {
if ((grep(/^notify$/,@{$changes{'cancreate'}})) && (ref($cancreate{'notify'}) eq 'HASH')) {
if ($cancreate{'notify'}{'approval'}) {
- $chgtext = &mt('Notification of username requests requiring approval will be sent to: ').$cancreate{'notify'}{'approval'};
+ $chgtext .= &mt('Notification of username requests requiring approval will be sent to: ').$cancreate{'notify'}{'approval'};
+ $numapprove ++;
}
}
}
+ unless ($numapprove) {
+ $chgtext .= &mt('No Domain Coordinators will receive notification of username requests requiring approval.');
+ }
}
if ($chgtext) {
$resulttext .= '
'.$chgtext.'
';
@@ -11731,12 +11955,12 @@ sub modify_selfcreation {
$chgtext .= '';
if (@email_rule > 0) {
$resulttext .= '
'.
- &mt('Accounts may not be created by users self-enrolling with e-mail addresses of the following types: ').
+ &mt('Accounts may not be created by users verified by e-mail, for e-mail addresses of the following types: ').
$chgtext.
'
';
} else {
$resulttext .= '
'.
- &mt('There are now no restrictions on e-mail addresses which may be used as a username when self-enrolling.').
+ &mt('There are now no restrictions on e-mail addresses which may be used for verification when self-enrolling.').
'
';
}
}
@@ -11745,9 +11969,9 @@ sub modify_selfcreation {
my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles();
foreach my $type (@{$changes{'selfcreate'}}) {
my $typename = $type;
- if (ref($usertypes) eq 'HASH') {
- if ($usertypes->{$type} ne '') {
- $typename = $usertypes->{$type};
+ if (keys(%usertypes) > 0) {
+ if ($usertypes{$type} ne '') {
+ $typename = $usertypes{$type};
}
}
my @modifiable;
@@ -15248,6 +15472,7 @@ function toggleDisplay(domForm,caller) {
var optionsElement = domForm.coursecredits;
var checkval = 1;
var dispval = 'block';
+ var selfcreateRegExp = /^cancreate_emailverified/;
if (caller == 'emailoptions') {
optionsElement = domForm.cancreate_email;
}
@@ -15258,6 +15483,11 @@ function toggleDisplay(domForm,caller) {
optionsElement = domForm.canclone;
checkval = 'instcode';
}
+ if (selfcreateRegExp.test(caller)) {
+ optionsElement = domForm.elements[caller];
+ checkval = 'other';
+ dispval = 'inline'
+ }
if (optionsElement.length) {
var currval;
for (var i=0; i