R32989 - /branches/1.8/phpgwapi/inc/class.auth_ldap.inc.php

Author: ralfbecker
New Revision: 32989

URL: http://www.egroupware.org/viewvc/egroupware?rev=32989&view=rev
Log:
debug switch to get Apache error_log message, why logins fail

Modified:
branches/1.8/phpgwapi/inc/class.auth_ldap.inc.php

Modified: branches/1.8/phpgwapi/inc/class.auth_ldap.inc.php
URL: http://www.egroupware.org/viewvc/egroupware/branches/1.8/phpgwapi/inc/class.auth_ldap.inc.php?rev=32989&r1=32988&r2=32989&view=diff

— branches/1.8/phpgwapi/inc/class.auth_ldap.inc.php (original)
+++ branches/1.8/phpgwapi/inc/class.auth_ldap.inc.php Tue Nov 16 09:55:16 2010
@@ -20,6 +20,12 @@
class auth_ldap implements auth_backend
{
var $previous_login = -1;

  • /**

    • Switch this on to get messages in Apache error_log, why authtication fails
    • @var boolean
  • */

  • var $debug = false;

    /**

    • authentication against LDAP
      @@ -44,6 +50,7 @@
      /* Login with the LDAP Admin. User to find the User DN. */
      if(!@ldap_bind($ldap, $GLOBALS[‘egw_info’][‘server’][‘ldap_root_dn’], $GLOBALS[‘egw_info’][‘server’][‘ldap_root_pw’]))
      {
  •   	if ($this->debug) error_log(__METHOD__."('$username',\$password) can NOT bind with ldap_root_dn to search!");
      	return False;
      }
      /* find the dn for this uid, the uid is not always in the dn */
    

@@ -64,11 +71,13 @@
if ($GLOBALS[‘egw_info’][‘server’][‘case_sensitive_username’] == true &&
$allValues[0][‘uid’][0] != $username)
{

  •   		if ($this->debug) error_log(__METHOD__."('$username',\$password) wrong case in username!");
      		return false;
      	}
      	if ($GLOBALS['egw_info']['server']['account_repository'] == 'ldap' &&
      		isset($allValues[0]['shadowexpire']) && $allValues[0]['shadowexpire'][0]*24*3600 < time())
      	{
    
  •   		if ($this->debug) error_log(__METHOD__."('$username',\$password) account is expired!");
      		return false;	// account is expired
      	}
      	$userDN = $allValues[0]['dn'];
    

@@ -95,12 +104,15 @@
}
return True;
}

  •   			return ($id = $GLOBALS['egw']->accounts->name2id($username,'account_lid','u')) &&
    
  •   			$ret = ($id = $GLOBALS['egw']->accounts->name2id($username,'account_lid','u')) &&
      				$GLOBALS['egw']->accounts->id2name($id,'account_status') == 'A';
    
  •   			if ($this->debug && !$ret) error_log(__METHOD__."('$username',\$password) account NOT active!");
    
  •   			return $ret;
      		}
      		return True;
      	}
      }
    
  •   if ($this->debug) error_log(__METHOD__."('$username','$password') dn not found or password wrong!");
      // dn not found or password wrong
      return False;
    
    }

Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev


eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs