Code

Updated for php4 compatibility :-(
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Feb 2007 11:39:36 +0000 (11:39 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Feb 2007 11:39:36 +0000 (11:39 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5738 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_tabs.inc
include/functions.inc

index 0808b9abe2d0fa1f019e8cab6145a65fe8ea34b0..729a441d89e576a5cc511accdd7957eee3e1373d 100644 (file)
@@ -90,7 +90,9 @@ class tabs
 
        $obj= $this->by_object[$this->current];
        $display.= $obj->execute();
-       $this->by_object[$this->current]= $obj;
+  if (is_php4()){
+    $this->by_object[$this->current]= $obj;
+  }
 
        /* Footer for tabbed dialog */
        $display.= "</td></tr></table>";
@@ -106,7 +108,9 @@ class tabs
 
                $obj= $this->by_object[$this->last];
                $obj->save_object ();
-               $this->by_object[$this->last]= $obj;
+    if (is_php4()){
+      $this->by_object[$this->last]= $obj;
+    }
        }
 
        /* Skip if curent and last are the same object */
@@ -122,7 +126,9 @@ class tabs
                        $this->current, "Saving (current)");
 
                $obj->save_object ();
-               $this->by_object[$this->current]= $obj;
+    if (is_php4()){
+      $this->by_object[$this->current]= $obj;
+    }
        }
   }
 
@@ -209,24 +215,27 @@ class tabs
 
   function check($ignore_account= FALSE)
   {
-       $this->save_object(TRUE);
-       $messages= array();
+    $this->save_object(TRUE);
+    $messages= array();
 
-       /* Check all plugins */
-       foreach ($this->by_object as $key => $obj){
-               if ($obj->is_account || $ignore_account || $obj->ignore_account){
-                       @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,
-                               $key, "Checking");
+    /* Check all plugins */
+    foreach ($this->by_object as $key => $obj){
+      if ($obj->is_account || $ignore_account || $obj->ignore_account){
+        @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,
+            $key, "Checking");
 
-                       $messages= $obj->check();
-                       if (count($messages)){
-                               $this->current= $key;
-                               break;
-                       }
-               }
-       }
+        $messages= $obj->check();
+        if (is_php4()){
+          $this->by_object[$key]= $obj;
+        }
+        if (count($messages)){
+          $this->current= $key;
+          break;
+        }
+      }
+    }
 
-       return ($messages);
+    return ($messages);
   }
 
   function save($ignore_account= FALSE)
@@ -256,7 +265,9 @@ class tabs
                                  $key, "Adapting");
                  $obj->parent= &$this;
                  $obj->adapt_from_template($dn);
-                 $this->by_object[$key]= $obj;
+      if (is_php4()){
+        $this->by_object[$key]= $obj;
+      }
          }
   }
 
index 9f0aef9e4e863c58b4d8d3877fba539620ceed52..9fdced5250e418e8726c40ea111742fe761b7f2c 100644 (file)
@@ -2126,5 +2126,11 @@ function gosa_ldap_explode_dn($dn,$config = NULL,$verify_in_ldap=false)
   return($ret);
 }
 
+function is_php4()
+{
+  return (strpos(phpversion(), 4) === 0);
+}
+
+
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>