--- loncom/interface/portfolio.pm 2024/08/19 01:32:58 1.254.2.6.2.2 +++ loncom/interface/portfolio.pm 2023/12/28 15:57:27 1.267 @@ -1,7 +1,7 @@ # The LearningOnline Network # portfolio browser # -# $Id: portfolio.pm,v 1.254.2.6.2.2 2024/08/19 01:32:58 raeburn Exp $ +# $Id: portfolio.pm,v 1.267 2023/12/28 15:57:27 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -237,7 +237,7 @@ sub display_directory_line { if ($lock_info) { my %anchor_fields = ('lockinfo' => $fullpath); if ($versions) { # hold the folder open - my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($fullpath); + my ($fname,$version,$extension) = &Apache::lonnet::file_name_version_ext($fullpath); $fname =~ s|^/||; $anchor_fields{'showversions'} = $fname.'.'.$extension; } @@ -373,7 +373,7 @@ sub display_directory { } (@{$dir_list})) { my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$dir_line,16); $filename =~ s/\s+$//; - my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($filename); + my ($fname,$version,$extension) = &Apache::lonnet::file_name_version_ext($filename); if ($version) { my $fullpath = &prepend_group($current_path.$fname.'.'.$extension); push(@{ $versioned{$fullpath} }, @@ -386,7 +386,7 @@ sub display_directory { my $zerobyte; foreach my $dir_line (@dir_lines) { my ($filename,$dom,$testdir,$size,$mtime,$obs) = @$dir_line; - my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($filename); + my ($fname,$version,$extension) = &Apache::lonnet::file_name_version_ext($filename); if (($filename ne '.') && ($filename ne '..') && ($filename !~ /\.meta$/ ) && ($filename !~ /(.*)\.(\d+)\.([^\.]*)$/)) { my $version_flag; my $show_versions; @@ -490,7 +490,6 @@ sub display_directory { my $cond_access = 0; foreach my $key (sort(keys(%{$access_controls{$fullpath}}))) { my ($num,$scope,$end,$start) = &unpack_acc_key($key); - next if ($scope eq 'ip'); if (($now > $start) && (!$end || $end > $now)) { if ($scope eq 'public') { $pub_access = 1; @@ -1006,9 +1005,9 @@ sub build_access_summary { domains => 'Conditional: domain-based', users => 'Conditional: user-based', course => 'Conditional: course/community-based', - userip => 'Conditional: IP-based', + ip => 'Conditional: IP-based', ); - my @allscopes = ('public','guest','domains','users','course','userip'); + my @allscopes = ('public','guest','domains','users','course','ip'); foreach my $scope (@allscopes) { if ((!(exists($todisplay{$scope}))) || (ref($todisplay{$scope}) ne 'HASH')) { next; @@ -1085,8 +1084,8 @@ sub build_access_summary { } elsif ($scope eq 'users') { my $curr_user_list = &sort_users($content->{'users'}); $r->print(&mt('Users: ').$curr_user_list); - } elsif ($scope eq 'userip') { - my $curr_ips_list = &sort_ips($content->{'userip'}); + } elsif ($scope eq 'ip') { + my $curr_ips_list = &sort_ips($content->{'ip'}); $r->print(&mt('IP(s):').' '.$curr_ips_list); } else { $r->print(' '); @@ -1196,7 +1195,7 @@ sub update_access { my $totalnew = 0; my $status = 'new'; my ($firstitem,$lastitem); - my @types = ('course','domains','users','userip'); + my @types = ('course','domains','users','ip'); foreach my $newitem (@types) { $allnew += $env{'form.new'.$newitem}; } @@ -1208,7 +1207,7 @@ sub update_access { course => 'course/community', domains => 'domain', users => 'user', - userip => 'IP', + ip => 'IP', ); foreach my $newitem (@types) { next if ($env{'form.new'.$newitem} <= 0); @@ -1312,7 +1311,7 @@ sub build_access_record { 'udom' => $udom }); } - } elsif ($scope eq 'userip') { + } elsif ($scope eq 'ip') { my $ipslist = $env{'form.ips_'.$num}; $ipslist =~ s/\s+//sg; my %ipshash = map { ($_,1) } (split(/,/,$ipslist)); @@ -1383,7 +1382,7 @@ sub access_setting_table { push(@domains,$key); } elsif ($scope eq 'users') { push(@users,$key); - } elsif ($scope eq 'userip') { + } elsif ($scope eq 'ip') { push(@ips,$key); } } @@ -1445,7 +1444,7 @@ sub standard_settings { my $numconditionals = 0; my $conditionstext; my %cond_status; - foreach my $scope ('domains','users','course','userip') { + foreach my $scope ('domains','users','course','ip') { $numconditionals += $acl_count->{$scope}; if ($acl_count->{$scope} > 0) { if ($conditionstext ne 'Active') { @@ -1492,7 +1491,7 @@ sub condition_setting { $r->print(''); &access_element($r,'course',$acl_count,$courses,$access_controls,$now,$then); $r->print(' '); - &access_element($r,'userip',$acl_count,$ips,$access_controls,$now,$then); + &access_element($r,'ip',$acl_count,$ips,$access_controls,$now,$then); $r->print(''); } @@ -1513,7 +1512,7 @@ sub access_element { domains => 'Domain', users => 'User', course => 'Course/Community', - userip => 'IP', + ip => 'IP', ); $r->print('

'.&mt($typetext{$type}.'-based conditional access:').' '); if ($$acl_count{$type}) { @@ -1538,7 +1537,7 @@ sub display_access_row { } elsif ($type eq 'users') { $showtype = &mt('Users'); $infotype = 'User'; - } elsif ($type eq 'userip') { + } elsif ($type eq 'ip') { $showtype = &mt('IP-based'); $infotype = 'IP'; } @@ -1566,7 +1565,7 @@ sub display_access_row { $then); } elsif ($type eq 'users') { &users_row($r,$status,$key,$access_controls,$now,$then); - } elsif ($type eq 'userip') { + } elsif ($type eq 'ip') { &ips_row($r,$status,$key,$access_controls,$now,$then); } $r->print(&Apache::loncommon::end_data_table_row()); @@ -1749,11 +1748,11 @@ sub users_row { sub ips_row { my ($r,$status,$item,$access_controls,$now,$then) = @_; my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, - 'userip'); + 'ip'); my $curr_ips_list; if ($status eq 'old') { my $content = $$access_controls{$item}; - $curr_ips_list = &sort_ips($content->{'userip'}); + $curr_ips_list = &sort_ips($content->{'ip'}); } $r->print(''.&actionbox($status,$num,$scope).''.&mt('Format for IP controls').'
'. &mt('[_1] or [_2] or [_3] or [_4] or [_5]','35.8.*','35.8.3.[34-56]', @@ -1772,7 +1771,7 @@ sub additional_item { $showtype = 'domain'; } elsif ($type eq 'users') { $showtype = 'user'; - } elsif ($type eq 'userip') { + } elsif ($type eq 'ip') { $showtype = 'IP'; } return @@ -1786,7 +1785,7 @@ sub actionbox { my $output = '