version 1.99, 2009/08/02 07:21:18
|
version 1.100, 2009/08/06 15:14:08
|
Line 1518 sub print_usercreation {
|
Line 1518 sub print_usercreation {
|
$rowcount ++; |
$rowcount ++; |
} |
} |
} elsif ($position eq 'middle') { |
} elsif ($position eq 'middle') { |
my @creators = ('author','course','selfcreate'); |
my @creators = ('author','course','requestcrs','selfcreate'); |
my ($rules,$ruleorder) = |
my ($rules,$ruleorder) = |
&Apache::lonnet::inst_userrules($dom,'username'); |
&Apache::lonnet::inst_userrules($dom,'username'); |
my %lt = &usercreation_types(); |
my %lt = &usercreation_types(); |
Line 1721 sub usercreation_types {
|
Line 1721 sub usercreation_types {
|
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
author => 'When adding a co-author', |
author => 'When adding a co-author', |
course => 'When adding a user to a course', |
course => 'When adding a user to a course', |
|
requestcrs => 'When requesting a course', |
selfcreate => 'User creates own account', |
selfcreate => 'User creates own account', |
any => 'Any', |
any => 'Any', |
official => 'Institutional only ', |
official => 'Institutional only ', |
Line 4028 sub modify_usercreation {
|
Line 4029 sub modify_usercreation {
|
my @username_rule = &Apache::loncommon::get_env_multiple('form.username_rule'); |
my @username_rule = &Apache::loncommon::get_env_multiple('form.username_rule'); |
my @id_rule = &Apache::loncommon::get_env_multiple('form.id_rule'); |
my @id_rule = &Apache::loncommon::get_env_multiple('form.id_rule'); |
my @email_rule = &Apache::loncommon::get_env_multiple('form.email_rule'); |
my @email_rule = &Apache::loncommon::get_env_multiple('form.email_rule'); |
my @contexts = ('author','course','selfcreate'); |
my @contexts = ('author','course','requestcrs','selfcreate'); |
foreach my $item(@contexts) { |
foreach my $item(@contexts) { |
if ($item eq 'selfcreate') { |
if ($item eq 'selfcreate') { |
@{$cancreate{$item}} = &Apache::loncommon::get_env_multiple('form.can_createuser_'.$item); |
@{$cancreate{$item}} = &Apache::loncommon::get_env_multiple('form.can_createuser_'.$item); |
Line 4232 sub modify_usercreation {
|
Line 4233 sub modify_usercreation {
|
if (ref($changes{'cancreate'}) eq 'ARRAY') { |
if (ref($changes{'cancreate'}) eq 'ARRAY') { |
my %lt = &usercreation_types(); |
my %lt = &usercreation_types(); |
foreach my $type (@{$changes{'cancreate'}}) { |
foreach my $type (@{$changes{'cancreate'}}) { |
my $chgtext = $lt{$type}.', '; |
my $chgtext; |
|
unless ($type eq 'statustocreate') { |
|
$chgtext = $lt{$type}.', '; |
|
} |
if ($type eq 'selfcreate') { |
if ($type eq 'selfcreate') { |
if (@{$cancreate{$type}} == 0) { |
if (@{$cancreate{$type}} == 0) { |
$chgtext .= &mt('creation of a new user account is not permitted.'); |
$chgtext .= &mt('creation of a new user account is not permitted.'); |
} else { |
} else { |
$chgtext .= &mt('creation of a new account is permitted for:<ul>'); |
$chgtext .= &mt('creation of a new account is permitted for:').'<ul>'; |
foreach my $case (@{$cancreate{$type}}) { |
foreach my $case (@{$cancreate{$type}}) { |
$chgtext .= '<li>'.$selfcreatetypes{$case}.'</li>'; |
$chgtext .= '<li>'.$selfcreatetypes{$case}.'</li>'; |
} |
} |
$chgtext .= '</ul>'; |
$chgtext .= '</ul>'; |
|
if (ref($cancreate{$type}) eq 'ARRAY') { |
|
if (grep(/^(login|sso)$/,@{$cancreate{$type}})) { |
|
if (ref($cancreate{'statustocreate'}) eq 'ARRAY') { |
|
if (@{$cancreate{'statustocreate'}} == 0) { |
|
$chgtext .= '<br /><span class="LC_warning">'.&mt("However, no institutional affiliations (including 'other') are currently permitted to create accounts.").'</span>'; |
|
} |
|
} |
|
} |
|
} |
} |
} |
} elsif ($type eq 'statustocreate') { |
} elsif ($type eq 'statustocreate') { |
if ((ref($cancreate{'selfcreate'}) eq 'ARRAY') && |
if ((ref($cancreate{'selfcreate'}) eq 'ARRAY') && |
(ref($cancreate{'statustocreate'}) eq 'ARRAY')) { |
(ref($cancreate{'statustocreate'}) eq 'ARRAY')) { |
if (@{$cancreate{'selfcreate'}} > 0) { |
if (@{$cancreate{'selfcreate'}} > 0) { |
if (@{$cancreate{'statustocreate'}} == 0) { |
if (@{$cancreate{'statustocreate'}} == 0) { |
|
|
|
$chgtext .= &mt("Institutional affiliations permitted to create accounts set to 'None'."); |
if (!grep(/^email$/,@{$cancreate{'selfcreate'}})) { |
if (!grep(/^email$/,@{$cancreate{'selfcreate'}})) { |
$chgtext .= &mt("However, no institutional affiliations (including 'other') are currently permitted to create accounts."); |
$chgtext .= '<br /><span class="LC_warning">'.&mt("However, no institutional affiliations (including 'other') are currently permitted to create accounts.").'</span>'; |
} |
} |
} elsif (ref($usertypes) eq 'HASH') { |
} elsif (ref($usertypes) eq 'HASH') { |
if (grep(/^(login|sso)$/,@{$cancreate{'selfcreate'}})) { |
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):').'<ul>'; |
$chgtext .= &mt('Creation of a new account for an institutional user is restricted to the following institutional affiliation(s):'); |
foreach my $case (@{$cancreate{$type}}) { |
} else { |
if ($case eq 'default') { |
$chgtext .= &mt('Institutional affiliations permitted to create accounts with institutional authentication were set as follows:'); |
$chgtext .= '<li>'.$othertitle.'</li>'; |
} |
} else { |
$chgtext .= '<ul>'; |
$chgtext .= '<li>'.$usertypes->{$case}.'</li>'; |
foreach my $case (@{$cancreate{$type}}) { |
} |
if ($case eq 'default') { |
|
$chgtext .= '<li>'.$othertitle.'</li>'; |
|
} else { |
|
$chgtext .= '<li>'.$usertypes->{$case}.'</li>'; |
} |
} |
$chgtext .= '</ul>'; |
|
} |
} |
|
$chgtext .= '</ul>'; |
|
if (!grep(/^(login|sso)$/,@{$cancreate{'selfcreate'}})) { |
|
$chgtext .= '<br /><span class="LC_warning">'.&mt('However, users authenticated by institutional login/single sign on are not currently permitted to create accounts.').'</span>'; |
|
} |
|
} |
|
} else { |
|
if (@{$cancreate{$type}} == 0) { |
|
$chgtext .= &mt("Institutional affiliations permitted to create accounts were set to 'none'."); |
|
} else { |
|
$chgtext .= &mt('Although institutional affiliations permitted to create accounts were changed, self creation of accounts is not currently permitted for any authentication types.'); |
} |
} |
} |
} |
} |
} |