From d8a2379d0b4f43dcfb33f8b08a91cbe4cbea1956 Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 7 Mar 2008 15:53:33 +0000 Subject: [PATCH] Removed show_errors git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9449 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_config.inc | 9 ++------ gosa-core/include/class_ldap.inc | 29 +------------------------- gosa-core/include/class_msg_dialog.inc | 11 ++++++++++ gosa-core/include/functions.inc | 11 ---------- 4 files changed, 14 insertions(+), 46 deletions(-) diff --git a/gosa-core/include/class_config.inc b/gosa-core/include/class_config.inc index bbe1c1794..963db36b3 100644 --- a/gosa-core/include/class_config.inc +++ b/gosa-core/include/class_config.inc @@ -216,13 +216,8 @@ class config { function get_ldap_link($sizelimit= FALSE) { + if($this->ldap === NULL || !is_resource($this->ldap->cid)){ -# REuse last ldap valid handle again. -# DISABLED due to unpredictable results. - -# -# if($this->ldap === NULL || !is_resource($this->ldap->cid)){ -# /* Build new connection */ $this->ldap= ldap_init ($this->current['SERVER'], $this->current['BASE'], $this->current['ADMIN'], $this->current['PASSWORD']); @@ -251,7 +246,7 @@ class config { } else { $this->ldap->referrals= $this->current['REFERRAL']; } -# } + } return ($this->ldap); } diff --git a/gosa-core/include/class_ldap.inc b/gosa-core/include/class_ldap.inc index 93686b6e6..c01428d42 100644 --- a/gosa-core/include/class_ldap.inc +++ b/gosa-core/include/class_ldap.inc @@ -201,31 +201,11 @@ class LDAP{ } -# /* Checks if there is still unfetched data -# */ -# function checkResult() -# { -# /* Check if we have started a search before */ -# if($this->start != 0 && $this->re){ -# -# /* Check if there are still unfetched elements */ -# if(is_resource(@ldap_next_entry($this->cid, $this->re))){ -# new log("debug","LDAP:: CAT/SEARCH/FETCH","A new search was initiated while an older search wasn't fetched completely."); -# msg_dialog::display(_("Debug"),"A new search was initiated while an older search wasn't fetched completely.",ERROR_DIALOG); -# trigger_error("A new search was initiated while an older search wasn't fetched completely."); -# } -# } -# } -# function search($filter, $attrs= array()) { if($this->hascon){ if ($this->reconnect) $this->connect(); -# /* Check if there are still unfetched objects from last search -# */ -# $this->checkResult(); - $start = microtime(); $this->clearResult(); $this->sr = @ldap_search($this->cid, LDAP::fix($this->basedn), $filter, $attrs); @@ -254,10 +234,6 @@ class LDAP{ if($this->hascon){ if ($this->reconnect) $this->connect(); -# /* Check if there are still unfetched objects from last search -# */ -# $this->checkResult(); - $this->clearResult(); if ($basedn == "") $basedn = $this->basedn; @@ -292,10 +268,6 @@ class LDAP{ if($this->hascon){ if ($this->reconnect) $this->connect(); -# /* Check if there are still unfetched objects from last search -# */ -# $this->checkResult(); - $this->clearResult(); $filter = "(objectclass=*)"; $this->sr = @ldap_read($this->cid, LDAP::fix($dn), $filter,$attrs); @@ -1324,6 +1296,7 @@ class LDAP{ return ($result); } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/gosa-core/include/class_msg_dialog.inc b/gosa-core/include/class_msg_dialog.inc index eba6b42bf..d6bc4f7a6 100644 --- a/gosa-core/include/class_msg_dialog.inc +++ b/gosa-core/include/class_msg_dialog.inc @@ -83,11 +83,22 @@ class msg_dialog session::set('errorsAlreadyPosted',$errorsAlreadyPosted); } + public static function display($s_title,$s_message,$i_type = INFO_DIALOG) { new msg_dialog($s_title,$s_message,$i_type); } + + public static function displayChecks($messages) + { + /* Assemble the message array to a plain string */ + foreach ($message as $error){ + msg_dialog::display(_("Error"), $error, ERROR_DIALOG); + } + } + + public function get_ID() { return($this->i_ID); diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index 677ebb193..972281137 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -1357,17 +1357,6 @@ function get_printer_list() } -function show_errors($message) -{ - $complete= ""; - - /* Assemble the message array to a plain string */ - foreach ($message as $error){ - msg_dialog::display(_("Error"), $error, ERROR_DIALOG); - } -} - - function show_ldap_error($message, $addon= "") { if (!preg_match("/Success/i", $message)){ -- 2.30.2