ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Public Member Functions | |
__construct ($hostname, $enable_tls=true, $debug=false, $timeout=0, $port=389, $referrals=true) | |
Private constructor restricts instantiation to getInstance(). More... | |
searchfordn ($base, $attribute, $value, $allowZeroHits=false, $searchFilter=null, $scope='subtree') | |
Search for a DN. More... | |
searchformultiple ($bases, $filters, $attributes=array(), $and=true, $escape=true, $scope='subtree') | |
This method was created specifically for the ldap:AttributeAddUsersGroups->searchActiveDirectory() method, but could be used for other LDAP search needs. More... | |
bind ($dn, $password, array $sasl_args=null) | |
Bind to LDAP with a specific DN and password. More... | |
setOption ($option, $value) | |
Applies an LDAP option to the current connection. More... | |
getAttributes ($dn, $attributes=null, $maxsize=null) | |
Search a given DN for attributes, and return the resulting associative array. More... | |
validate ($config, $username, $password=null) | |
Enter description here... More... | |
whoami ($searchBase, $searchAttributes) | |
ldap_exop_whoami accessor, if available. More... | |
Static Public Member Functions | |
static | escape_filter_value ($values=array(), $singleValue=true) |
Borrowed function from PEAR:LDAP. More... | |
static | asc2hex32 ($string) |
Borrowed function from PEAR:LDAP. More... | |
Protected Attributes | |
$ldap = null | |
$authz_id = null | |
LDAP user: authz_id if SASL is in use, binding dn otherwise. More... | |
$timeout = 0 | |
Private Member Functions | |
makeException ($description, $type=null) | |
Convenience method to create an LDAPException as well as log the description. More... | |
search ($base, $attribute, $value, $searchFilter=null, $scope="subtree") | |
Search for DN from a single base. More... | |
authzid_to_dn ($searchBase, $searchAttributes, $authz_id) | |
Convert SASL authz_id into a DN. More... | |
SimpleSAML_Auth_LDAP::__construct | ( | $hostname, | |
$enable_tls = true , |
|||
$debug = false , |
|||
$timeout = 0 , |
|||
$port = 389 , |
|||
$referrals = true |
|||
) |
Private constructor restricts instantiation to getInstance().
string | $hostname | |
bool | $enable_tls | |
bool | $debug | |
int | $timeout | |
int | $port | |
bool | $referrals |
Definition at line 56 of file LDAP.php.
References $timeout, SimpleSAML\Logger\debug(), ERR_INTERNAL, makeException(), and SimpleSAML\Logger\warning().
|
static |
|
private |
Convert SASL authz_id into a DN.
Definition at line 722 of file LDAP.php.
References $authz_id, and searchfordn().
Referenced by whoami().
SimpleSAML_Auth_LDAP::bind | ( | $dn, | |
$password, | |||
array | $sasl_args = null |
||
) |
Bind to LDAP with a specific DN and password.
Simple wrapper around ldap_bind() with some additional logging.
string | $dn | The DN used. |
string | $password | The password used. |
array | $sasl_args | Array of SASL options for SASL bind |
SimpleSAML_Error_Exception | on other errors |
Definition at line 446 of file LDAP.php.
References $authz_id, $password, SimpleSAML\Logger\debug(), and makeException().
Referenced by validate().
|
static |
Borrowed function from PEAR:LDAP.
Escapes the given VALUES according to RFC 2254 so that they can be safely used in LDAP filters.
Any control characters with an ACII code < 32 as well as the characters with special meaning in LDAP filters "*", "(", ")", and "\" (the backslash) are converted into the representation of a backslash followed by two hex digits representing the hexadecimal value of the character.
string | array | $values | Array of values to escape |
Definition at line 666 of file LDAP.php.
References $key, $values, and SimpleSAML\Utils\Arrays\arrayize().
Referenced by sspmod_ldap_Auth_Process_AttributeAddFromLDAP\process(), and searchformultiple().
SimpleSAML_Auth_LDAP::getAttributes | ( | $dn, | |
$attributes = null , |
|||
$maxsize = null |
|||
) |
Search a given DN for attributes, and return the resulting associative array.
string | $dn | The DN of an element. |
string | array | $attributes | The names of the attribute(s) to retrieve. Defaults to NULL; that is, all available attributes. Note that this is not very effective. |
int | $maxsize | The maximum size of any attribute's value(s). If exceeded, the attribute will not be returned. |
Definition at line 545 of file LDAP.php.
References $attributes, $description, $i, $name, $result, $values, SimpleSAML\Logger\debug(), makeException(), size, and SimpleSAML\Logger\warning().
Referenced by validate().
|
private |
Convenience method to create an LDAPException as well as log the description.
string | $description | The exception's description |
Definition at line 124 of file LDAP.php.
References $description, $type, SimpleSAML\Logger\error(), SimpleSAML\Logger\info(), and SimpleSAML\Logger\warning().
Referenced by __construct(), bind(), getAttributes(), search(), searchfordn(), searchformultiple(), setOption(), and whoami().
|
private |
Search for DN from a single base.
string | $base | Indication of root of subtree to search |
string | array | $attribute | The attribute name(s) to search for. |
string | $value | The attribute value to search for. Additional search filter |
string | null | $searchFilter | The scope of the search |
string | $scope |
SimpleSAML_Error_Exception | if:
|
SimpleSAML_Error_AuthSource | if:
|
SimpleSAML_Error_UserNotFound | if:
|
Definition at line 208 of file LDAP.php.
References $base, $result, SimpleSAML\Logger\debug(), ERR_AS_DATA_INCONSIST, ERR_NO_USER, and makeException().
Referenced by searchfordn().
SimpleSAML_Auth_LDAP::searchfordn | ( | $base, | |
$attribute, | |||
$value, | |||
$allowZeroHits = false , |
|||
$searchFilter = null , |
|||
$scope = 'subtree' |
|||
) |
Search for a DN.
string | array | $base | The base, or bases, which to search from. |
string | array | $attribute | The attribute name(s) searched for. |
string | $value | The attribute value searched for. |
bool | $allowZeroHits | Determines if the method will throw an exception if no hits are found. Defaults to FALSE. |
string | null | $searchFilter | Additional searchFilter to be added to the (attribute=value) filter |
string | $scope | The scope of the search |
SimpleSAML_Error_AuthSource | if:
|
SimpleSAML_Error_UserNotFound | if:
|
Definition at line 291 of file LDAP.php.
References $base, $current, $result, SimpleSAML\Utils\Arrays\arrayize(), SimpleSAML\Logger\debug(), makeException(), and search().
Referenced by authzid_to_dn(), and validate().
SimpleSAML_Auth_LDAP::searchformultiple | ( | $bases, | |
$filters, | |||
$attributes = array() , |
|||
$and = true , |
|||
$escape = true , |
|||
$scope = 'subtree' |
|||
) |
This method was created specifically for the ldap:AttributeAddUsersGroups->searchActiveDirectory() method, but could be used for other LDAP search needs.
It will search LDAP and return all the entries.
Exception |
string | array | $bases | |
string | array | $filters | Array of 'attribute' => 'values' to be combined into the filter, or a raw filter string |
string | array | $attributes | Array of attributes requested from LDAP |
bool | $and | If multiple filters defined, then either bind them with & or | |
bool | $escape | Weather to escape the filter values or not |
string | $scope | The scope of the search |
Definition at line 335 of file LDAP.php.
References $attributes, $base, $i, $name, $result, $results, ERR_INTERNAL, ERR_NO_USER, escape_filter_value(), and makeException().
SimpleSAML_Auth_LDAP::setOption | ( | $option, | |
$value | |||
) |
Applies an LDAP option to the current connection.
Exception |
$option | |
$value |
Definition at line 510 of file LDAP.php.
References SimpleSAML\Logger\debug(), ERR_INTERNAL, and makeException().
SimpleSAML_Auth_LDAP::validate | ( | $config, | |
$username, | |||
$password = null |
|||
) |
Enter description here...
array | $config | |
string | $username | |
string | $password |
Definition at line 618 of file LDAP.php.
References $attributes, $config, $password, bind(), getAttributes(), SimpleSAML\Logger\info(), and searchfordn().
Referenced by sspmod_cas_Auth_Source_CAS\finalStep().
SimpleSAML_Auth_LDAP::whoami | ( | $searchBase, | |
$searchAttributes | |||
) |
ldap_exop_whoami accessor, if available.
Use requested authz_id otherwise.
ldap_exop_whoami() has been provided as a third party patch that waited several years to get its way upstream: http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/databases/php-ldap/files
When it was integrated into PHP repository, the function prototype was changed, The new prototype was used in third party patch for PHP 7.0 and 7.1, hence the version test below.
Definition at line 750 of file LDAP.php.
References $authz_id, authzid_to_dn(), and makeException().
|
protected |
LDAP user: authz_id if SASL is in use, binding dn otherwise.
Definition at line 37 of file LDAP.php.
Referenced by authzid_to_dn(), bind(), and whoami().
|
protected |
Definition at line 44 of file LDAP.php.
Referenced by __construct().