From b862c916182e83cc88ed9a3060161d16603d4210 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Fri, 16 Sep 2011 10:08:05 +0000 Subject: [PATCH] fix ldap auth plugin, broke a lot of userlevel stuff a long time ago due to mysql layer changes git-svn-id: http://www.observium.org/svn/observer/trunk@2482 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/authentication/ldap.inc.php | 4 ++-- html/includes/authentication/mysql.inc.php | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/html/includes/authentication/ldap.inc.php b/html/includes/authentication/ldap.inc.php index 636eebe11..c091d4b2d 100644 --- a/html/includes/authentication/ldap.inc.php +++ b/html/includes/authentication/ldap.inc.php @@ -67,13 +67,13 @@ function user_exists($username) function get_userlevel($username) { # FIXME should come from LDAP - return dbFetchRow("SELECT `level` FROM `users` WHERE `username` = ?", array($username)); + return dbFetchCell("SELECT `level` FROM `users` WHERE `username` = ?", array($username)); } function get_userid($username) { # FIXME should come from LDAP - return dbFetchRow("SELECT `user_id` FROM `users` WHERE `username` = ?", array($username)); + return dbFetchCell("SELECT `user_id` FROM `users` WHERE `username` = ?", array($username)); } function deluser($username) diff --git a/html/includes/authentication/mysql.inc.php b/html/includes/authentication/mysql.inc.php index c0cac2cf2..7f39ec19b 100644 --- a/html/includes/authentication/mysql.inc.php +++ b/html/includes/authentication/mysql.inc.php @@ -26,14 +26,13 @@ function authenticate($username,$password) function passwordscanchange($username="") { - - /* * By default allow the password to be modified, unless the existing * user is explicitly prohibited to do so. */ - if (empty($username) || !user_exists($username)) { + if (empty($username) || !user_exists($username)) + { return 1; } else { return dbFetchCell("SELECT can_modify_passwd FROM users WHERE username = ?", array($username));