lib/Auth

Aleksander Machniak machniak at kolabsys.com
Wed Sep 11 12:30:48 CEST 2013


 lib/Auth/LDAP.php |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

New commits:
commit 7c4f566db4786079c30f9a6ec6428cd07364b4cb
Author: Aleksander Machniak <alec at alec.pl>
Date:   Wed Sep 11 12:28:41 2013 +0200

    Fix/workaround issue where nsRoleDN is not returned as allowed attribute
    in LDAP schema (of top class) [Bug #1510]

diff --git a/lib/Auth/LDAP.php b/lib/Auth/LDAP.php
index afe68e5..bb0ca93 100644
--- a/lib/Auth/LDAP.php
+++ b/lib/Auth/LDAP.php
@@ -1010,6 +1010,29 @@ class LDAP extends Net_LDAP3 {
     }
 
     /**
+     * Returns attributes available in specified object classes
+     */
+    public function attributes_allowed($objectclasses = array())
+    {
+        $attributes = parent::attributes_allowed($objectclasses);
+
+        // additional special attributes that aren't in LDAP schema
+        $additional_attributes = array(
+            'top' => array('nsRoleDN'),
+        );
+
+        if (!empty($attributes)) {
+            foreach ($additional_attributes as $class => $attrs) {
+                if (in_array($class, $objectclasses)) {
+                    $attributes['may'] = array_merge($attributes['may'], $attrs);
+                }
+            }
+        }
+
+        return $attributes;
+    }
+
+    /**
      * Wrapper for search_entries()
      */
     protected function _list($base_dn, $filter, $scope, $attributes, $search, $params)




More information about the commits mailing list