3 commits - lib/api lib/Auth lib/ext

Aleksander Machniak machniak at kolabsys.com
Mon Jun 17 09:40:48 CEST 2013


 lib/Auth/LDAP.php                        |    1 +
 lib/api/kolab_api_service_form_value.php |   11 ++++++-----
 lib/ext/Net/LDAP3.php                    |   17 ++++++++++++-----
 3 files changed, 19 insertions(+), 10 deletions(-)

New commits:
commit 007150d02911a668b628f05c43dc4a1ca41f4204
Author: Aleksander Machniak <alec at alec.pl>
Date:   Mon Jun 17 09:39:48 2013 +0200

    Add possibility to connect with TLS by setting ldap_uri with tls:// prefix

diff --git a/lib/Auth/LDAP.php b/lib/Auth/LDAP.php
index 1e634ba..ed05389 100644
--- a/lib/Auth/LDAP.php
+++ b/lib/Auth/LDAP.php
@@ -98,6 +98,7 @@ class LDAP extends Net_LDAP3 {
 
         $this->config_set("host", $this->_ldap_server);
         $this->config_set("port", $this->_ldap_port);
+        $this->config_set("use_tls", $this->_ldap_scheme == 'tls');
 
         parent::connect();
 


commit c15fde2a90768673584f6aeb00d58c9f85aaf683
Author: Aleksander Machniak <alec at alec.pl>
Date:   Mon Jun 17 09:39:22 2013 +0200

    Fix PHP Fatal error:  Call to a member function entries() on a non-object

diff --git a/lib/ext/Net/LDAP3.php b/lib/ext/Net/LDAP3.php
index 63bc757..f532010 100644
--- a/lib/ext/Net/LDAP3.php
+++ b/lib/ext/Net/LDAP3.php
@@ -2069,11 +2069,18 @@ class Net_LDAP3
 
         $this->_info("Obtaining supported controls");
         $this->return_attributes = array("supportedcontrol");
-        $result = $this->search("", "(objectclass=*)", 'base');
-        $result = $result->entries(true);
-        $this->_info("Obtained " . count($result['']['supportedcontrol']) . " supported controls");
-        $this->supported_controls = $result['']['supportedcontrol'];
-        return $result['']['supportedcontrol'];
+
+        if ($result = $this->search("", "(objectclass=*)", 'base')) {
+            $result  = $result->entries(true);
+            $control = $result['']['supportedcontrol'];
+        }
+        else {
+            $control = array();
+        }
+
+        $this->_info("Obtained " . count($control) . " supported controls");
+        $this->supported_controls = $control;
+        return $control;
     }
 
     private function _alert()


commit 26c288c8005f2061ed9561f8746f7853b5cf113e
Author: Aleksander Machniak <alec at alec.pl>
Date:   Mon Jun 17 09:35:02 2013 +0200

    Fix PHP Fatal error:  Call to a member function entries() on a non-object

diff --git a/lib/api/kolab_api_service_form_value.php b/lib/api/kolab_api_service_form_value.php
index 2767dc1..707fddb 100644
--- a/lib/api/kolab_api_service_form_value.php
+++ b/lib/api/kolab_api_service_form_value.php
@@ -1013,14 +1013,15 @@ class kolab_api_service_form_value extends kolab_api_service
             $default = $base_dn;
         }
 
-        $ous  = $auth->search($base_dn, '(objectclass=organizationalunit)');
         $_ous = array();
 
-        foreach ($ous->entries(true) as $ou_dn => $ou_attrs) {
-            $_ous[] = strtolower($ou_dn);
-        }
+        if ($ous = $auth->search($base_dn, '(objectclass=organizationalunit)')) {
+            foreach ($ous->entries(true) as $ou_dn => $ou_attrs) {
+                $_ous[] = strtolower($ou_dn);
+            }
 
-        sort($_ous);
+            sort($_ous);
+        }
 
         return array(
             'list'    => $_ous,





More information about the commits mailing list