[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] phpgwapi/inc/auth class.auth_ldap.inc.php
From: |
Dave Hall |
Subject: |
[Phpgroupware-cvs] phpgwapi/inc/auth class.auth_ldap.inc.php |
Date: |
Sat, 09 Sep 2006 11:45:42 +0000 |
CVSROOT: /cvsroot/phpgwapi
Module name: phpgwapi
Changes by: Dave Hall <skwashd> 06/09/09 11:45:42
Modified files:
inc/auth : class.auth_ldap.inc.php
Log message:
fix up error reporting so 1 file doesn't decide what level we should be
using
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/auth/class.auth_ldap.inc.php?cvsroot=phpgwapi&r1=1.2&r2=1.3
Patches:
Index: class.auth_ldap.inc.php
===================================================================
RCS file: /cvsroot/phpgwapi/phpgwapi/inc/auth/class.auth_ldap.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- class.auth_ldap.inc.php 3 Sep 2006 06:15:27 -0000 1.2
+++ class.auth_ldap.inc.php 9 Sep 2006 11:45:42 -0000 1.3
@@ -8,7 +8,7 @@
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General
Public License
* @package phpgwapi
* @subpackage accounts
- * @version $Id: class.auth_ldap.inc.php,v 1.2 2006/09/03 06:15:27
skwashd Exp $
+ * @version $Id: class.auth_ldap.inc.php,v 1.3 2006/09/09 11:45:42
skwashd Exp $
*/
/**
@@ -28,6 +28,13 @@
function authenticate($username, $passwd)
{
+ /*
+ this avoids warings with ldap_bind when user /
password are not correct
+ it is reset before this method is completed
+ */
+ $error_level = error_reporting();
+ error_reporting(0);
+
//Connect as Admin with v3 or v2 in LDAP server
if ( !$ldap = $GLOBALS['phpgw']->common->ldapConnect() )
{
@@ -39,7 +46,6 @@
$attributes = array( 'uid', 'dn', 'phpgwaccountstatus'
);
$sri = ldap_search($ldap,
$GLOBALS['phpgw_info']['server']['ldap_context'], "uid=$username", $attributes);
$allValues = ldap_get_entries($ldap, $sri);
- error_reporting(0); // this avoid waring with ldap_bind
when user / password are not correct
if ($allValues['count'] > 0)
{
// let's check if its an inactive account
@@ -56,21 +62,17 @@
$passwd = crypt(microtime());
}
/* try to bind as the user with user
suplied password */
- if (@ldap_bind($ldap, $userDN, $passwd))
+ if (ldap_bind($ldap, $userDN, $passwd))
{
- @ldap_unbind($ldap); // we
don't need this connection anymore, so avoid a leak.
- error_reporting(7);
+ ldap_unbind($ldap); // we don't
need this connection anymore, so avoid a leak.
+ error_reporting($error_level);
return true;
}
}
}
- else
- {
- }
-
@ldap_unbind($ldap);
/* Turn error reporting back to normal */
- error_reporting(7);
+ error_reporting($error_level);
/* dn not found or password wrong */
return False;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] phpgwapi/inc/auth class.auth_ldap.inc.php,
Dave Hall <=