[LON-CAPA-cvs] cvs: loncom /auth lonstatusacc.pm

raeburn raeburn@source.lon-capa.org
Thu, 15 Jan 2009 21:01:37 -0000


raeburn		Thu Jan 15 21:01:37 2009 EDT

  Modified files:              
    /loncom/auth	lonstatusacc.pm 
  Log:
  - Tests are not mutually exclusive - replace if {..} elsif {..} else
     with if {} if {} if {}.
     - Although the iteration over @hostids is primarily for use in authorizing LWP requests for status information from servers in a specific domain (by clusterstatus.pl running on one of the domain's servers), this authorization could also come into play when web browsing from a LON-CAPA server itself.
  
  
Index: loncom/auth/lonstatusacc.pm
diff -u loncom/auth/lonstatusacc.pm:1.5 loncom/auth/lonstatusacc.pm:1.6
--- loncom/auth/lonstatusacc.pm:1.5	Thu Dec 25 05:49:20 2008
+++ loncom/auth/lonstatusacc.pm	Thu Jan 15 21:01:37 2009
@@ -1,7 +1,7 @@
 #
 # LON-CAPA authorization for pages generated by server-status reports 
 #
-# $Id: lonstatusacc.pm,v 1.5 2008/12/25 05:49:20 raeburn Exp $
+# $Id: lonstatusacc.pm,v 1.6 2009/01/15 21:01:37 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -82,13 +82,13 @@
                 }
             }
         }
-    } elsif (&LONCAPA::lonauthcgi::check_ipbased_access($page,$reqhost)) {
+    }
+    if (&LONCAPA::lonauthcgi::check_ipbased_access($page,$reqhost)) {
         return OK;
-    } else {
-        if (&LONCAPA::loncgi::check_cookie_and_load_env($r)) {
-            if (&LONCAPA::lonauthcgi::can_view($page)) {
-                return OK;
-            }
+    }
+    if (&LONCAPA::loncgi::check_cookie_and_load_env($r)) {
+        if (&LONCAPA::lonauthcgi::can_view($page)) {
+            return OK;
         }
     }
     $r->log_reason("Invalid request for server status from $reqhost",