diff --git a/adminstuds.php b/adminstuds.php index 7cb20d8..ceb0cdb 100644 --- a/adminstuds.php +++ b/adminstuds.php @@ -234,30 +234,6 @@ if (isset($_POST['confirm_remove_all_votes'])) { } } -// ------------------------------- -// Add a comment -// ------------------------------- - -if (isset($_POST['add_comment'])) { - $name = $inputService->filterName($_POST['name']); - $comment = $inputService->filterComment($_POST['comment']); - - if ($name == null) { - $message = new Message('danger', __('Error', 'The name is invalid.')); - } - - if ($message == null) { - // Add comment - $result = $pollService->addComment($poll_id, $name, $comment); - if ($result) { - $message = new Message('success', __('Comments', 'Comment added')); - } else { - $message = new Message('danger', __('Error', 'Comment failed')); - } - } - -} - // ------------------------------- // Delete a comment // ------------------------------- diff --git a/studs.php b/studs.php index f4306f1..c6c4616 100644 --- a/studs.php +++ b/studs.php @@ -128,29 +128,6 @@ if (!empty($_POST['save'])) { // Save edition of an old vote } } } - -// ------------------------------- -// Add a comment -// ------------------------------- - -if (isset($_POST['add_comment'])) { - $name = $inputService->filterName($_POST['name']); - $comment = $inputService->filterComment($_POST['comment']); - - if ($name == null) { - $message = new Message('danger', __('Error', 'The name is invalid.')); - } - - if ($message == null) { - // Add comment - $result = $pollService->addComment($poll_id, $name, $comment); - if ($result) { - $message = new Message('success', __('Comments', 'Comment added')); - $notificationService->sendUpdateNotification($poll, NotificationService::ADD_COMMENT, $name); - } else { - $message = new Message('danger', __('Error', 'Comment failed')); - } - } } // Retrieve data