version 1.69, 2006/09/26 15:15:19
|
version 1.70.2.2, 2007/01/03 03:59:48
|
Line 234 foreach my $dom (@domains) {
|
Line 234 foreach my $dom (@domains) {
|
foreach my $uname (keys(%portusers)) { |
foreach my $uname (keys(%portusers)) { |
my $urlstart = '/uploaded/'.$dom.'/'.$uname; |
my $urlstart = '/uploaded/'.$dom.'/'.$uname; |
my $pathstart = &propath($dom,$uname).'/userfiles'; |
my $pathstart = &propath($dom,$uname).'/userfiles'; |
my $is_course = &check_for_course($dom,$uname); |
my $is_course = &Apache::lonnet::is_course($dom,$uname); |
my $curr_perm = &Apache::lonnet::get_portfile_permissions($dom,$uname); |
my $curr_perm = &Apache::lonnet::get_portfile_permissions($dom,$uname); |
my %access = &Apache::lonnet::get_access_controls($curr_perm); |
my %access = &Apache::lonnet::get_access_controls($curr_perm); |
foreach my $file (keys(%access)) { |
foreach my $file (keys(%access)) { |
my ($group,$url,$fullpath); |
my ($group,$url,$fullpath); |
if ($is_course) { |
if ($is_course) { |
($group, my ($path)) = ($file =~ /^(\w+)(\/.+)$/); |
($group, my ($path)) = ($file =~ /^(\w+)(\/.+)$/); |
$fullpath = $pathstart.'/groups/'.$group.'/portfolio/'.$path; |
$fullpath = $pathstart.'/groups/'.$group.'/portfolio'.$path; |
$url = $urlstart.'/groups/'.$group.'/portfolio'.$path; |
$url = $urlstart.'/groups/'.$group.'/portfolio'.$path; |
} else { |
} else { |
$fullpath = $pathstart.'/portfolio'.$file; |
$fullpath = $pathstart.'/portfolio'.$file; |
$url .= $urlstart.'/portfolio'.$file; |
$url = $urlstart.'/portfolio'.$file; |
} |
} |
if (ref($access{$file}) eq 'HASH') { |
if (ref($access{$file}) eq 'HASH') { |
&process_portfolio_access_data($url,$access{$file}); |
&process_portfolio_access_data($url,$access{$file}); |
Line 322 sub descend_tree {
|
Line 322 sub descend_tree {
|
} |
} |
} |
} |
|
|
sub check_for_course { |
|
my ($cdom,$cnum) = @_; |
|
my %courses = &Apache::lonnet::courseiddump($cdom,'.',1,'.','.',$cnum,undef, |
|
undef,'.'); |
|
if (exists($courses{$cdom.'_'.$cnum})) { |
|
return 1; |
|
} |
|
return 0; |
|
} |
|
|
|
|
|
sub process_portfolio_access_data { |
sub process_portfolio_access_data { |
my ($url,$access_hash) = @_; |
my ($url,$access_hash) = @_; |
foreach my $key (keys(%{$access_hash})) { |
foreach my $key (keys(%{$access_hash})) { |
Line 341 sub process_portfolio_access_data {
|
Line 330 sub process_portfolio_access_data {
|
$acc_data->{keynum} = $key; |
$acc_data->{keynum} = $key; |
my ($num,$scope,$end,$start) = |
my ($num,$scope,$end,$start) = |
($key =~ /^([^:]+):([a-z]+)_(\d*)_?(\d*)$/); |
($key =~ /^([^:]+):([a-z]+)_(\d*)_?(\d*)$/); |
|
next if (($scope ne 'public') && ($scope ne 'guest')); |
$acc_data->{scope} = $scope; |
$acc_data->{scope} = $scope; |
if ($end != 0) { |
if ($end != 0) { |
$acc_data->{end} = &sqltime($end); |
$acc_data->{end} = &sqltime($end); |