|
| $priority = 50 |
| Priority of this filter. More...
|
|
| getLdap () |
| Getter for the LDAP connection object. More...
|
|
| var_export ($value) |
| Local utility function to get details about a variable, basically converting it to a string to be used in a log message. More...
|
|
Definition at line 35 of file AttributeAddFromLDAP.php.
◆ __construct()
sspmod_ldap_Auth_Process_AttributeAddFromLDAP::__construct |
( |
|
$config, |
|
|
|
$reserved |
|
) |
| |
Initialize this filter.
- Parameters
-
array | $config | Configuration information about this filter. |
mixed | $reserved | For future use. |
Definition at line 67 of file AttributeAddFromLDAP.php.
References sspmod_ldap_Auth_Process_BaseFilter\$config, and array.
73 if (isset(
$config[
'ldap_host'])) {
76 if (isset(
$config[
'ldap_port'])) {
79 if (isset(
$config[
'ldap_bind_user'])) {
82 if (isset(
$config[
'ldap_bind_pwd'])) {
85 if (isset(
$config[
'userid_attribute'])) {
88 if (isset(
$config[
'ldap_search_base_dn'])) {
91 if (isset(
$config[
'ldap_search_filter'])) {
94 if (isset(
$config[
'ldap_search_attribute'])) {
97 if (isset(
$config[
'new_attribute_name'])) {
111 $config[
'ldap_search_base_dn'],
113 $config[
'ldap_search_attribute'],
118 parent::__construct(
$config, $reserved);
121 $this->search_attributes = $this->config->getArrayize(
'attributes',
array());
122 if (empty($this->search_attributes)) {
123 $new_attribute = $this->config->getString(
'attribute.new',
'');
124 $this->search_attributes[$new_attribute] = $this->config->getString(
'search.attribute');
126 $this->search_filter = $this->config->getString(
'search.filter');
129 $this->attr_policy = $this->config->getString(
'attribute.policy',
'merge');
Create styles array
The data for the language used.
◆ process()
sspmod_ldap_Auth_Process_AttributeAddFromLDAP::process |
( |
& |
$request | ) |
|
Add attributes from an LDAP server.
- Parameters
-
array | &$request | The current request |
Definition at line 138 of file AttributeAddFromLDAP.php.
References $attributes, sspmod_ldap_Auth_Process_BaseFilter\$ldap, $name, $target, array, SimpleSAML_Auth_LDAP\escape_filter_value(), sspmod_ldap_Auth_Process_BaseFilter\getLdap(), SimpleSAML\Logger\info(), and SimpleSAML\Logger\warning().
140 assert(
'is_array($request)');
141 assert(
'array_key_exists("Attributes", $request)');
149 $arrSearch[] =
'%'.$attr.
'%';
151 if (strlen($val[0]) > 0) {
159 $filter = str_replace($arrSearch, $arrReplace, $this->search_filter);
161 if (strpos($filter,
'%') !==
false) {
163 $this->search_filter.
')');
167 if (!in_array($this->attr_policy,
array(
'merge',
'replace',
'add'),
true)) {
169 "'replace' or 'add'.");
183 $entries =
$ldap->searchformultiple(
186 array_values($this->search_attributes),
195 foreach ($entries as $entry) {
196 foreach ($this->search_attributes as
$target =>
$name) {
205 if (isset($entry[
$name])) {
206 unset($entry[$name][
'count']);
208 foreach (array_values($entry[$name]) as $value) {
209 if ($this->attr_policy ===
'merge') {
210 if (!in_array($value,
$attributes[$target],
true)) {
static escape_filter_value($values=array(), $singleValue=true)
Borrowed function from PEAR:LDAP.
Create styles array
The data for the language used.
getLdap()
Getter for the LDAP connection object.
◆ $attr_policy
sspmod_ldap_Auth_Process_AttributeAddFromLDAP::$attr_policy |
|
protected |
◆ $search_attributes
sspmod_ldap_Auth_Process_AttributeAddFromLDAP::$search_attributes |
|
protected |
◆ $search_filter
sspmod_ldap_Auth_Process_AttributeAddFromLDAP::$search_filter |
|
protected |
The documentation for this class was generated from the following file: