mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
Don't rely on case sensitive usernames in navigation items stored in INI files
refs #11051
This commit is contained in:
parent
001c63e376
commit
a5924f2ca8
@ -172,7 +172,7 @@ class Web extends EmbeddedWeb
|
|||||||
{
|
{
|
||||||
// TODO: Provide a more sophisticated solution
|
// TODO: Provide a more sophisticated solution
|
||||||
|
|
||||||
if (isset($config['owner']) && $config['owner'] === $this->user->getUsername()) {
|
if (isset($config['owner']) && strtolower($config['owner']) === strtolower($this->user->getUsername())) {
|
||||||
unset($config['owner']);
|
unset($config['owner']);
|
||||||
unset($config['users']);
|
unset($config['users']);
|
||||||
unset($config['groups']);
|
unset($config['groups']);
|
||||||
@ -195,7 +195,7 @@ class Web extends EmbeddedWeb
|
|||||||
|
|
||||||
if (isset($config['users'])) {
|
if (isset($config['users'])) {
|
||||||
$users = array_map('trim', explode(',', strtolower($config['users'])));
|
$users = array_map('trim', explode(',', strtolower($config['users'])));
|
||||||
if (in_array('*', $users, true) || in_array($this->user->getUsername(), $users, true)) {
|
if (in_array('*', $users, true) || in_array(strtolower($this->user->getUsername()), $users, true)) {
|
||||||
unset($config['owner']);
|
unset($config['owner']);
|
||||||
unset($config['users']);
|
unset($config['users']);
|
||||||
unset($config['groups']);
|
unset($config['groups']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user