mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-26 23:34:10 +02:00
DirectorObjectForm: add better status codes
This commit is contained in:
parent
16c4bd4da8
commit
59028ebeb4
@ -497,7 +497,10 @@ abstract class DirectorObjectForm extends QuickForm
|
||||
{
|
||||
$object = $this->object();
|
||||
if ($object->hasBeenModified()) {
|
||||
|
||||
if (! $object->hasBeenLoadedFromDb()) {
|
||||
|
||||
$this->setHttpResponseCode(201);
|
||||
if ($object instanceof IcingaObject && $object->hasProperty('object_name')) {
|
||||
$this->setSuccessUrl(
|
||||
'director/' . strtolower($this->getObjectName()),
|
||||
@ -513,8 +516,12 @@ abstract class DirectorObjectForm extends QuickForm
|
||||
);
|
||||
$object->store($this->db);
|
||||
} else {
|
||||
if ($this->isApiRequest()) {
|
||||
$this->setHttpResponseCode(304);
|
||||
}
|
||||
$msg = $this->translate('No action taken, object has not been modified');
|
||||
}
|
||||
|
||||
$this->redirectOnSuccess($msg);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user