version 1.11, 2007/12/05 21:23:14
|
version 1.14, 2007/12/12 19:47:56
|
Line 96 sub modifyuserrole {
|
Line 96 sub modifyuserrole {
|
} |
} |
} elsif ($context eq 'domain') { |
} elsif ($context eq 'domain') { |
$scope = '/'.$env{'request.role.domain'}.'/'; |
$scope = '/'.$env{'request.role.domain'}.'/'; |
} elsif ($context eq 'construction_space') { |
} elsif ($context eq 'author') { |
$scope = '/'.$env{'user.domain'}.'/'.$env{'user.name'}; |
$scope = '/'.$env{'user.domain'}.'/'.$env{'user.name'}; |
} |
} |
if ($context eq 'domain') { |
if ($context eq 'domain') { |
Line 136 sub modifyuserrole {
|
Line 136 sub modifyuserrole {
|
|
|
sub propagate_id_change { |
sub propagate_id_change { |
my ($uname,$udom,$user) = @_; |
my ($uname,$udom,$user) = @_; |
my (@types,@roles,@cdoms); |
my (@types,@roles); |
@types = ('active','future'); |
@types = ('active','future'); |
@roles = ('st'); |
@roles = ('st'); |
my $idresult; |
my $idresult; |
my %roleshash = &Apache::lonnet::get_my_roles($uname, |
my %roleshash = &Apache::lonnet::get_my_roles($uname, |
$udom,'userroles',\@types,\@roles,\@cdoms); |
$udom,'userroles',\@types,\@roles); |
|
my %args = ( |
|
one_time => 1, |
|
); |
foreach my $item (keys(%roleshash)) { |
foreach my $item (keys(%roleshash)) { |
my ($cnum,$cdom,$role) = split(/:/,$item); |
my ($cnum,$cdom,$role) = split(/:/,$item); |
my ($start,$end) = split(/:/,$roleshash{$item}); |
my ($start,$end) = split(/:/,$roleshash{$item}); |
if (&Apache::lonnet::is_course($cdom,$cnum)) { |
if (&Apache::lonnet::is_course($cdom,$cnum)) { |
my %userupdate; |
my $result = &update_classlist($cdom,$cnum,$udom,$uname,$user); |
my $result = &update_classlist($cdom,$cnum,$udom,$uname,\%userupdate); |
my %coursehash = |
|
&Apache::lonnet::coursedescription($cdom.'_'.$cnum,\%args); |
|
my $cdesc = $coursehash{'description'}; |
|
if ($cdesc eq '') { |
|
$cdesc = $cdom.'_'.$cnum; |
|
} |
if ($result eq 'ok') { |
if ($result eq 'ok') { |
$idresult .= "Classlist change: $uname:$udom - class -> $cnum:$cdom\n"; |
$idresult .= &mt('Classlist update for "[_1]" in "[_2]".',$uname.':'.$udom,$cdesc).'<br />'."\n"; |
} else { |
} else { |
$idresult .= "Error - $result -during classlist update for $uname:$udom in $cnum:$cdom\n"; |
$idresult .= &mt('Error: "[_1]" during classlist update for "[_2]" in "[_3]".',$result,$uname.':'.$udom,$cdesc).'<br />'."\n"; |
} |
} |
} |
} |
} |
} |
Line 203 sub domain_roles_select {
|
Line 211 sub domain_roles_select {
|
# domain context |
# domain context |
# |
# |
# Role types |
# Role types |
my @roletypes = ('domain','construction_space','course'); |
my @roletypes = ('domain','author','course'); |
my %lt = &role_type_names(); |
my %lt = &role_type_names(); |
# |
# |
# build up the menu information to be passed to |
# build up the menu information to be passed to |
Line 225 sub domain_roles_select {
|
Line 233 sub domain_roles_select {
|
my @roles; |
my @roles; |
if ($roletype eq 'domain') { |
if ($roletype eq 'domain') { |
@roles = &domain_roles(); |
@roles = &domain_roles(); |
} elsif ($roletype eq 'construction_space') { |
} elsif ($roletype eq 'author') { |
@roles = &construction_space_roles(); |
@roles = &construction_space_roles(); |
} else { |
} else { |
@roles = &course_roles('domain'); |
@roles = &course_roles('domain'); |
Line 246 sub domain_roles_select {
|
Line 254 sub domain_roles_select {
|
} |
} |
my $result = &Apache::loncommon::linked_select_forms |
my $result = &Apache::loncommon::linked_select_forms |
('studentform',(' 'x3).&mt('Role: '),$env{'form.roletype'}, |
('studentform',(' 'x3).&mt('Role: '),$env{'form.roletype'}, |
'roletype','showrole',\%select_menus,['domain','construction_space','course']); |
'roletype','showrole',\%select_menus,['domain','author','course']); |
return $result; |
return $result; |
} |
} |
|
|
Line 651 sub print_upload_manager_footer {
|
Line 659 sub print_upload_manager_footer {
|
my $formname; |
my $formname; |
if ($context eq 'course') { |
if ($context eq 'course') { |
$formname = 'document.studentform'; |
$formname = 'document.studentform'; |
} elsif ($context eq 'construction_space') { |
} elsif ($context eq 'author') { |
$formname = 'document.studentform'; |
$formname = 'document.studentform'; |
} elsif ($context eq 'domain') { |
} elsif ($context eq 'domain') { |
$formname = 'document.studentform'; |
$formname = 'document.studentform'; |
Line 702 sub print_upload_manager_footer {
|
Line 710 sub print_upload_manager_footer {
|
$Str .= '<h3>'.&mt('Settings for assigning roles:').'</h3>'."\n". |
$Str .= '<h3>'.&mt('Settings for assigning roles:').'</h3>'."\n". |
&mt('Pick the action to take on roles for these users:').'<br /><span class="LC_nobreak"><label><input type="radio" name="roleaction" value="norole" checked="checked" /> '.&mt('No role changes').'</label> <label><input type="radio" name="roleaction" value="domain" /> '.&mt('Add a domain role').'</label> <label><input type="radio" name="roleaction" value="course" /> '.&mt('Add a course role').'</label></span>'; |
&mt('Pick the action to take on roles for these users:').'<br /><span class="LC_nobreak"><label><input type="radio" name="roleaction" value="norole" checked="checked" /> '.&mt('No role changes').'</label> <label><input type="radio" name="roleaction" value="domain" /> '.&mt('Add a domain role').'</label> <label><input type="radio" name="roleaction" value="course" /> '.&mt('Add a course role').'</label></span>'; |
} |
} |
if ($context eq 'construction_space') { |
if ($context eq 'author') { |
$Str .= '<h3>'.&mt('Default role')."</h3>\n". |
$Str .= '<h3>'.&mt('Default role')."</h3>\n". |
&mt('Choose the role to assign to users without one specified in the uploaded file'); |
&mt('Choose the role to assign to users without one specified in the uploaded file'); |
} elsif ($context eq 'course') { |
} elsif ($context eq 'course') { |
Line 716 sub print_upload_manager_footer {
|
Line 724 sub print_upload_manager_footer {
|
my ($options,$cb_script,$coursepick) = &default_role_selector($context,'defaultrole',1); |
my ($options,$cb_script,$coursepick) = &default_role_selector($context,'defaultrole',1); |
if ($context eq 'domain') { |
if ($context eq 'domain') { |
$Str .= '<span class="LC_role_level">'.&mt('Domain Level').'</span><br />'.$options.'<br /><br /><span class="LC_role_level">'.&mt('Course Level').'</span><br />'.$cb_script.$coursepick; |
$Str .= '<span class="LC_role_level">'.&mt('Domain Level').'</span><br />'.$options.'<br /><br /><span class="LC_role_level">'.&mt('Course Level').'</span><br />'.$cb_script.$coursepick; |
} elsif ($context eq 'construction_space') { |
} elsif ($context eq 'author') { |
$Str .= $options; |
$Str .= $options; |
} else { |
} else { |
$Str .= '<table><tr><td><span class="LC_nobreak"<b>'.&mt('role').': </b>'. |
$Str .= '<table><tr><td><span class="LC_nobreak"<b>'.&mt('role').': </b>'. |
Line 755 sub forceid_change {
|
Line 763 sub forceid_change {
|
if ($context eq 'domain') { |
if ($context eq 'domain') { |
$output .= '<label><input type="checkbox" name="recurseid"'. |
$output .= '<label><input type="checkbox" name="recurseid"'. |
' value="yes">'. |
' value="yes">'. |
&mt('Update ID/Student Number in courses in which user is an Active or Future student, (if forcing change).'). |
&mt('Update ID/Student Number in courses in which user is Active/Future student,<br />(if forcing change).'). |
'</label></p>'."\n"; |
'</label></p>'."\n"; |
} |
} |
return $output; |
return $output; |
Line 916 sub date_setting_table {
|
Line 924 sub date_setting_table {
|
my $dateDefault; |
my $dateDefault; |
if ($mode eq 'create_enrolldates' || $mode eq 'create_defaultdates') { |
if ($mode eq 'create_enrolldates' || $mode eq 'create_defaultdates') { |
$dateDefault = ' '; |
$dateDefault = ' '; |
} elsif ($mode ne 'construction_space' && $mode ne 'domain') { |
} elsif ($mode ne 'author' && $mode ne 'domain') { |
if (($bulkaction eq 'reenable') || |
if (($bulkaction eq 'reenable') || |
($bulkaction eq 'activate') || |
($bulkaction eq 'activate') || |
($bulkaction eq 'chgdates')) { |
($bulkaction eq 'chgdates')) { |
Line 978 sub default_role_selector {
|
Line 986 sub default_role_selector {
|
my ($context,$checkpriv) = @_; |
my ($context,$checkpriv) = @_; |
my %customroles; |
my %customroles; |
my ($options,$coursepick,$cb_jscript); |
my ($options,$coursepick,$cb_jscript); |
if ($context ne 'construction_space') { |
if ($context ne 'author') { |
%customroles = &my_custom_roles(); |
%customroles = &my_custom_roles(); |
} |
} |
|
|
Line 992 sub default_role_selector {
|
Line 1000 sub default_role_selector {
|
' <option value="">'.&mt('Please select').'</option>'."\n"; |
' <option value="">'.&mt('Please select').'</option>'."\n"; |
if ($context eq 'course') { |
if ($context eq 'course') { |
$options .= &default_course_roles($context,$checkpriv,%customroles); |
$options .= &default_course_roles($context,$checkpriv,%customroles); |
} elsif ($context eq 'construction_space') { |
} elsif ($context eq 'author') { |
my @roles = &construction_space_roles($checkpriv); |
my @roles = &construction_space_roles($checkpriv); |
foreach my $role (@roles) { |
foreach my $role (@roles) { |
my $plrole=&Apache::lonnet::plaintext($role); |
my $plrole=&Apache::lonnet::plaintext($role); |
Line 1121 sub course_roles {
|
Line 1129 sub course_roles {
|
sub curr_role_permissions { |
sub curr_role_permissions { |
my ($context,$setting,$checkpriv) = @_; |
my ($context,$setting,$checkpriv) = @_; |
my @roles; |
my @roles; |
if ($context eq 'construction_space') { |
if ($context eq 'author') { |
@roles = &construction_space_roles($checkpriv); |
@roles = &construction_space_roles($checkpriv); |
} elsif ($context eq 'domain') { |
} elsif ($context eq 'domain') { |
if ($setting eq 'course') { |
if ($setting eq 'course') { |
Line 1162 sub print_userlist {
|
Line 1170 sub print_userlist {
|
($env{'form.Status'}); |
($env{'form.Status'}); |
|
|
if ($env{'form.showrole'} eq '') { |
if ($env{'form.showrole'} eq '') { |
$env{'form.showrole'} = 'Any'; |
if ($context eq 'course') { |
|
$env{'form.showrole'} = 'st'; |
|
} else { |
|
$env{'form.showrole'} = 'Any'; |
|
} |
} |
} |
if (! defined($env{'form.output'}) || |
if (! defined($env{'form.output'}) || |
$env{'form.output'} !~ /^(csv|excel|html)$/ ) { |
$env{'form.output'} !~ /^(csv|excel|html)$/ ) { |
Line 1289 sub print_userlist {
|
Line 1301 sub print_userlist {
|
\%advrolehash,$permission); |
\%advrolehash,$permission); |
} else { |
} else { |
my (%cstr_roles,%dom_roles); |
my (%cstr_roles,%dom_roles); |
if ($context eq 'construction_space') { |
if ($context eq 'author') { |
# List co-authors and assistant co-authors |
# List co-authors and assistant co-authors |
my @possroles = ('ca','aa'); |
my @possroles = ('ca','aa'); |
%cstr_roles = &Apache::lonnet::get_my_roles(undef,undef,undef, |
%cstr_roles = &Apache::lonnet::get_my_roles(undef,undef,undef, |
Line 1305 sub print_userlist {
|
Line 1317 sub print_userlist {
|
\%userinfo,$dom_roles{$key},$permission); |
\%userinfo,$dom_roles{$key},$permission); |
} |
} |
} |
} |
} elsif ($env{'form.roletype'} eq 'construction_space') { |
} elsif ($env{'form.roletype'} eq 'author') { |
my %dom_roles = &Apache::lonnet::get_domain_roles($env{'request.role.domain'},['au']); |
my %dom_roles = &Apache::lonnet::get_domain_roles($env{'request.role.domain'},['au']); |
my %coauthors; |
my %coauthors; |
foreach my $key (keys(%dom_roles)) { |
foreach my $key (keys(%dom_roles)) { |
Line 1384 sub print_userlist {
|
Line 1396 sub print_userlist {
|
} |
} |
} |
} |
if (keys(%userlist) == 0) { |
if (keys(%userlist) == 0) { |
if ($context eq 'construction_space') { |
if ($context eq 'author') { |
$r->print(&mt('There are no co-authors to display.')."\n"); |
$r->print(&mt('There are no co-authors to display.')."\n"); |
} elsif ($context eq 'domain') { |
} elsif ($context eq 'domain') { |
if ($env{'form.roletype'} eq 'domain') { |
if ($env{'form.roletype'} eq 'domain') { |
$r->print(&mt('There are no users with domain roles to display.')."\n"); |
$r->print(&mt('There are no users with domain roles to display.')."\n"); |
} elsif ($env{'form.roletype'} eq 'construction_space') { |
} elsif ($env{'form.roletype'} eq 'author') { |
$r->print(&mt('There are no authors or co-authors to display.')."\n"); |
$r->print(&mt('There are no authors or co-authors to display.')."\n"); |
} elsif ($env{'form.roletype'} eq 'course') { |
} elsif ($env{'form.roletype'} eq 'course') { |
$r->print(&mt('There are no course users to display')."\n"); |
$r->print(&mt('There are no course users to display')."\n"); |
Line 1425 sub gather_userinfo {
|
Line 1437 sub gather_userinfo {
|
foreach my $item (keys(%{$rolehash})) { |
foreach my $item (keys(%{$rolehash})) { |
@{$userlist->{$item}} = (); |
@{$userlist->{$item}} = (); |
my %userdata; |
my %userdata; |
if ($context eq 'construction_space' || $context eq 'course') { |
if ($context eq 'author' || $context eq 'course') { |
($userdata{'username'},$userdata{'domain'},$userdata{'role'}) = |
($userdata{'username'},$userdata{'domain'},$userdata{'role'}) = |
split(/:/,$item); |
split(/:/,$item); |
($userdata{'start'},$userdata{'end'})=split(/:/,$rolehash->{$item}); |
($userdata{'start'},$userdata{'end'})=split(/:/,$rolehash->{$item}); |
Line 1436 sub gather_userinfo {
|
Line 1448 sub gather_userinfo {
|
split(/:/,$item); |
split(/:/,$item); |
($userdata{'end'},$userdata{'start'})=split(/:/,$rolehash->{$item}); |
($userdata{'end'},$userdata{'start'})=split(/:/,$rolehash->{$item}); |
&build_user_record(\%userdata,$userinfo,$indexhash,$item,$userlist); |
&build_user_record(\%userdata,$userinfo,$indexhash,$item,$userlist); |
} elsif ($env{'form.roletype'} eq 'construction_space') { |
} elsif ($env{'form.roletype'} eq 'author') { |
if (ref($rolehash->{$item}) eq 'HASH') { |
if (ref($rolehash->{$item}) eq 'HASH') { |
$userdata{'extent'} = $item; |
$userdata{'extent'} = $item; |
foreach my $key (keys(%{$rolehash->{$item}})) { |
foreach my $key (keys(%{$rolehash->{$item}})) { |
Line 1875 END
|
Line 1887 END
|
); |
); |
if ($context eq 'domain' && $env{'form.roletype'} eq 'course') { |
if ($context eq 'domain' && $env{'form.roletype'} eq 'course') { |
$lt{'extent'} = &mt('Course(s): description, section(s), status'); |
$lt{'extent'} = &mt('Course(s): description, section(s), status'); |
} elsif ($context eq 'construction_space') { |
} elsif ($context eq 'author') { |
$lt{'extent'} = &mt('Author'); |
$lt{'extent'} = &mt('Author'); |
} |
} |
my @cols = ('username','domain','id','fullname'); |
my @cols = ('username','domain','id','fullname'); |
Line 1888 END
|
Line 1900 END
|
if ($env{'form.showrole'} eq 'Any' || $env{'form.showrole'} eq 'cr') { |
if ($env{'form.showrole'} eq 'Any' || $env{'form.showrole'} eq 'cr') { |
push(@cols,'role'); |
push(@cols,'role'); |
} |
} |
if ($context eq 'domain' && ($env{'form.roletype'} eq 'construction_space' || |
if ($context eq 'domain' && ($env{'form.roletype'} eq 'author' || |
$env{'form.roletype'} eq 'course')) { |
$env{'form.roletype'} eq 'course')) { |
push (@cols,'extent'); |
push (@cols,'extent'); |
} |
} |
Line 2065 END
|
Line 2077 END
|
delete($userlist->{$user}); |
delete($userlist->{$user}); |
next; |
next; |
} |
} |
} elsif ($env{'form.roletype'} eq 'construction_space') { |
} elsif ($env{'form.roletype'} eq 'author') { |
($uname,$udom,$role) = split(/:/,$user,-1); |
($uname,$udom,$role) = split(/:/,$user,-1); |
} elsif ($env{'form.roletype'} eq 'course') { |
} elsif ($env{'form.roletype'} eq 'course') { |
($uname,$udom,$role) = split(/:/,$user); |
($uname,$udom,$role) = split(/:/,$user); |
Line 2260 sub print_username_link {
|
Line 2272 sub print_username_link {
|
|
|
sub role_type_names { |
sub role_type_names { |
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
'domain' => 'Domain Roles', |
'domain' => 'Domain Roles', |
'construction_space' => 'Co-Author Roles', |
'author' => 'Co-Author Roles', |
'course' => 'Course Roles', |
'course' => 'Course Roles', |
); |
); |
return %lt; |
return %lt; |
} |
} |
Line 2283 sub select_actions {
|
Line 2295 sub select_actions {
|
<option value="chgdates">'.$lt{'chgdates'}.'</option>'; |
<option value="chgdates">'.$lt{'chgdates'}.'</option>'; |
$choices{'dates'} = 1; |
$choices{'dates'} = 1; |
} else { |
} else { |
if ($statusmode eq 'Active' || $statusmode eq 'Future') { |
|
$options .= ' |
|
<option value="revoke">'.$lt{'revoke'}.'</option>'; |
|
} |
|
if ($statusmode eq 'Future') { |
if ($statusmode eq 'Future') { |
$options .= ' |
$options .= ' |
<option value="activate">'.$lt{'activate'}.'</option>'; |
<option value="activate">'.$lt{'activate'}.'</option>'; |
Line 2296 sub select_actions {
|
Line 2304 sub select_actions {
|
<option value="reenable">'.$lt{'reenable'}.'</option>'; |
<option value="reenable">'.$lt{'reenable'}.'</option>'; |
$choices{'dates'} = 1; |
$choices{'dates'} = 1; |
} |
} |
|
if ($statusmode eq 'Active' || $statusmode eq 'Future') { |
|
$options .= ' |
|
<option value="chgdates">'.$lt{'chgdates'}.'</option> |
|
<option value="revoke">'.$lt{'revoke'}.'</option>'; |
|
$choices{'dates'} = 1; |
|
} |
} |
} |
if ($context eq 'domain') { |
if ($context eq 'domain') { |
$options .= ' |
$options .= ' |
Line 2536 sub results_header_row {
|
Line 2550 sub results_header_row {
|
$description .= &mt('All users in course with [_1] roles',$rolefilter); |
$description .= &mt('All users in course with [_1] roles',$rolefilter); |
} |
} |
} |
} |
} elsif ($context eq 'construction_space') { |
} elsif ($context eq 'author') { |
$description = &mt('Author space for [_1].').' '; |
$description = |
|
&mt('Author space for <span class="LC_cusr_emph">[_1]</span>', |
|
&Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'})).': '; |
if ($statusmode eq 'Expired') { |
if ($statusmode eq 'Expired') { |
$description .= &mt('Co-authors with expired [_1] roles',$showfilter); |
$description .= &mt('Co-authors with expired [_1] roles',$showfilter); |
} elsif ($statusmode eq 'Future') { |
} elsif ($statusmode eq 'Future') { |
Line 2568 sub results_header_row {
|
Line 2584 sub results_header_row {
|
$description .= &mt('All users in domain with [_1] roles',$rolefilter); |
$description .= &mt('All users in domain with [_1] roles',$rolefilter); |
} |
} |
} |
} |
} elsif ($env{'form.roletype'} eq 'construction_space') { |
} elsif ($env{'form.roletype'} eq 'author') { |
if ($statusmode eq 'Expired') { |
if ($statusmode eq 'Expired') { |
$description .= &mt('Co-authors in domain with expired [_1] roles',$showfilter); |
$description .= &mt('Co-authors in domain with expired [_1] roles',$showfilter); |
} elsif ($statusmode eq 'Future') { |
} elsif ($statusmode eq 'Future') { |
Line 2894 sub upfile_drop_add {
|
Line 2910 sub upfile_drop_add {
|
} elsif ($setting eq 'course') { |
} elsif ($setting eq 'course') { |
$defaultrole = $env{'form.courserole'}; |
$defaultrole = $env{'form.courserole'}; |
} |
} |
} elsif ($context eq 'construction_space') { |
} elsif ($context eq 'author') { |
$defaultrole = $env{'form.defaultrole'}; |
$defaultrole = $env{'form.defaultrole'}; |
} |
} |
if ($context eq 'domain' && $setting eq 'course') { |
if ($context eq 'domain' && $setting eq 'course') { |
Line 2917 sub upfile_drop_add {
|
Line 2933 sub upfile_drop_add {
|
####################################### |
####################################### |
if ($context eq 'course') { |
if ($context eq 'course') { |
$r->print('<h3>'.&mt('Enrolling Users')."</h3>\n<p>\n"); |
$r->print('<h3>'.&mt('Enrolling Users')."</h3>\n<p>\n"); |
} elsif ($context eq 'construction_space') { |
} elsif ($context eq 'author') { |
$r->print('<h3>'.&mt('Updating Co-authors')."</h3>\n<p>\n"); |
$r->print('<h3>'.&mt('Updating Co-authors')."</h3>\n<p>\n"); |
} else { |
} else { |
$r->print('<h3>'.&mt('Adding/Modifying Users')."</h3>\n<p>\n"); |
$r->print('<h3>'.&mt('Adding/Modifying Users')."</h3>\n<p>\n"); |
Line 3057 sub upfile_drop_add {
|
Line 3073 sub upfile_drop_add {
|
next if ($alerts{'username'}{$domain}{$username}); |
next if ($alerts{'username'}{$domain}{$username}); |
} |
} |
} |
} |
|
} else { |
|
# FIXME check if user info can be updated. |
} |
} |
if ($id ne '') { |
if ($id ne '') { |
if (!$newuser) { |
if (!$newuser) { |
Line 3109 sub upfile_drop_add {
|
Line 3127 sub upfile_drop_add {
|
$r->print('<br />'. |
$r->print('<br />'. |
&mt('<b>[_1]</b>: Unable to enroll. No password specified.',$username) |
&mt('<b>[_1]</b>: Unable to enroll. No password specified.',$username) |
); |
); |
} elsif ($context eq 'construction_space') { |
} elsif ($context eq 'author') { |
$r->print('<br />'. |
$r->print('<br />'. |
&mt('<b>[_1]</b>: Unable to add co-author. No password specified.',$username) |
&mt('<b>[_1]</b>: Unable to add co-author. No password specified.',$username) |
); |
); |
Line 3135 sub upfile_drop_add {
|
Line 3153 sub upfile_drop_add {
|
&mt('Authentication changed for [_1] existing users.', |
&mt('Authentication changed for [_1] existing users.', |
$counts{'auth'})."</p>\n"); |
$counts{'auth'})."</p>\n"); |
} |
} |
if (keys(%alerts) > 0) { |
$r->print(&print_namespacing_alerts($domain,\%alerts,\%curr_rules)); |
if (ref($alerts{'username'}) eq 'HASH') { |
|
foreach my $dom (sort(keys(%{$alerts{'username'}}))) { |
|
my $count; |
|
if (ref($alerts{'username'}{$dom}) eq 'HASH') { |
|
$count = keys(%{$alerts{'username'}{$dom}}); |
|
} |
|
my $domdesc = &Apache::lonnet::domain($domain,'description'); |
|
if (ref($curr_rules{$dom}) eq 'HASH') { |
|
$r->print(&Apache::loncommon::instrule_disallow_msg( |
|
'username',$domdesc,$count,'upload')); |
|
} |
|
$r->print(&Apache::loncommon::user_rule_formats($dom, |
|
$domdesc,$curr_rules{$dom}{'username'}, |
|
'username')); |
|
} |
|
} |
|
if (ref($alerts{'id'}) eq 'HASH') { |
|
foreach my $dom (sort(keys(%{$alerts{'id'}}))) { |
|
my $count; |
|
if (ref($alerts{'id'}{$dom}) eq 'HASH') { |
|
$count = keys(%{$alerts{'id'}{$dom}}); |
|
} |
|
my $domdesc = &Apache::lonnet::domain($domain,'description'); |
|
if (ref($curr_rules{$dom}) eq 'HASH') { |
|
$r->print(&Apache::loncommon::instrule_disallow_msg( |
|
'id',$domdesc,$count,'upload')); |
|
} |
|
$r->print(&Apache::loncommon::user_rule_formats($dom, |
|
$domdesc,$curr_rules{$dom}{'id'},'id')); |
|
} |
|
} |
|
} |
|
$r->print('<form name="uploadresult" action="/adm/createuser">'); |
$r->print('<form name="uploadresult" action="/adm/createuser">'); |
$r->print(&Apache::lonhtmlcommon::echo_form_input(['phase','prevphase','currstate'])); |
$r->print(&Apache::lonhtmlcommon::echo_form_input(['phase','prevphase','currstate'])); |
$r->print('</form>'); |
$r->print('</form>'); |
Line 3198 sub upfile_drop_add {
|
Line 3184 sub upfile_drop_add {
|
} # end of unless |
} # end of unless |
} |
} |
|
|
|
sub print_namespacing_alerts { |
|
my ($domain,$alerts,$curr_rules) = @_; |
|
my $output; |
|
if (ref($alerts) eq 'HASH') { |
|
if (keys(%{$alerts}) > 0) { |
|
if (ref($alerts->{'username'}) eq 'HASH') { |
|
foreach my $dom (sort(keys(%{$alerts->{'username'}}))) { |
|
my $count; |
|
if (ref($alerts->{'username'}{$dom}) eq 'HASH') { |
|
$count = keys(%{$alerts->{'username'}{$dom}}); |
|
} |
|
my $domdesc = &Apache::lonnet::domain($domain,'description'); |
|
if (ref($curr_rules->{$dom}) eq 'HASH') { |
|
$output .= &Apache::loncommon::instrule_disallow_msg( |
|
'username',$domdesc,$count,'upload'); |
|
} |
|
$output .= &Apache::loncommon::user_rule_formats($dom, |
|
$domdesc,$curr_rules->{$dom}{'username'}, |
|
'username'); |
|
} |
|
} |
|
if (ref($alerts->{'id'}) eq 'HASH') { |
|
foreach my $dom (sort(keys(%{$alerts->{'id'}}))) { |
|
my $count; |
|
if (ref($alerts->{'id'}{$dom}) eq 'HASH') { |
|
$count = keys(%{$alerts->{'id'}{$dom}}); |
|
} |
|
my $domdesc = &Apache::lonnet::domain($domain,'description'); |
|
if (ref($curr_rules->{$dom}) eq 'HASH') { |
|
$output .= &Apache::loncommon::instrule_disallow_msg( |
|
'id',$domdesc,$count,'upload'); |
|
} |
|
$output .= &Apache::loncommon::user_rule_formats($dom, |
|
$domdesc,$curr_rules->{$dom}{'id'},'id'); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
sub user_change_result { |
sub user_change_result { |
my ($r,$userresult,$authresult,$roleresult,$counts,$flushc,$username, |
my ($r,$userresult,$authresult,$roleresult,$counts,$flushc,$username, |
$userchg) = @_; |
$userchg) = @_; |
Line 3300 sub update_user_list {
|
Line 3326 sub update_user_list {
|
} else { |
} else { |
$scope = $scopestem.'/'.$sec; |
$scope = $scopestem.'/'.$sec; |
} |
} |
} elsif ($context eq 'construction_space') { |
} elsif ($context eq 'author') { |
($uname,$udom,$role) = split(/\:/,$item,-1); |
($uname,$udom,$role) = split(/\:/,$item,-1); |
$scope = '/'.$env{'user.domain'}.'/'.$env{'user.name'}; |
$scope = '/'.$env{'user.domain'}.'/'.$env{'user.name'}; |
} elsif ($context eq 'domain') { |
} elsif ($context eq 'domain') { |
if ($setting eq 'domain') { |
if ($setting eq 'domain') { |
($role,$uname,$udom) = split(/\:/,$item,-1); |
($role,$uname,$udom) = split(/\:/,$item,-1); |
$scope = '/'.$env{'request.role.domain'}.'/'; |
$scope = '/'.$env{'request.role.domain'}.'/'; |
} elsif ($setting eq 'construction_space') { |
} elsif ($setting eq 'author') { |
($uname,$udom,$role,$scope) = split(/\:/,$item); |
($uname,$udom,$role,$scope) = split(/\:/,$item); |
} elsif ($setting eq 'course') { |
} elsif ($setting eq 'course') { |
($uname,$udom,$role,$cid,$sec,$type,$locktype) = |
($uname,$udom,$role,$cid,$sec,$type,$locktype) = |