ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLDAPPlugin.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26abstract class ilLDAPPlugin extends ilPlugin
27{
31 protected function checkValue(array $a_user_data, string $a_keyword, string $a_value): bool
32 {
33 if (!$a_user_data[$a_keyword]) {
34 return false;
35 }
36
37 if (is_array($a_user_data[$a_keyword])) {
38 foreach ($a_user_data[$a_keyword] as $values) {
39 if (strcasecmp(trim($values), $a_value) === 0) {
40 return true;
41 }
42 }
43 return false;
44 }
45
46 if (strcasecmp(trim($a_user_data[$a_keyword]), trim($a_value)) === 0) {
47 return true;
48 }
49
50 return false;
51 }
52}
Plugin definition.
checkValue(array $a_user_data, string $a_keyword, string $a_value)
Check if user data matches a keyword value combination.