diff options
Diffstat (limited to 'library/Director/Web/Form/DirectorObjectForm.php')
-rw-r--r-- | library/Director/Web/Form/DirectorObjectForm.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/library/Director/Web/Form/DirectorObjectForm.php b/library/Director/Web/Form/DirectorObjectForm.php index b70bd7b..abbd4f0 100644 --- a/library/Director/Web/Form/DirectorObjectForm.php +++ b/library/Director/Web/Form/DirectorObjectForm.php @@ -5,6 +5,7 @@ namespace Icinga\Module\Director\Web\Form; use Exception; use gipfl\IcingaWeb2\Url; use Icinga\Authentication\Auth; +use Icinga\Module\Director\Auth\Permission; use Icinga\Module\Director\Data\Db\DbObjectStore; use Icinga\Module\Director\Db; use Icinga\Module\Director\Data\Db\DbObject; @@ -443,7 +444,7 @@ abstract class DirectorObjectForm extends DirectorForm $this->setInheritedValue( $el, $object->getRelatedObjectName($k, $v), - $origins->{"${k}_id"} + $origins->{"{$k}_id"} ); } } @@ -540,7 +541,9 @@ abstract class DirectorObjectForm extends DirectorForm 'inherited_groups', 'applied_groups', 'users', + 'users_var', 'user_groups', + 'user_groups_var', 'apply_to', 'command_id', // Notification 'notification_interval', @@ -788,7 +791,9 @@ abstract class DirectorObjectForm extends DirectorForm return; } - $post = $values = $this->getRequest()->getPost(); + /** @var array $post */ + $post = $this->getRequest()->getPost(); + $values = $post; foreach ($post as $key => $value) { if (preg_match('/^(.+?)_(\d+)__(MOVE_DOWN|MOVE_UP|REMOVE)$/', $key, $m)) { @@ -1239,7 +1244,7 @@ abstract class DirectorObjectForm extends DirectorForm if ($this->hasBeenSent()) { $this->addError($this->translate('No template has been chosen')); } else { - if ($this->hasPermission('director/admin')) { + if ($this->hasPermission(Permission::ADMIN)) { $html = $this->translate('Please define a related template first'); } else { $html = $this->translate('No related template has been provided yet'); @@ -1274,7 +1279,7 @@ abstract class DirectorObjectForm extends DirectorForm 'required' => $required, 'spellcheck' => 'false', 'hideOptions' => $choiceNames, - 'suggest' => "${type}templates", + 'suggest' => "{$type}templates", // 'multiOptions' => $this->optionallyAddFromEnum($enum), 'sorted' => true, 'value' => $this->presetImports, @@ -1516,6 +1521,7 @@ abstract class DirectorObjectForm extends DirectorForm return []; } + /** @var int|string $id */ $id = $object->get('id'); if (array_key_exists($id, $tpl)) { |