SOURCES: turba-attrcache.patch - updated to 2.1.2
glen
glen at pld-linux.org
Wed Aug 2 10:34:58 CEST 2006
Author: glen Date: Wed Aug 2 08:34:58 2006 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- updated to 2.1.2
---- Files affected:
SOURCES:
turba-attrcache.patch (1.1 -> 1.2)
---- Diffs:
================================================================
Index: SOURCES/turba-attrcache.patch
diff -u SOURCES/turba-attrcache.patch:1.1 SOURCES/turba-attrcache.patch:1.2
--- SOURCES/turba-attrcache.patch:1.1 Wed Aug 2 10:28:15 2006
+++ SOURCES/turba-attrcache.patch Wed Aug 2 10:34:53 2006
@@ -1,133 +1,10 @@
---- lib/Driver/ldap.php 2006-04-13 01:24:23.000000000 +0300
-+++ lib/Driver/ldap.php-bug4207 2006-07-31 23:35:13.954033485 +0300
-@@ -18,6 +18,13 @@
- var $_ds = 0;
-
- /**
-+ * Cache _getSyntax calls to avoid lots of repeated server calls.
-+ *
-+ * @var array
-+ */
-+ var $_syntaxCache = array();
-+
-+ /**
- * Constructs a new Turba LDAP driver object.
- *
- * @access private
-@@ -26,10 +33,6 @@
- */
- function Turba_Driver_ldap($params)
- {
-- if (!Util::extensionExists('ldap')) {
-- Horde::fatal(PEAR::raiseError(_("LDAP support is required but the LDAP module is not available or not loaded.")), __FILE__, __LINE__);
-- }
--
- if (empty($params['server'])) {
- $params['server'] = 'localhost';
- }
-@@ -54,6 +57,10 @@
-
- function _init()
- {
-+ if (!Util::extensionExists('ldap')) {
-+ return PEAR::raiseError(_("LDAP support is required but the LDAP module is not available or not loaded."));
-+ }
-+
- if (!($this->_ds = @ldap_connect($this->_params['server'], $this->_params['port']))) {
- return PEAR::raiseError(_("Connection failure"));
- }
-@@ -290,15 +297,8 @@
- /* Check if we need to rename the object. */
- if ($this->_params['version'] == 3 &&
- String::lower($this->_makeKey($attributes)) != String::lower($object_id)) {
-- if (isset($this->_params['dn']) && is_array($this->_params['dn']) && count($this->_params['dn'])) {
-- $pairs = array();
-- foreach ($this->_params['dn'] as $param) {
-- if (isset($attributes[$param])) {
-- $pairs[] = array($param, $attributes[$param]);
-- }
-- }
-- $newrdn = $this->_quoteDN($pairs);
-- } else {
-+ $newrdn = $this->_makeRDN($attributes);
-+ if ($newrdn == '') {
- return PEAR::raiseError(_("Missing DN in LDAP source configuration."));
- }
-
-@@ -351,6 +351,30 @@
- }
-
- /**
-+ * Build a RDN based on a set of attributes and what attributes
-+ * make a RDN for the current source.
-+ *
-+ * @param array $attributes The attributes (in driver keys) of the
-+ * object being added.
-+ *
-+ * @return string The RDN for the new object.
-+ */
-+ function _makeRDN($attributes)
-+ {
-+ if (!is_array($this->_params['dn'])) {
-+ return '';
-+ }
-+
-+ $pairs = array();
-+ foreach ($this->_params['dn'] as $param) {
-+ if (isset($attributes[$param])) {
-+ $pairs[] = array($param, $attributes[$param]);
-+ }
-+ }
-+ return $this->_quoteDN($pairs);
-+ }
-+
-+ /**
- * Build a DN based on a set of attributes and what attributes
- * make a DN for the current source.
- *
-@@ -361,18 +385,7 @@
- */
- function _makeKey($attributes)
- {
-- $dn = '';
-- if (is_array($this->_params['dn'])) {
-- $pairs = array();
-- foreach ($this->_params['dn'] as $param) {
-- if (isset($attributes[$param])) {
-- $pairs[] = array($param, $attributes[$param]);
-- }
-- }
-- $dn = $this->_quoteDN($pairs);
-- }
--
-- return $dn . ',' . $this->_params['root'];
-+ return $this->_makeRDN($attributes) . ',' . $this->_params['root'];
- }
-
- /**
-@@ -626,14 +639,9 @@
- */
- function _isPostalAddress($attribute)
- {
-- $syntax = $this->_getSyntax($attribute);
--
-- /** LDAP postal address syntax
-+ /* LDAP postal address syntax is
- * 1.3.6.1.4.1.1466.115.121.1.41 */
-- if ($syntax == "1.3.6.1.4.1.1466.115.121.1.41") {
-- return true;
-- }
-- return false;
-+ return $this->_getSyntax($attribute) == '1.3.6.1.4.1.1466.115.121.1.41';
- }
-
- /**
-@@ -651,13 +659,17 @@
- if (is_a($schema, 'PEAR_Error')) {
+--- turba-2.1.2/lib/Driver/ldap.php 2006-08-02 11:30:32.313829885 +0300
++++ co.php?r=1.83&p=1&f=turba%2Flib%2FDriver%2Fldap.php 2006-08-02 11:32:25.536404778 +0300
+@@ -684,12 +660,16 @@
return $schema;
}
-- $attv = $schema->get('attribute', $att);
+- $attv = $schema->get('attribute', $att);
- if (isset($attv['syntax'])) {
- return $attv['syntax'];
- } else {
@@ -145,12 +22,3 @@
}
/**
-@@ -680,7 +692,7 @@
-
- $config = array('host' => $this->_params['server'],
- 'port' => $this->_params['port']);
-- $ldap = &new Net_LDAP($config);
-+ $ldap = new Net_LDAP($config);
- $ldap->_link = $this->_ds;
-
- $_schema = &$ldap->schema();
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/turba-attrcache.patch?r1=1.1&r2=1.2&f=u
More information about the pld-cvs-commit
mailing list