mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 01:04:12 +02:00
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…
x
Reference in New Issue
Block a user