◆ __construct()
ilAuthModeDetermination::__construct |
( |
| ) |
|
|
private |
◆ _getInstance()
static ilAuthModeDetermination::_getInstance |
( |
| ) |
|
|
static |
◆ getAuthModeSequence()
ilAuthModeDetermination::getAuthModeSequence |
( |
string |
$a_username = '' | ) |
|
- Returns
- list<numeric-string|int|string>
Definition at line 80 of file class.ilAuthModeDetermination.php.
References $message, $position, $server, ilLDAPServer\getInstanceByServerId(), ilLDAPServer\getServerIdByAuthMode(), ILIAS\Repository\logger(), and ilAuthUtils\REGEX_DELIMITERS.
82 if ($a_username ===
'') {
87 foreach ($this->position as $auth_key) {
91 $this->
logger->debug(
'Validating username filter for ' .
$server->getName());
92 if (
$server->getUsernameFilter() !==
'') {
94 $pattern = str_replace(
'*',
'.*?',
$server->getUsernameFilter());
97 $this->
logger->debug(
'Trying pattern to match username:' . $pattern .
' => ' . $a_username);
98 set_error_handler(
static function (
int $severity,
string $message,
string $file,
int $line): never {
99 throw new ErrorException($message, $severity, $severity, $file, $line);
103 if (preg_match($delimiter .
'^' . $pattern .
'$' . $delimiter .
'i', $a_username) === 1) {
104 $this->
logger->debug(
'Filter matches for ' . $a_username);
105 array_unshift($sorted, $auth_key);
110 $this->
logger->warning(
'Error occurred in preg_match Ex.: ' . $ex->getMessage());
112 restore_error_handler();
116 $this->
logger->debug(
'Filter matches not for ' . $a_username .
' <-> ' .
$server->getUsernameFilter());
119 $sorted[] = $auth_key;
static getInstanceByServerId(int $a_server_id)
Get instance by server id.
const array REGEX_DELIMITERS
static getServerIdByAuthMode(string $a_auth_mode)
Get auth id by auth mode.
◆ getCountActiveAuthModes()
ilAuthModeDetermination::getCountActiveAuthModes |
( |
| ) |
|
◆ getKind()
ilAuthModeDetermination::getKind |
( |
| ) |
|
◆ isManualSelection()
ilAuthModeDetermination::isManualSelection |
( |
| ) |
|
◆ read()
ilAuthModeDetermination::read |
( |
| ) |
|
|
private |
Definition at line 152 of file class.ilAuthModeDetermination.php.
References $server, ilLDAPServer\_getActiveServerList(), ilAuthUtils\AUTH_APACHE, ilAuthUtils\AUTH_LDAP, ilAuthUtils\AUTH_LOCAL, ilAuthUtils\AUTH_SOAP, ilAuthUtils\getAuthPlugins(), ilLDAPServer\getInstanceByServerId(), ilLDAPServer\getServerIdByAuthMode(), ILIAS\Repository\int(), null, and ILIAS\Repository\settings().
Referenced by __construct().
154 $this->kind = (
int) $this->
settings->get(
'kind', (
string) self::TYPE_MANUAL);
156 $soap_active = (bool) $this->commonSettings->get(
'soap_auth_active',
'');
158 $apache_settings =
new ilSetting(
'apache_auth');
159 $apache_active = $apache_settings->get(
'apache_enable_auth');
165 if ($auth_mode ===
null) {
170 switch ((
int) $auth_mode) {
172 $this->position[] = (
int) $auth_mode;
177 if ($auth_id ===
null) {
183 $this->position[] = $auth_mode;
189 $this->position[] = (
int) $auth_mode;
194 if ($apache_active) {
195 $this->position[] = (
int) $auth_mode;
201 if ($pl->isAuthActive((
int) $auth_mode)) {
202 $this->position[] = (
int) $auth_mode;
230 foreach ($pl->getAuthIds() as $auth_id) {
231 if ($pl->isAuthActive($auth_id) && !in_array($auth_id, $this->position,
true)) {
232 $this->position[] = $auth_id;
static getInstanceByServerId(int $a_server_id)
Get instance by server id.
static _getActiveServerList()
Get active server list.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getServerIdByAuthMode(string $a_auth_mode)
Get auth id by auth mode.
◆ save()
ilAuthModeDetermination::save |
( |
| ) |
|
◆ setAuthModeSequence()
ilAuthModeDetermination::setAuthModeSequence |
( |
array |
$a_pos | ) |
|
◆ setKind()
ilAuthModeDetermination::setKind |
( |
int |
$a_kind | ) |
|
- Parameters
-
int<self::TYPE_MANUAL|self::TYPE_AUTOMATIC> | $a_kind |
Definition at line 68 of file class.ilAuthModeDetermination.php.
70 if (!in_array($a_kind, [self::TYPE_MANUAL, self::TYPE_AUTOMATIC],
true)) {
74 $this->kind = $a_kind;
◆ $commonSettings
ilSetting ilAuthModeDetermination::$commonSettings |
|
private |
◆ $instance
◆ $kind
int ilAuthModeDetermination::$kind = self::TYPE_MANUAL |
|
private |
◆ $logger
ilLogger ilAuthModeDetermination::$logger |
|
private |
◆ $position
array ilAuthModeDetermination::$position = [] |
|
private |
◆ $settings
◆ TYPE_AUTOMATIC
const int ilAuthModeDetermination::TYPE_AUTOMATIC = 1 |
◆ TYPE_MANUAL
const int ilAuthModeDetermination::TYPE_MANUAL = 0 |
The documentation for this class was generated from the following file: