Rename all the datas to data
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2512 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
20
authldap.php
20
authldap.php
@@ -22,7 +22,7 @@ class authldap extends auth
|
||||
public $ldapfilter = "(mail=%s)";
|
||||
/** Field used to identify a user */
|
||||
public $ldapfield = "mail";
|
||||
/** Filter used to find the available datas of an authenticated user */
|
||||
/** Filter used to find the available data of an authenticated user */
|
||||
public $ldapfiltersearch = "(objectClass=inetOrgPerson)";
|
||||
|
||||
/** The opened LDAP connection identifier */
|
||||
@@ -83,13 +83,13 @@ class authldap extends auth
|
||||
$this->ldapfiltersearch);
|
||||
if ($search === FALSE)
|
||||
throw new Exception ("Can not found the details for user", 401);
|
||||
$datas = ldap_get_entries ($this->ldapconn, $search);
|
||||
$data = ldap_get_entries ($this->ldapconn, $search);
|
||||
$res = array ();
|
||||
if (isset ($datas[0]))
|
||||
if (isset ($data[0]))
|
||||
{
|
||||
$res = array ("lastname"=>$datas[0]["sn"][0],
|
||||
"firstname"=>$datas[0]["givenname"][0],
|
||||
"email"=>$datas[0]["mail"][0]);
|
||||
$res = array ("lastname"=>$data[0]["sn"][0],
|
||||
"firstname"=>$data[0]["givenname"][0],
|
||||
"email"=>$data[0]["mail"][0]);
|
||||
}
|
||||
|
||||
return $res;
|
||||
@@ -129,22 +129,22 @@ class authldap extends auth
|
||||
if ($search === FALSE)
|
||||
throw new Exception ("Unable to search the users in LDAP", 500);
|
||||
$info = ldap_get_entries ($this->ldapconn, $search);
|
||||
$datas = array ();
|
||||
$data = array ();
|
||||
foreach ($info as $key=>$vals)
|
||||
{
|
||||
if ($key === "count") continue;
|
||||
if (isset ($vals["sn"][0]) && isset ($vals["givenname"][0]) &&
|
||||
isset ($vals["mail"]))
|
||||
{
|
||||
$datas[$key] = array ("lastname"=>$vals["sn"][0],
|
||||
$data[$key] = array ("lastname"=>$vals["sn"][0],
|
||||
"firstname"=>$vals["givenname"][0],
|
||||
"email"=>$vals["mail"][0]);
|
||||
}
|
||||
|
||||
unset ($datas[$key]["mail"]["count"]);
|
||||
unset ($data[$key]["mail"]["count"]);
|
||||
}
|
||||
|
||||
return $datas;
|
||||
return $data;
|
||||
}
|
||||
|
||||
/** Close the LDAP connection when closing the object or PHP */
|
||||
|
||||
Reference in New Issue
Block a user