mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 01:04:09 +02:00
Make regular expression pattern in autologin backend being fully optional
This commit is contained in:
parent
09945994b8
commit
8c62c66a4e
@ -50,7 +50,6 @@ class AutologinBackendForm extends Form
|
|||||||
'text',
|
'text',
|
||||||
'strip_username_regexp',
|
'strip_username_regexp',
|
||||||
array(
|
array(
|
||||||
'required' => true,
|
|
||||||
'label' => t('Backend Domain Pattern'),
|
'label' => t('Backend Domain Pattern'),
|
||||||
'description' => t('The domain pattern of this authentication backend'),
|
'description' => t('The domain pattern of this authentication backend'),
|
||||||
'value' => '/\@[^$]+$/',
|
'value' => '/\@[^$]+$/',
|
||||||
|
@ -220,7 +220,7 @@ class AdminAccountPage extends Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
$name = $_SERVER['REMOTE_USER'];
|
$name = $_SERVER['REMOTE_USER'];
|
||||||
if (isset($this->backendConfig['strip_username_regexp'])) {
|
if (isset($this->backendConfig['strip_username_regexp']) && $this->backendConfig['strip_username_regexp']) {
|
||||||
// No need to silence or log anything here because the pattern has
|
// No need to silence or log anything here because the pattern has
|
||||||
// already been successfully compiled during backend configuration
|
// already been successfully compiled during backend configuration
|
||||||
$name = preg_replace($this->backendConfig['strip_username_regexp'], '', $name);
|
$name = preg_replace($this->backendConfig['strip_username_regexp'], '', $name);
|
||||||
|
@ -54,7 +54,7 @@ class AutoLoginBackend extends UserBackend
|
|||||||
if (isset($_SERVER['REMOTE_USER'])) {
|
if (isset($_SERVER['REMOTE_USER'])) {
|
||||||
$username = $_SERVER['REMOTE_USER'];
|
$username = $_SERVER['REMOTE_USER'];
|
||||||
$user->setRemoteUserInformation($username, 'REMOTE_USER');
|
$user->setRemoteUserInformation($username, 'REMOTE_USER');
|
||||||
if ($this->stripUsernameRegexp !== null) {
|
if ($this->stripUsernameRegexp) {
|
||||||
$stripped = preg_replace($this->stripUsernameRegexp, '', $username);
|
$stripped = preg_replace($this->stripUsernameRegexp, '', $username);
|
||||||
if ($stripped !== false) {
|
if ($stripped !== false) {
|
||||||
// TODO(el): PHP issues a warning when PHP cannot compile the regular expression. Should we log an
|
// TODO(el): PHP issues a warning when PHP cannot compile the regular expression. Should we log an
|
||||||
|
Loading…
x
Reference in New Issue
Block a user