Add all the phpdocs to the domframework
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1246 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
24
authldap.php
24
authldap.php
@@ -1,24 +1,36 @@
|
||||
<?php
|
||||
/** DomFramework
|
||||
@package domframework
|
||||
@author Dominique Fournier <dominique@fournier38.fr> */
|
||||
|
||||
/** User authentication against LDAP server */
|
||||
class authldap extends auth
|
||||
{
|
||||
/** LDAP server : can be ldaps://server.domain.tld if LDAPS */
|
||||
public $ldapserver="localhost";
|
||||
/** LDAP TCP Port (389 by default) */
|
||||
public $ldapport=389;
|
||||
/** LDAP Connection timeout (5s by default) */
|
||||
public $ldaptimeout=5;
|
||||
/** LDAP authentication to search user */
|
||||
public $ldapauth = "";
|
||||
/** LDAP authentication password */
|
||||
public $ldappwd = "";
|
||||
/** LDAP Search base */
|
||||
public $ldapbase = "";
|
||||
/** Filter used to search user */
|
||||
public $ldapfilter = "(mail=%s)";
|
||||
/** Field used to identify a user */
|
||||
public $ldapfield = "mail";
|
||||
/** Filter used to find the available datas of an authenticated user */
|
||||
public $ldapfiltersearch = "(objectClass=inetOrgPerson)";
|
||||
|
||||
/** The opened LDAP connection identifier */
|
||||
private $ldapconn = NULL;
|
||||
/** The DN of the user when found */
|
||||
private $ldapdnuser = NULL;
|
||||
|
||||
/** Check the availability of LDAP functions in PHP */
|
||||
function __construct ()
|
||||
{
|
||||
if (!function_exists ("ldap_connect"))
|
||||
@@ -41,7 +53,9 @@ class authldap extends auth
|
||||
throw new Exception ("Authentication error in pre-auth LDAP", 500);
|
||||
}
|
||||
|
||||
/** Try to authenticate the email/password of the user */
|
||||
/** Try to authenticate the email/password of the user
|
||||
@param string $email Email to authenticate
|
||||
@param string $password Password to authenticate */
|
||||
public function authentication ($email, $password)
|
||||
{
|
||||
$filter = sprintf ($this->ldapfilter, $email, $email, $email, $email);
|
||||
@@ -60,7 +74,7 @@ class authldap extends auth
|
||||
$this->ldapdnuser = $dn;
|
||||
}
|
||||
|
||||
/** Return all the parameters recorded for the authenticate user */
|
||||
/** Return all the parameters recorded for the authenticate user */
|
||||
public function getdetails ()
|
||||
{
|
||||
if ($this->ldapdnuser === NULL)
|
||||
@@ -81,7 +95,10 @@ class authldap extends auth
|
||||
return $res;
|
||||
}
|
||||
|
||||
/** Method to change the password */
|
||||
/** Method to change the password
|
||||
@param string $oldpassword The old password (to check if the user have the
|
||||
rights to change the password)
|
||||
@param string $newpassword The new password to be recorded */
|
||||
public function changepassword ($oldpassword, $newpassword)
|
||||
{
|
||||
throw new Exception (_("The password can't be change for LDAP users"), 405);
|
||||
@@ -117,6 +134,7 @@ class authldap extends auth
|
||||
return $datas;
|
||||
}
|
||||
|
||||
/** Close the LDAP connection when closing the object or PHP */
|
||||
function __destruct ()
|
||||
{
|
||||
if (isset ($this->ldapconn))
|
||||
|
||||
Reference in New Issue
Block a user