[LON-CAPA-cvs] cvs: loncom /interface loncoursegroups.pm
raeburn
lon-capa-cvs-allow@mail.lon-capa.org
Wed, 16 Apr 2008 23:12:28 -0000
raeburn Wed Apr 16 19:12:28 2008 EDT
Modified files:
/loncom/interface loncoursegroups.pm
Log:
- arguments in calls to lonnet::get_dir_list() and lonnet::diskusage() modified to use new versions of these subs and to eliminate the need to call &propath() on session server side.
Index: loncom/interface/loncoursegroups.pm
diff -u loncom/interface/loncoursegroups.pm:1.73 loncom/interface/loncoursegroups.pm:1.74
--- loncom/interface/loncoursegroups.pm:1.73 Wed Apr 16 18:40:02 2008
+++ loncom/interface/loncoursegroups.pm Wed Apr 16 19:12:25 2008
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: loncoursegroups.pm,v 1.73 2008/04/16 22:40:02 raeburn Exp $
+# $Id: loncoursegroups.pm,v 1.74 2008/04/16 23:12:25 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -254,13 +254,13 @@
my $members_result = &group_members($cdom,$cnum,$group,
\%grp_info);
my $port_path = '/userfiles/groups/'.$group.'/portfolio';
- my $port_dir = &Apache::loncommon::propath($cdom,$cnum).$port_path;
my $totaldirs = 0;
my $totalfiles = 0;
- &group_files($group,$port_dir,\$totalfiles,\$totaldirs);
+ &group_files($group,$port_path,\$totalfiles,\$totaldirs);
$grp_info{$group}{'totalfiles'} = $totalfiles;
$grp_info{$group}{'totaldirs'} = $totaldirs;
- my $diskuse = &Apache::lonnet::diskusage($cdom,$cnum,$port_dir);
+ my $getpropath = 1;
+ my $diskuse = &Apache::lonnet::diskusage($cdom,$cnum,$port_path, $getpropath);
if ($grp_info{$group}{'quota'} > 0) {
my $pct_use = 0.1 * $diskuse/$grp_info{$group}{'quota'};
$grp_info{$group}{'diskuse'} = sprintf("%.0f",$pct_use);
@@ -1460,16 +1460,16 @@
}
sub group_files {
- my ($group,$currdir,$numfiles,$numdirs) = @_;
+ my ($group,$portpath,$numfiles,$numdirs) = @_;
my $dirptr=16384;
- my @dir_list=&Apache::portfolio::get_dir_list($currdir,$group);
+ my @dir_list=&Apache::portfolio::get_dir_list($portpath,undef,$group);
foreach my $line (@dir_list) {
my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16);
if (($filename !~ /^\.\.?$/) && ($filename !~ /\.meta$/ ) && ($filename !~ /(.*)\.(\d+)\.([^\.]*)$/) && ($filename ne 'no_such_dir')) {
if ($dirptr&$testdir) {
- $currdir .= '/'.$filename;
+ $portpath .= '/'.$filename;
$$numdirs ++;
- &group_files($group,$currdir,$numfiles,$numdirs);
+ &group_files($group,$portpath,$numfiles,$numdirs)
} else {
$$numfiles ++;
}