mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
Transmit the user who deletes a comment
This commit is contained in:
parent
a2009913c9
commit
287edb7932
@ -94,6 +94,7 @@ class DeleteCommentCommandForm extends CommandForm
|
||||
{
|
||||
$cmd = new DeleteCommentCommand();
|
||||
$cmd
|
||||
->setAuthor($this->Auth()->getUser()->getUsername())
|
||||
->setCommentId($this->getElement('comment_id')->getValue())
|
||||
->setCommentName($this->getElement('comment_name')->getValue())
|
||||
->setIsService($this->getElement('comment_is_service')->getValue());
|
||||
|
@ -73,6 +73,7 @@ class DeleteCommentsCommandForm extends CommandForm
|
||||
$cmd
|
||||
->setCommentId($comment->id)
|
||||
->setCommentName($comment->name)
|
||||
->setAuthor($this->Auth()->getUser()->getUsername())
|
||||
->setIsService(isset($comment->service_description));
|
||||
$this->getTransport($this->request)->send($cmd);
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ use Icinga\Module\Monitoring\Command\IcingaCommand;
|
||||
*/
|
||||
class DeleteCommentCommand extends IcingaCommand
|
||||
{
|
||||
use CommandAuthor;
|
||||
|
||||
/**
|
||||
* ID of the comment that is to be deleted
|
||||
*
|
||||
|
@ -237,9 +237,10 @@ class IcingaApiCommandRenderer implements IcingaCommandRendererInterface
|
||||
public function renderDeleteComment(DeleteCommentCommand $command)
|
||||
{
|
||||
$endpoint = 'actions/remove-comment';
|
||||
$data = array(
|
||||
'comment' => $command->getCommentName()
|
||||
);
|
||||
$data = [
|
||||
'author' => $command->getAuthor(),
|
||||
'comment' => $command->getCommentName()
|
||||
];
|
||||
return IcingaApiCommand::create($endpoint, $data);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user