IcingaCloneObjectForm: reset api key when cloning
This commit is contained in:
parent
7780c0b11b
commit
5ee215df27
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Icinga\Module\Director\Forms;
|
||||
|
||||
use Icinga\Module\Director\Objects\IcingaHost;
|
||||
use Icinga\Module\Director\Objects\IcingaObject;
|
||||
use Icinga\Module\Director\Web\Form\DirectorForm;
|
||||
|
||||
|
@ -53,6 +54,10 @@ class IcingaCloneObjectForm extends DirectorForm
|
|||
$object->getConnection()
|
||||
)->set('object_name', $newname);
|
||||
|
||||
if ($new instanceof IcingaHost) {
|
||||
$new->set('api_key', null);
|
||||
}
|
||||
|
||||
if ($new->store()) {
|
||||
$this->setSuccessUrl(
|
||||
'director/' . strtolower($object->getShortTableName()),
|
||||
|
|
Loading…
Reference in New Issue