From 581b6b41fd51549fe05afede9da647ccf6297660 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Wed, 27 Aug 2014 08:46:57 -0400
Subject: [PATCH] Make possible to set vacation start/end date and time

---
 program/lib/Net/LDAP3.php |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/program/lib/Net/LDAP3.php b/program/lib/Net/LDAP3.php
index b101b4a..3202f5a 100644
--- a/program/lib/Net/LDAP3.php
+++ b/program/lib/Net/LDAP3.php
@@ -481,7 +481,7 @@
             return true;
         }
 
-        $this->_debug("C: Bind [dn: $bind_dn] [pass: $bind_pw]");
+        $this->_debug("C: Bind [dn: $bind_dn]");
 
         if (@ldap_bind($this->conn, $bind_dn, $bind_pw)) {
             $this->_debug("S: OK");
@@ -1435,7 +1435,7 @@
             $method = 'DIGEST-MD5';
         }
 
-        $this->_debug("C: Bind [mech: $method, authc: $authc, authz: $authz] [pass: $pass]");
+        $this->_debug("C: Bind [mech: $method, authc: $authc, authz: $authz]");
 
         if (ldap_sasl_bind($this->conn, null, $pass, $method, null, $authc, $authz)) {
             $this->_debug("S: OK");
@@ -1847,12 +1847,15 @@
                         // Not passing any sort attributes means you don't care
                         if (!empty($sort_attrs)) {
                             $sort_attrs = (array) $sort_attrs;
-                            if (count(array_intersect($sort_attrs, $vlv_index[$base_dn]['sort'])) == count($sort_attrs)) {
-                                return $sort_attrs;
+                            foreach ($vlv_index[$base_dn]['sort'] as $sss_config) {
+                                if (count(array_intersect($sort_attrs, $sss_config)) == count($sort_attrs)) {
+                                    return $sort_attrs;
+                                }
                             }
-                            else {
-                                return false;
-                            }
+
+                            $this->_error("The requested sorting does not match any server-side sorting configuration");
+
+                            return false;
                         }
                         else {
                             return $vlv_index[$base_dn]['sort'][0];

--
Gitblit v1.9.1