sync
[Pman.Admin] / Iptables.php
index d6f1bf1..a88c246 100644 (file)
@@ -47,7 +47,7 @@ class Pman_Admin_Iptables extends Pman {
         return '/tmp/run_pman_admin_iptables-'.$db;
     }
     
-    function get($opt = '')
+    function get($opt = '', $opts = Array())
     {
         
         // monitor file
@@ -86,7 +86,7 @@ class Pman_Admin_Iptables extends Pman {
         */
         //DB_DataObject::debugLevel(1);
         
-        $p = DB_DataObject::Factory('Person');
+        $p = DB_DataObject::Factory('core_person');
         $p->autoJoin();
         $p->whereAdd("join_company_id_id.comptype = 'OWNER'");
         $p->selectAdd();
@@ -114,7 +114,7 @@ class Pman_Admin_Iptables extends Pman {
             max(event_when) + $interval as expires
                      
         ");
-        $e->person_table = DB_DataObject::factory('person')->tableName();
+        $e->person_table = DB_DataObject::factory('core_person')->tableName();
         $e->whereAddIn('person_id', $peps, 'int');
         $e->groupBy('ipaddr');
         $e->whereAdd("event_when > NOW() - $interval");
@@ -156,12 +156,16 @@ class Pman_Admin_Iptables extends Pman {
     function readChain($chain)
     {
         
-        require_once 'System.php';
-        
-        $iptables = System::which('iptables', '/sbin/iptables');
+        static $iptables;
         
-         if (!$iptables || !file_exists($iptables)) {
-            $this->jerr("iptables could not be found.");
+        if (!$iptables) {
+            require_once 'System.php';
+            
+            $iptables = System::which('iptables', '/sbin/iptables');
+            
+            if (!$iptables || !file_exists($iptables)) {
+                $this->jerr("iptables could not be found.");
+            }
         }
         // this should have been set up already..
         // in the base firewall code.
@@ -223,12 +227,16 @@ class Pman_Admin_Iptables extends Pman {
     
     function updateTables()
     {
-        require_once 'System.php';
-        
-        $iptables = System::which('iptables', '/sbin/iptables');
+        static $iptables;
         
-         if (!$iptables || !file_exists($iptables)) {
-            $this->jerr("iptables could not be found.");
+        if (!$iptables) {
+            require_once 'System.php';
+            
+            $iptables = System::which('iptables', '/sbin/iptables');
+            
+            if (!$iptables || !file_exists($iptables)) {
+                $this->jerr("iptables could not be found.");
+            }
         }
         // this should have been set up already..
         // in the base firewall code.