From 15b41e9721d8d62143df1761aa6720d1cdd3cd0e Mon Sep 17 00:00:00 2001 From: cajus Date: Tue, 27 Feb 2007 11:39:36 +0000 Subject: [PATCH] Updated for php4 compatibility :-( git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5738 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_tabs.inc | 49 ++++++++++++++++++++++++++---------------- include/functions.inc | 6 ++++++ 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/include/class_tabs.inc b/include/class_tabs.inc index 0808b9abe..729a441d8 100644 --- a/include/class_tabs.inc +++ b/include/class_tabs.inc @@ -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.= ""; @@ -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; + } } } diff --git a/include/functions.inc b/include/functions.inc index 9f0aef9e4..9fdced525 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -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: ?> -- 2.30.2