[LON-CAPA-cvs] cvs: loncom /metadata_database searchcat.pl

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 11 Dec 2006 00:32:24 -0000


albertel		Sun Dec 10 19:32:24 2006 EDT

  Modified files:              
    /loncom/metadata_database	searchcat.pl 
  Log:
  - switch to is_course routine
  
  
Index: loncom/metadata_database/searchcat.pl
diff -u loncom/metadata_database/searchcat.pl:1.69 loncom/metadata_database/searchcat.pl:1.70
--- loncom/metadata_database/searchcat.pl:1.69	Tue Sep 26 11:15:19 2006
+++ loncom/metadata_database/searchcat.pl	Sun Dec 10 19:32:24 2006
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # searchcat.pl "Search Catalog" batch script
 #
-# $Id: searchcat.pl,v 1.69 2006/09/26 15:15:19 raeburn Exp $
+# $Id: searchcat.pl,v 1.70 2006/12/11 00:32:24 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -234,7 +234,7 @@
     foreach my $uname (keys(%portusers)) {
         my $urlstart = '/uploaded/'.$dom.'/'.$uname;
         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 %access = &Apache::lonnet::get_access_controls($curr_perm);
         foreach my $file (keys(%access)) { 
@@ -322,17 +322,6 @@
     } 
 }
 
-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 {
     my ($url,$access_hash) = @_;
     foreach my $key (keys(%{$access_hash})) {