Archived
1
0
Fork 0

Merge branch '38-admin-send-activation-password-resets-to-email' into dev

This commit is contained in:
Henrik Hautakoski 2022-08-28 17:49:22 +02:00
commit 8c9455a2d5
8 changed files with 79 additions and 3 deletions

View file

@ -6,6 +6,7 @@ use App\Controller\ControllerBase,
App\Model\Data\Callback as CallbackModel,
App\Model\Data\Request as RequestModel,
App\Model\Data\RequestMeta as RequestMetaModel,
App\Model\Data\User,
App\Model\Data\UserActivation;
class ApiController extends ControllerBase

View file

@ -97,4 +97,20 @@ class UserController extends \Phalcon\Mvc\Controller
$this->flash->success('The account was: ' . $status);
$this->response->redirect('/admin');
}
public function activationEmailAction($id)
{
$user = User::findFirstById($id);
if ($user) {
if ($user->isSuspended()) {
$this->eventsManager->fire('auth:onSentActivation', $user);
$this->flash->success('Activation email sent to: ' . $user->email);
} else {
$this->flash->error('Only suspended users can be sent activation emails.');
}
} else {
$this->flash->error('Invalid user: ' . $id);
}
$this->response->redirect('/admin');
}
}