- attached ldap.diff
Fallback Auth doesnt work for LDAP/AD
Fallback Auth fails because in /system/database/Ldap.php returns a empty array. But we need null. Because a if isset statement in auth.php returns true.
This patch file was generated by NetBeans IDE
It uses platform neutral UTF-8 encoding and \n newlines.
--- HEAD +++ Modified In Working Tree @@ -57,7 +57,7 @@
$query = new stdClass();
- $query->row = isset($data[0]) ? $data[0] : array();
- $query->row = isset($data[0]) ? $data[0] : null; $query->dn = isset($results[0]['dn']) ? $results[0]['dn'] : ""; $query->rows = $data; $query->num_rows = $results['count'];
Comments (9)
-
reporter -
repo owner where in model/user/auth.php do we need a null return value?
-
reporter /system/database/Ldap.php Row 60
-
repo owner ok, but I was interested in where does it hurt in model/user/auth.php that we get an empty array instead of null? Why does the fallback auth fail?
-
reporter Hi Jsutu, because you return an empty array, and the check in checkLoginAgainstLDAP (/model/user/auth.php) is a if Statement if isset $query->row. But is empty, so I prefer to return null.
private function checkLoginAgainstLDAP($username = '', $password = '') {
$ldap = new LDAP(LDAP_HOST, LDAP_HELPER_DN, LDAP_HELPER_PASSWORD); if($ldap->is_bind_ok()) { $query = $ldap->query(LDAP_BASE_DN, "(&(objectClass=" .
LDAP_ACCOUNT_OBJECTCLASS . ")(" . LDAP_MAIL_ATTR . "=$username))", array());
if(isset($query->row)) { <----------here is the problem
or check is empty
Karsten
Am 17.04.2013 23:16, schrieb jsuto:
-
repo owner I see that. Yesterday i fixed it by checking for
if(isset($query->row['dn'])) {
I think it solves the problem. Would you try this fix? https://bitbucket.org/jsuto/piler/commits/676f479d23a4c83d32b267a51ca6008c634907d3
-
reporter Ok. Problem solved.
-
repo owner - changed status to resolved
-
repo owner -
assigned issue to
-
assigned issue to
- Log in to comment