From 36d87c406232f9de5bf2c9e388aefb60241a16dd Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 15 Sep 2011 07:48:10 +0000 Subject: [PATCH] Backported patch from 2.7 -Fixed reloading of special-char-handling for ldap requests. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.7@20982 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_ldap.inc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gosa-core/include/class_ldap.inc b/gosa-core/include/class_ldap.inc index 9d32048e0..0d30c0039 100644 --- a/gosa-core/include/class_ldap.inc +++ b/gosa-core/include/class_ldap.inc @@ -115,6 +115,21 @@ class LDAP */ static function updateSpecialCharHandling() { + global $config; + + // Load results from the session if they exists. + if(session::is_set('LDAP::updateSpecialCharHandling')){ + $data = session::get('LDAP::updateSpecialCharHandling'); + $attrs = array("characterMap", "characterMapRegFrom", "characterMapRegTo", "readableMapRegFrom", "readableMapRegTo"); + foreach($attrs as $attr){ + LDAP::$$attr = $data[$attr]; + } + + $attrs = array(implode(LDAP::$characterMapRegFrom,', '),implode(LDAP::$characterMapRegTo,', ')); + @DEBUG(DEBUG_LDAP,__LINE__,__FUNCTION__,__FILE__,$attrs,"(Cached) Detected special-char handling for LDAP actions"); + return; + } + // Set a default character handling. LDAP::$characterMapRegFrom = array("/\001CO/", "/\001OB/", "/\001CB/", "/\001SL/", "/\001DQ/"); LDAP::$characterMapRegTo = array("\,", "(", ")", "/", '\"'); @@ -150,6 +165,14 @@ class LDAP LDAP::$characterMap = array(); } } + + // Store results in the session. + $attrs = array("characterMap", "characterMapRegFrom", "characterMapRegTo", "readableMapRegFrom", "readableMapRegTo"); + $data = array(); + foreach($attrs as $attr){ + $data[$attr] = LDAP::$$attr; + } + session::set("LDAP::updateSpecialCharHandling", $data); $attrs = array(implode(LDAP::$characterMapRegFrom,', '),implode(LDAP::$characterMapRegTo,', ')); @DEBUG(DEBUG_LDAP,__LINE__,__FUNCTION__,__FILE__,$attrs,"Detected special-char handling for LDAP actions"); -- 2.30.2