diff --git a/app/controllers/backend/UserController.php b/app/controllers/backend/UserController.php index c104381..efaded4 100644 --- a/app/controllers/backend/UserController.php +++ b/app/controllers/backend/UserController.php @@ -102,8 +102,12 @@ class UserController extends \Phalcon\Mvc\Controller { $user = User::findFirstById($id); if ($user) { - $this->eventsManager->fire('auth:onSentActivation', $user); - $this->flash->success('Ativation email sent to: ' . $user->email); + if ($user->isSuspended()) { + $this->eventsManager->fire('auth:onSentActivation', $user); + $this->flash->success('Ativation email sent to: ' . $user->email); + } else { + $this->flash->error('Only suspended users can be sent activation emails.'); + } } else { $this->flash->error('Invalid user: ' . $id); }