mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-27 15:54:03 +02:00
parent
4b2546b14f
commit
ed8a135a66
@ -6,6 +6,9 @@ use Icinga\Module\Director\Web\Form\DirectorObjectForm;
|
||||
|
||||
class IcingaUserForm extends DirectorObjectForm
|
||||
{
|
||||
/**
|
||||
* @throws \Zend_Form_Exception
|
||||
*/
|
||||
public function setup()
|
||||
{
|
||||
$this->addObjectTypeElement();
|
||||
@ -46,11 +49,16 @@ class IcingaUserForm extends DirectorObjectForm
|
||||
->addEnableNotificationsElement()
|
||||
->addDisabledElement()
|
||||
->addZoneElements()
|
||||
->addPeriodElement()
|
||||
->addEventFilterElements()
|
||||
->groupMainProperties()
|
||||
->setButtons();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
* @throws \Zend_Form_Exception
|
||||
*/
|
||||
protected function addZoneElements()
|
||||
{
|
||||
if (! $this->isTemplate()) {
|
||||
@ -71,6 +79,9 @@ class IcingaUserForm extends DirectorObjectForm
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
protected function addEnableNotificationsElement()
|
||||
{
|
||||
$this->optionalBoolean(
|
||||
@ -82,6 +93,10 @@ class IcingaUserForm extends DirectorObjectForm
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
* @throws \Zend_Form_Exception
|
||||
*/
|
||||
protected function addGroupsElement()
|
||||
{
|
||||
$groups = $this->enumUsergroups();
|
||||
@ -104,6 +119,10 @@ class IcingaUserForm extends DirectorObjectForm
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
* @throws \Zend_Form_Exception
|
||||
*/
|
||||
protected function addDisplayNameElement()
|
||||
{
|
||||
if ($this->isTemplate()) {
|
||||
@ -121,6 +140,36 @@ class IcingaUserForm extends DirectorObjectForm
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
* @throws \Zend_Form_Exception
|
||||
*/
|
||||
protected function addPeriodElement()
|
||||
{
|
||||
$periods = $this->db->enumTimeperiods();
|
||||
if (empty($periods)) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
$this->addElement(
|
||||
'select',
|
||||
'period_id',
|
||||
array(
|
||||
'label' => $this->translate('Time period'),
|
||||
'description' => $this->translate(
|
||||
'The name of a time period which determines when notifications'
|
||||
. ' to this User should be triggered. Not set by default.'
|
||||
),
|
||||
'multiOptions' => $this->optionalEnum($periods),
|
||||
)
|
||||
);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Zend_Form_Exception
|
||||
*/
|
||||
protected function groupObjectDefinition()
|
||||
{
|
||||
$elements = array(
|
||||
@ -131,6 +180,7 @@ class IcingaUserForm extends DirectorObjectForm
|
||||
'groups',
|
||||
'email',
|
||||
'pager',
|
||||
'period_id',
|
||||
'enable_notifications',
|
||||
'disabled',
|
||||
);
|
||||
@ -145,6 +195,9 @@ class IcingaUserForm extends DirectorObjectForm
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function enumUsergroups()
|
||||
{
|
||||
$db = $this->db->getDbAdapter();
|
||||
|
@ -29,6 +29,7 @@ before switching to a new version.
|
||||
* FIX: Don't suggest Command templates where Commands are required (#1414)
|
||||
* FIX: Do not allow to delete Commands being used by other objects (#1443)
|
||||
* FIX: Show 'Inspect' tab only for Endpoints with an ApiUser (#1293)
|
||||
* FIX: It's now possible to specify TimePeriods for single Users #944
|
||||
|
||||
### CLI
|
||||
* FEATURE: Director Health Check Plugin (#1278)
|
||||
|
Loading…
x
Reference in New Issue
Block a user