Archived
1
0
Fork 0

app/controllers/backend/UserController.php: in activationEmailAction() only send activation email to suspended users.

This commit is contained in:
Henrik Hautakoski 2022-08-28 17:47:56 +02:00
parent 4ff351d39d
commit 8048b3fda8

View file

@ -102,8 +102,12 @@ class UserController extends \Phalcon\Mvc\Controller
{ {
$user = User::findFirstById($id); $user = User::findFirstById($id);
if ($user) { if ($user) {
$this->eventsManager->fire('auth:onSentActivation', $user); if ($user->isSuspended()) {
$this->flash->success('Ativation email sent to: ' . $user->email); $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 { } else {
$this->flash->error('Invalid user: ' . $id); $this->flash->error('Invalid user: ' . $id);
} }