lib/Auth

Aleksander Machniak machniak at kolabsys.com
Fri Aug 29 09:18:02 CEST 2014


 lib/Auth/LDAP.php |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 7ffbe89530f0a355bb628b453a7766e68d1d2968
Author: Aleksander Machniak <machniak at kolabsys.com>
Date:   Mon Aug 25 21:24:23 2014 -0400

    Use consistent logging function

diff --git a/lib/Auth/LDAP.php b/lib/Auth/LDAP.php
index 2dfe084..2287e03 100644
--- a/lib/Auth/LDAP.php
+++ b/lib/Auth/LDAP.php
@@ -60,11 +60,11 @@ class LDAP extends Net_LDAP3 {
                 try {
                     $domain = $_SESSION['user']->get_domain();
                 } catch (Exception $e) {
-                    Log::warning("LDAP: User not authenticated yet");
+                    $this->_log(LOG_WARNING, "LDAP: User not authenticated yet");
                 }
             }
         } else {
-            Log::debug("LDAP: __construct() using domain $domain");
+            $this->_log(LOG_DEBUG, "LDAP: __construct() using domain $domain");
         }
 
         // Continue and default to the primary domain.
@@ -127,7 +127,7 @@ class LDAP extends Net_LDAP3 {
      */
     public function authenticate($username, $password, $domain = NULL)
     {
-        Log::debug("Auth::LDAP: authentication request for $username against domain $domain");
+        $this->_log(LOG_DEBUG, "Auth::LDAP: authentication request for $username against domain $domain");
 
         if (!$this->connect()) {
             return false;
@@ -302,7 +302,7 @@ class LDAP extends Net_LDAP3 {
                         $attrs['nsslapd-directory'] = $this->nsslapd_directory($ldap, $domain);
                     }
                     if (!$ldap->add_entry($dn, $attrs)) {
-                        Log::error("Error adding $dn to $replica_host");
+                        $this->_log(LOG_ERR, "Error adding $dn to $replica_host");
                     }
                 }
                 $ldap->close();
@@ -314,7 +314,7 @@ class LDAP extends Net_LDAP3 {
                     $attrs['nsslapd-directory'] = $this->nsslapd_directory($this, $domain);
                 }
                 if (!$this->add_entry($dn, $attrs)) {
-                    Log::error("Error adding $dn");
+                    $this->_log(LOG_ERR, "Error adding $dn");
                 }
             }
         }
@@ -1110,7 +1110,7 @@ class LDAP extends Net_LDAP3 {
             $unique_attr = 'nsuniqueid';
         }
 
-        Log::trace("Using unique_attribute " . var_export($unique_attr, TRUE) . " at " . __FILE__ . ":" . __LINE__);
+        $this->_log(LOG_NOTICE, "Using unique_attribute " . var_export($unique_attr, TRUE) . " at " . __FILE__ . ":" . __LINE__);
 
         if (!in_array($unique_attr, $attributes)) {
             $attributes[] = $unique_attr;
@@ -1681,7 +1681,7 @@ class LDAP extends Net_LDAP3 {
         // only report once
         if (!$seen["$host:$port"]++) {
             $this->mc_available--;
-            Log::error("Memcache failure on host $host:$port");
+            $this->_log(LOG_ERR, "Memcache failure on host $host:$port");
         }
     }
 




More information about the commits mailing list