From 0d9b7353a7e6cddcc700820416148c6a4a066436 Mon Sep 17 00:00:00 2001 From: wolffc Date: Thu, 16 Sep 2010 14:42:15 +0000 Subject: [PATCH] Display a warning if the size limit of an ldap search is exceeded and the configuration option 'sizelimitWarning' is set to 'true'. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@19725 594d385d-05f5-0310-b6e9-bd551577e9d8 --- trunk/gosa-core/include/class_ldap.inc | 6 ++++++ .../gosa-core/locale/core/de/LC_MESSAGES/messages.po | 11 +++++++++++ trunk/gosa-core/locale/core/messages.po | 9 +++++++++ 3 files changed, 26 insertions(+) diff --git a/trunk/gosa-core/include/class_ldap.inc b/trunk/gosa-core/include/class_ldap.inc index 126325661..ef8eb0565 100644 --- a/trunk/gosa-core/include/class_ldap.inc +++ b/trunk/gosa-core/include/class_ldap.inc @@ -224,6 +224,12 @@ class LDAP{ $this->clearResult($srp); $this->sr[$srp] = @ldap_search($this->cid, LDAP::fix($this->basedn), $filter, $attrs); $this->error = @ldap_error($this->cid); + if ($this->error == "Size limit exceeded") { + global $config; + if (preg_match('/true/i', $config->get_cfg_value('sizelimitWarning'))) { + msg_dialog::display(_("Size Limit Exceeded"), sprintf(_("More than %d objects were found in a query, the rest is being ignored!"), session::global_get('size_limit')), WARNING_DIALOG); + } + } $this->resetResult($srp); $this->hasres[$srp]=true; diff --git a/trunk/gosa-core/locale/core/de/LC_MESSAGES/messages.po b/trunk/gosa-core/locale/core/de/LC_MESSAGES/messages.po index da8fccce5..614858dcc 100644 --- a/trunk/gosa-core/locale/core/de/LC_MESSAGES/messages.po +++ b/trunk/gosa-core/locale/core/de/LC_MESSAGES/messages.po @@ -5219,6 +5219,17 @@ msgstr "Liste neu laden" msgid "Inconsistent DN encoding detected: '%s'" msgstr "Inkonsistente Enkodierung der DN erkannt: '%s'" +#: include/class_ldap.inc:230 +msgid "Size Limit Exceeded" +msgstr "Mengenbeschränkung Überschritten" + +#: include/class_ldap.inc:230 +#, php-format +msgid "More than %d objects were found in a query, the rest is being ignored!" +msgstr "" +"Mehr als %d Objekte wurden bei einer Abfrage gefunden, der Rest wird " +"ignoriert!" + #: include/class_ldap.inc:234 include/class_ldap.inc:267 msgid "Performance warning" msgstr "Leistungswarnung" diff --git a/trunk/gosa-core/locale/core/messages.po b/trunk/gosa-core/locale/core/messages.po index 76063fe21..99e262e51 100644 --- a/trunk/gosa-core/locale/core/messages.po +++ b/trunk/gosa-core/locale/core/messages.po @@ -4882,6 +4882,15 @@ msgstr "" msgid "Inconsistent DN encoding detected: '%s'" msgstr "" +#: include/class_ldap.inc:230 +msgid "Size Limit Exceeded" +msgstr "" + +#: include/class_ldap.inc:230 +#, php-format +msgid "More than %d objects were found in a query, the rest is being ignored!" +msgstr "" + #: include/class_ldap.inc:234 include/class_ldap.inc:267 msgid "Performance warning" msgstr "" -- 2.30.2