[LON-CAPA-cvs] cvs: loncom /interface lonmenu.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Mon, 08 Dec 2003 15:02:34 -0000


raeburn		Mon Dec  8 10:02:34 2003 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  Replaced use of Apache::File to open files with CORE::open and CORE::close to allow use of lonmenu.pm outside Apache (i.e., in standalone mode when called by a cron job owned by www).  
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.103 loncom/interface/lonmenu.pm:1.104
--- loncom/interface/lonmenu.pm:1.103	Fri Nov 21 16:38:50 2003
+++ loncom/interface/lonmenu.pm	Mon Dec  8 10:02:34 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.103 2003/11/21 21:38:50 www Exp $
+# $Id: lonmenu.pm,v 1.104 2003/12/08 15:02:34 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -43,7 +43,6 @@
 use Apache::Constants qw(:common);
 use Apache::lonhtmlcommon();
 use Apache::loncommon;
-use Apache::File;
 use Apache::lonlocal;
 
 use vars qw(@desklines $readdesk);
@@ -962,15 +961,17 @@
 BEGIN {
   if (! defined($readdesk)) {
    {
-    my $config=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}.
-				  '/mydesk.tab');
-    while (my $configline=<$config>) {
-       $configline=(split(/\#/,$configline))[0];
-       $configline=~s/^\s+//;
-       chomp($configline);
-       if ($configline) {
-          $desklines[$#desklines+1]=$configline;
-       }
+    my $tabfile = $Apache::lonnet::perlvar{'lonTabDir'}.'/mydesk.tab';
+    if ( CORE::open( my $config,"<$tabfile") ) {
+        while (my $configline=<$config>) {
+            $configline=(split(/\#/,$configline))[0];
+            $configline=~s/^\s+//;
+            chomp($configline);
+            if ($configline) {
+                $desklines[$#desklines+1]=$configline;
+            }
+        }
+        CORE::close($config);
     }
    }
    $readdesk='done';