version 1.108, 2006/06/22 13:27:13
|
version 1.110, 2006/06/22 15:42:38
|
Line 539 sub update_access {
|
Line 539 sub update_access {
|
} |
} |
my $current_permissions = &Apache::lonnet::get_portfile_permissions($udom, |
my $current_permissions = &Apache::lonnet::get_portfile_permissions($udom, |
$uname); |
$uname); |
my %access_controls = &Apache::lonnet::get_access_controls( |
my %access_controls = |
$current_permissions,$group,$file_name); |
&Apache::lonnet::get_access_controls($current_permissions, |
|
$group,$file_name); |
if ($totalprocessed) { |
if ($totalprocessed) { |
if ($outcome eq 'ok') { |
if ($outcome eq 'ok') { |
my $updated_controls = $access_controls{$file_name}; |
my $updated_controls = $access_controls{$file_name}; |
my ($showstart,$showend); |
my ($showstart,$showend); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_header_row()); |
$r->print('<th>'.&mt('Type of change').'</th><th>'. |
$r->print('<th>'.&mt('Type of change').'</th><th>'. |
&mt('Access control').'</th><th>'.&mt('Dates available'). |
&mt('Access control').'</th><th>'.&mt('Dates available'). |
'</th><th>'.&mt('Additional information').'</th>'); |
'</th><th>'.&mt('Additional information').'</th>'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
foreach my $chg (sort(keys(%processing))) { |
foreach my $chg (sort(keys(%processing))) { |
if (@{$processing{$chg}} > 0) { |
if (@{$processing{$chg}} > 0) { |
if ($chg eq 'delete') { |
if ($chg eq 'delete') { |
Line 573 sub update_access {
|
Line 574 sub update_access {
|
if ($chg eq 'activate') { |
if ($chg eq 'activate') { |
$newkey =~ s/^(\d+)/$$translation{$1}/; |
$newkey =~ s/^(\d+)/$$translation{$1}/; |
} |
} |
my %content = &Apache::lonnet::parse_access_controls( |
my $content = $$updated_controls{$newkey}; |
$$updated_controls{$newkey}); |
|
if ($chg eq 'delete') { |
if ($chg eq 'delete') { |
$showstart = &mt('Deleted'); |
$showstart = &mt('Deleted'); |
$showend = $showstart; |
$showend = $showstart; |
Line 589 sub update_access {
|
Line 589 sub update_access {
|
$r->print('<td>'.&mt($scope)); |
$r->print('<td>'.&mt($scope)); |
if (($scope eq 'course') || ($scope eq 'group')) { |
if (($scope eq 'course') || ($scope eq 'group')) { |
if ($chg ne 'delete') { |
if ($chg ne 'delete') { |
my $cid = $content{'domain'}.'_'.$content{'number'}; |
my $cid = $content->{'domain'}.'_'.$content->{'number'}; |
my %course_description = &Apache::lonnet::coursedescription($cid); |
my %course_description = &Apache::lonnet::coursedescription($cid); |
$r->print('<br />('.$course_description{'description'}.')'); |
$r->print('<br />('.$course_description{'description'}.')'); |
} |
} |
Line 598 sub update_access {
|
Line 598 sub update_access {
|
'<br />'.&mt('End: ').$showend.'</td><td>'); |
'<br />'.&mt('End: ').$showend.'</td><td>'); |
if ($chg ne 'delete') { |
if ($chg ne 'delete') { |
if ($scope eq 'guest') { |
if ($scope eq 'guest') { |
$r->print(&mt('Password').': '.$content{'password'}); |
$r->print(&mt('Password').': '.$content->{'password'}); |
} elsif ($scope eq 'course' || $scope eq 'group') { |
} elsif ($scope eq 'course' || $scope eq 'group') { |
$r->print('<table border="0"><tr bgcol = "'. |
$r->print('<table border="0"><tr bgcol = "'. |
$tablecolor.'">'); |
$tablecolor.'">'); |
Line 611 sub update_access {
|
Line 611 sub update_access {
|
$r->print('<th>'.&mt('Teams').'</th>'); |
$r->print('<th>'.&mt('Teams').'</th>'); |
} |
} |
$r->print('</tr>'); |
$r->print('</tr>'); |
foreach my $id (sort(keys(%{$content{'roles'}}))) { |
foreach my $id (sort(keys(%{$content->{'roles'}}))) { |
$r->print('<tr>'); |
$r->print('<tr>'); |
foreach my $item ('role','access','section','group') { |
foreach my $item ('role','access','section','group') { |
$r->print('<td>'); |
$r->print('<td>'); |
Line 619 sub update_access {
|
Line 619 sub update_access {
|
my $ucscope = $scope; |
my $ucscope = $scope; |
$ucscope =~ s/^(\w)/uc($1)/; |
$ucscope =~ s/^(\w)/uc($1)/; |
my $role_output; |
my $role_output; |
foreach my $role (@{$content{'roles'}{$id}{$item}}) { |
foreach my $role (@{$content->{'roles'}{$id}{$item}}) { |
if ($role eq 'all') { |
if ($role eq 'all') { |
$role_output .= $role.','; |
$role_output .= $role.','; |
} elsif ($role =~ /^cr/) { |
} elsif ($role =~ /^cr/) { |
Line 631 sub update_access {
|
Line 631 sub update_access {
|
$role_output =~ s/,$//; |
$role_output =~ s/,$//; |
$r->print($role_output); |
$r->print($role_output); |
} else { |
} else { |
$r->print(join(',',@{$content{'roles'}{$id}{$item}})); |
$r->print(join(',',@{$content->{'roles'}{$id}{$item}})); |
} |
} |
$r->print('</td>'); |
$r->print('</td>'); |
} |
} |
Line 639 sub update_access {
|
Line 639 sub update_access {
|
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_data_table()); |
} elsif ($scope eq 'domains') { |
} elsif ($scope eq 'domains') { |
$r->print(&mt('Domains: ').join(',',@{$content{'dom'}})); |
$r->print(&mt('Domains: ').join(',',@{$content->{'dom'}})); |
} elsif ($scope eq 'users') { |
} elsif ($scope eq 'users') { |
my $curr_user_list = &sort_users($content{'users'}); |
my $curr_user_list = &sort_users($content->{'users'}); |
$r->print(&mt('Users: ').$curr_user_list); |
$r->print(&mt('Users: ').$curr_user_list); |
} else { |
} else { |
$r->print(' '); |
$r->print(' '); |
Line 701 sub update_access {
|
Line 701 sub update_access {
|
|
|
sub build_access_record { |
sub build_access_record { |
my ($num,$scope,$start,$end,$chg) = @_; |
my ($num,$scope,$start,$end,$chg) = @_; |
my $record = '<scope type="'.$scope.'"><start>'.$start.'</start><end>'. |
my $record = { |
$end.'</end>'; |
type => $scope, |
if ($scope eq 'guest') { |
time => { |
$record .= '<password>'.$env{'form.password'}.'</password>'; |
start => $start, |
|
end => $end |
|
}, |
|
}; |
|
|
|
if ($scope eq 'guest') { |
|
$record->{'password'} = $env{'form.password'}; |
} elsif (($scope eq 'course') || ($scope eq 'group')) { |
} elsif (($scope eq 'course') || ($scope eq 'group')) { |
$record .= '<domain>'.$env{'form.crsdom_'.$num}.'</domain><number>'. |
$record->{'domain'} = $env{'form.crsdom_'.$num}; |
$env{'form.crsnum_'.$num}.'</number>'; |
$record->{'number'} = $env{'form.crsnum_'.$num}; |
my @role_ids; |
my @role_ids; |
my @delete_role_ids; |
my @delete_role_ids = |
if (exists($env{'form.delete_role_'.$num})) { |
&Apache::loncommon::get_env_multiple('form.delete_role_'.$num); |
@delete_role_ids = &Apache::loncommon::get_env_multiple('form.delete_role_'.$num); |
my @preserves = |
} |
&Apache::loncommon::get_env_multiple('form.preserve_role_'.$num); |
if (exists($env{'form.preserve_role_'.$num})) { |
if (@delete_role_ids) { |
my @preserves = &Apache::loncommon::get_env_multiple('form.preserve_role_'.$num); |
foreach my $id (@preserves) { |
if (@delete_role_ids > 0) { |
if (grep {$_ = $id} (@delete_role_ids)) { |
foreach my $id (@preserves) { |
next; |
if (grep/^\Q$id\E$/,@delete_role_ids) { |
} |
next; |
push(@role_ids,$id); |
} |
} |
push(@role_ids,$id); |
} else { |
} |
push(@role_ids,@preserves); |
} else { |
} |
push(@role_ids,@preserves); |
|
} |
my $next_id = $env{'form.add_role_'.$num}; |
} |
if ($next_id) { |
my $next_id = ''; |
push(@role_ids,$next_id); |
if (exists($env{'form.add_role_'.$num})) { |
} |
$next_id = $env{'form.add_role_'.$num}; |
|
if ($next_id) { |
|
push(@role_ids,$next_id); |
|
} |
|
} |
|
foreach my $id (@role_ids) { |
foreach my $id (@role_ids) { |
my (@roles,@accesses,@sections,@groups); |
my (@roles,@accesses,@sections,@groups); |
if (($id == $next_id) && ($chg eq 'update')) { |
if (($id == $next_id) && ($chg eq 'update')) { |
@roles = split(/,/,$env{'form.role_'.$num.'_'.$next_id}); |
@roles = split(/,/,$env{'form.role_'.$num.'_'.$next_id}); |
@accesses = split(/,/,$env{'form.access_'.$num.'_'.$next_id}); |
@accesses = split(/,/,$env{'form.access_'.$num.'_'.$next_id}); |
@sections = split(/,/,$env{'form.section_'.$num.'_'.$next_id}); |
@sections = split(/,/,$env{'form.section_'.$num.'_'.$next_id}); |
@groups = split(/,/,$env{'form.group_'.$num.'_'.$next_id}); |
@groups = split(/,/,$env{'form.group_'.$num.'_'.$next_id}); |
} else { |
} else { |
@roles = &Apache::loncommon::get_env_multiple('form.role_'.$num.'_'.$id); |
@roles = &Apache::loncommon::get_env_multiple('form.role_'.$num.'_'.$id); |
@accesses = &Apache::loncommon::get_env_multiple('form.access_'.$num.'_'.$id); |
@accesses = &Apache::loncommon::get_env_multiple('form.access_'.$num.'_'.$id); |
@sections = &Apache::loncommon::get_env_multiple('form.section_'.$num.'_'.$id); |
@sections = &Apache::loncommon::get_env_multiple('form.section_'.$num.'_'.$id); |
@groups = &Apache::loncommon::get_env_multiple('form.group_'.$num.'_'.$id); |
@groups = &Apache::loncommon::get_env_multiple('form.group_'.$num.'_'.$id); |
} |
} |
$record .= '<roles id="'.$id.'">'; |
$record->{'roles'}{$id}{'role'} = \@roles; |
foreach my $role (@roles) { |
$record->{'roles'}{$id}{'access'} = \@accesses; |
$record .= '<role>'.$role.'</role>'; |
$record->{'roles'}{$id}{'section'} = \@sections; |
} |
$record->{'roles'}{$id}{'group'} = \@groups; |
foreach my $access (@accesses) { |
|
$record .= '<access>'.$access.'</access>'; |
|
} |
|
foreach my $section (@sections) { |
|
$record .= '<section>'.$section.'</section>'; |
|
} |
|
foreach my $group (@groups) { |
|
$record .= '<group>'.$group.'</group>'; |
|
} |
|
$record .= '</roles>'; |
|
} |
} |
} elsif ($scope eq 'domains') { |
} elsif ($scope eq 'domains') { |
my @doms = &Apache::loncommon::get_env_multiple('form.dom_'.$num); |
my @doms = &Apache::loncommon::get_env_multiple('form.dom_'.$num); |
foreach my $dom (@doms) { |
$record->{'dom'} = \@doms; |
if ($dom ne '') { |
|
$record .= '<dom>'.$dom.'</dom>'; |
|
} |
|
} |
|
} elsif ($scope eq 'users') { |
} elsif ($scope eq 'users') { |
my $userlist = $env{'form.users_'.$num}; |
my $userlist = $env{'form.users_'.$num}; |
$userlist =~ s/[\r\n\f]+//g; |
$userlist =~ s/\s+//sg; |
$userlist =~ s/\s+//g; |
my %userhash = map { ($_,1) } (split(/,/,$userlist)); |
my @users = split/,/,$userlist; |
foreach my $user (keys(%userhash)) { |
my %userhash; |
|
my @unique_users; |
|
foreach my $user (@users) { |
|
if (!exists($userhash{$user})) { |
|
$userhash{$user} = 1; |
|
push(@unique_users,$user); |
|
} |
|
} |
|
$record .= '<users>'; |
|
foreach my $user (@unique_users) { |
|
my ($uname,$udom) = split(/:/,$user); |
my ($uname,$udom) = split(/:/,$user); |
$record .= '<user><uname>'.$uname.'</uname><udom>'.$udom. |
push(@{$record->{'users'}}, { |
'</udom></user>'; |
'uname' => $uname, |
} |
'udom' => $udom |
$record .= '</users>'; |
}); |
|
} |
} |
} |
$record .= '</scope>'; |
|
return $record; |
return $record; |
} |
} |
|
|
Line 806 sub get_dates_from_form {
|
Line 784 sub get_dates_from_form {
|
} |
} |
|
|
sub sort_users { |
sub sort_users { |
my ($users_hash) = @_; |
my ($users) = @_; |
my @curr_users; |
my @curr_users = map { |
foreach my $user (keys(%{$users_hash})) { |
$_->{'uname'}.':'.$_->{'udom'} |
$curr_users[$$users_hash{$user}] = $user; |
} (@{$users}); |
} |
my $curr_user_list = join(",\n",sort(@curr_users)); |
my $curr_user_list = join(",\n",@curr_users); |
|
return $curr_user_list; |
return $curr_user_list; |
} |
} |
|
|
Line 853 sub access_setting_table {
|
Line 830 sub access_setting_table {
|
$r->print('<table border="0"><tr><td valign="top">'); |
$r->print('<table border="0"><tr><td valign="top">'); |
$r->print('<h3>'.&mt('Public access:').' '.$publictext.'</h3>'); |
$r->print('<h3>'.&mt('Public access:').' '.$publictext.'</h3>'); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_header_row()); |
$r->print('<th>'.&mt('Action').'</th><th>'.&mt('Dates available').'</th>'); |
$r->print('<th>'.&mt('Action').'</th><th>'.&mt('Dates available').'</th>'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
if ($public) { |
if ($public) { |
$r->print('<td>'.&actionbox('old',$publicnum,'public').'</td><td>'. |
$r->print('<td>'.&actionbox('old',$publicnum,'public').'</td><td>'. |
Line 869 sub access_setting_table {
|
Line 846 sub access_setting_table {
|
$r->print('</td><td width="40"> </td><td valign="top">'); |
$r->print('</td><td width="40"> </td><td valign="top">'); |
$r->print('<h3>'.&mt('Password-protected access:').' '.$guesttext.'</h3>'); |
$r->print('<h3>'.&mt('Password-protected access:').' '.$guesttext.'</h3>'); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_header_row()); |
$r->print('<th>'.&mt('Action').'</th><th>'.&mt('Dates available'). |
$r->print('<th>'.&mt('Action').'</th><th>'.&mt('Dates available'). |
'</th><th>'. &mt('Password').'</th>'); |
'</th><th>'. &mt('Password').'</th>'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
my $passwd; |
my $passwd; |
if ($guest) { |
if ($guest) { |
my %content = &Apache::lonnet::parse_access_controls( |
$passwd = $$access_controls{$guest}{'password'}; |
$$access_controls{$guest}); |
|
$passwd = $content{'password'}; |
|
$r->print('<td>'.&actionbox('old',$guestnum,'guest').'</td><td>'. |
$r->print('<td>'.&actionbox('old',$guestnum,'guest').'</td><td>'. |
&dateboxes($guestnum,$start{$guest},$end{$guest}).'</td>'); |
&dateboxes($guestnum,$start{$guest},$end{$guest}).'</td>'); |
} else { |
} else { |
Line 951 sub display_access_row {
|
Line 926 sub display_access_row {
|
my $uctype = $type; |
my $uctype = $type; |
$uctype =~ s/^(\w)/uc($1)/e; |
$uctype =~ s/^(\w)/uc($1)/e; |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_header_row()); |
$r->print('<th>'.&mt('Action?').'</th><th>'.&mt($uctype).'</td><th>'. |
$r->print('<th>'.&mt('Action?').'</th><th>'.&mt($uctype).'</th><th>'. |
&mt('Dates available').'</th>'); |
&mt('Dates available').'</th>'); |
if (($type eq 'course') || ($type eq 'group')) { |
if (($type eq 'course') || ($type eq 'group')) { |
$r->print('<th>'.&mt('Allowed [_1] member affiliations',$type). |
$r->print('<th>'.&mt('Allowed [_1] member affiliations',$type). |
Line 963 sub display_access_row {
|
Line 938 sub display_access_row {
|
} elsif ($type eq 'domains') { |
} elsif ($type eq 'domains') { |
@all_doms = &Apache::loncommon::get_domains(); |
@all_doms = &Apache::loncommon::get_domains(); |
} |
} |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
|
$r->print(&Apache::loncommon::start_data_table_row()); |
foreach my $key (@{$items}) { |
foreach my $key (@{$items}) { |
if (($type eq 'course') || ($type eq 'group')) { |
if (($type eq 'course') || ($type eq 'group')) { |
&course_row($r,$status,$type,$key,$access_controls, |
&course_row($r,$status,$type,$key,$access_controls, |
Line 981 sub display_access_row {
|
Line 957 sub display_access_row {
|
$r->print('<td colspan="',$colspan.'">'.&additional_item($type). |
$r->print('<td colspan="',$colspan.'">'.&additional_item($type). |
'</td>'); |
'</td>'); |
} |
} |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_data_table()); |
} else { |
} else { |
$r->print(&mt('No [_1]-based conditions defined.<br />',$type). |
$r->print(&mt('No [_1]-based conditions defined.<br />',$type). |
Line 989 sub display_access_row {
|
Line 966 sub display_access_row {
|
return; |
return; |
} |
} |
|
|
sub course_row { |
sub course_js { |
my ($r,$status,$type,$item,$access_controls,$tablecolor,$now,$then) = @_; |
return qq| |
my %content; |
|
my $defdom = $env{'user.domain'}; |
|
if ($status eq 'old') { |
|
%content = &Apache::lonnet::parse_access_controls( |
|
$$access_controls{$item}); |
|
$defdom = $content{'domain'}; |
|
} |
|
$r->print(&Apache::loncommon::coursebrowser_javascript($defdom)); |
|
$r->print(qq| |
|
<script type="text/javascript"> |
<script type="text/javascript"> |
function setRoleOptions(caller,num,cdom,cnum,type) { |
function setRoleOptions(caller,num,cdom,cnum,type) { |
addIndexnum = getCallerIndex(caller); |
addIndexnum = getCallerIndex(caller); |
Line 1038 function getIndex(name,value) {
|
Line 1006 function getIndex(name,value) {
|
} |
} |
|
|
</script> |
</script> |
|); |
|; |
$r->print(&Apache::loncommon::start_data_table_row()); |
} |
|
|
|
sub course_row { |
|
my ($r,$status,$type,$item,$access_controls,$tablecolor,$now,$then) = @_; |
|
my %content; |
|
my $defdom = $env{'user.domain'}; |
|
if ($status eq 'old') { |
|
$defdom = $$access_controls{$item}{'domain'}; |
|
} |
|
my $js = &Apache::loncommon::coursebrowser_javascript($defdom) |
|
.&course_js(); |
my $crsgrptext = 'Groups'; |
my $crsgrptext = 'Groups'; |
if ($type eq 'group') { |
if ($type eq 'group') { |
$crsgrptext = 'Teams'; |
$crsgrptext = 'Teams'; |
} |
} |
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
$type); |
$type); |
$r->print('<td>'.&actionbox($status,$num,$scope).'</td>'); |
$r->print('<td>'.$js.&actionbox($status,$num,$scope).'</td>'); |
if ($status eq 'old') { |
if ($status eq 'old') { |
my $cid = $content{'domain'}.'_'.$content{'number'}; |
my $cid = $content{'domain'}.'_'.$content{'number'}; |
my %course_description = &Apache::lonnet::coursedescription($cid); |
my %course_description = &Apache::lonnet::coursedescription($cid); |
Line 1078 function getIndex(name,value) {
|
Line 1056 function getIndex(name,value) {
|
$r->print('<tr><td><input type="checkbox" name="add_role_'.$num.'" value="'.$role_id.'" checked="checked" />'.&mt('Add').'<input type="hidden" name="grplist_'.$num.'_'.$role_id.'" /></td>'.$role_selects); |
$r->print('<tr><td><input type="checkbox" name="add_role_'.$num.'" value="'.$role_id.'" checked="checked" />'.&mt('Add').'<input type="hidden" name="grplist_'.$num.'_'.$role_id.'" /></td>'.$role_selects); |
$r->print('</tr></table></td>'); |
$r->print('</tr></table></td>'); |
} |
} |
$r->print(&Apache::loncommon::end_data_table_row()); |
|
return; |
return; |
} |
} |
|
|
sub domains_row { |
sub domains_row { |
my ($r,$status,$item,$all_doms,$access_controls,$now,$then) = @_; |
my ($r,$status,$item,$all_doms,$access_controls,$now,$then) = @_; |
$r->print(&Apache::loncommon::start_data_table_row()); |
|
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
'domains'); |
'domains'); |
my $dom_select = '<select name="dom_'.$num.'" size="4" multiple="true"/>'. |
my $dom_select = '<select name="dom_'.$num.'" size="4" multiple="true"/>'. |
' <option value="">'.&mt('Please select').'</option>'; |
' <option value="">'.&mt('Please select').'</option>'; |
$r->print(&Apache::loncommon::start_data_table_row()); |
|
if ($status eq 'old') { |
if ($status eq 'old') { |
my %content = &Apache::lonnet::parse_access_controls( |
my $content = $$access_controls{$item}; |
$$access_controls{$item}); |
foreach my $dom (@{$all_doms}) { |
my @curr_doms = @{$content{'dom'}}; |
if ((@{$content->{'dom'}} > 0) |
foreach my $dom (@{$all_doms}) { |
&& (grep(/^\Q$dom\E$/,@{$content->{'dom'}}))) { |
if ((@{$content{'dom'}} > 0) && (grep(/^\Q$dom\E$/,@{$content{'dom'}}))) { |
|
$dom_select .= '<option value="'.$dom.'" selected>'. |
$dom_select .= '<option value="'.$dom.'" selected>'. |
$dom.'</option>'; |
$dom.'</option>'; |
} else { |
} else { |
Line 1109 sub domains_row {
|
Line 1083 sub domains_row {
|
} |
} |
$r->print('<td>'.&actionbox($status,$num,$scope).'</td><td>'.$dom_select. |
$r->print('<td>'.&actionbox($status,$num,$scope).'</td><td>'.$dom_select. |
'</td><td>'.&dateboxes($num,$start,$end).'</td>'); |
'</td><td>'.&dateboxes($num,$start,$end).'</td>'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
|
$r->print(&Apache::loncommon::start_data_table_row()); |
|
} |
} |
|
|
sub users_row { |
sub users_row { |
my ($r,$status,$item,$access_controls,$now,$then) = @_; |
my ($r,$status,$item,$access_controls,$now,$then) = @_; |
$r->print(&Apache::loncommon::start_data_table_row()); |
|
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
'users'); |
'users'); |
my $curr_user_list; |
my $curr_user_list; |
if ($status eq 'old') { |
if ($status eq 'old') { |
my %content = &Apache::lonnet::parse_access_controls( |
my $content = $$access_controls{$item}; |
$$access_controls{$item}); |
$curr_user_list = &sort_users($content->{'users'}); |
$curr_user_list = &sort_users($content{'users'}); |
|
} |
} |
$r->print('<td>'.&actionbox($status,$num,$scope).'</td><td>'.&mt("Format for users' username:domain information:").'<br /><tt>sparty:msu,illini:uiuc ... etc.</tt><br /><textarea name="users_'.$num.'" cols="30" rows="5">'.$curr_user_list.'</textarea></td><td>'.&dateboxes($num,$start,$end).'</td>'); |
$r->print('<td>'.&actionbox($status,$num,$scope).'</td><td>'.&mt("Format for users' username:domain information:").'<br /><tt>sparty:msu,illini:uiuc ... etc.</tt><br /><textarea name="users_'.$num.'" cols="30" rows="5">'.$curr_user_list.'</textarea></td><td>'.&dateboxes($num,$start,$end).'</td>'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
|
} |
} |
|
|
sub additional_item { |
sub additional_item { |