Fix user account events in admin controller
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
- Fix #290: Fix wrong email message for resending confirmation (tonydspaniard)
|
||||
- Enh #269: Added help documentation to console commands (tonydspaniard)
|
||||
- Fix #244: Fix forced inclusion of a suggested class (tonydspaniard)
|
||||
- Fix user event triggering in admin controller (maxxer)
|
||||
|
||||
## 1.5.0 April 19, 2019
|
||||
- Fix: Fix condition in EmailChangeService (it was always false) (borisaeric)
|
||||
|
||||
@ -9,6 +9,8 @@ On Controllers
|
||||
- **AdminController**
|
||||
- **UserEvent::EVENT_BEFORE_CREATE**: Occurs before a user has been created
|
||||
- **UserEvent::EVENT_AFTER_CREATE**: Occurs after a user has been created
|
||||
- **UserEvent::EVENT_BEFORE_ACCOUNT_UPDATE**: Occurs before a user's account has been updated
|
||||
- **UserEvent::EVENT_AFTER_ACCOUNT_UPDATE**: Occurs after a user's account has been updated
|
||||
- **UserEvent::EVENT_BEFORE_PROFILE_UPDATE**: Occurs before a user's profile has been updated
|
||||
- **UserEvent::EVENT_AFTER_PROFILE_UPDATE**: Occurs after a user's profile has been updated
|
||||
- **UserEvent::EVENT_BEFORE_CONFIRMATION**: Occurs before a user's email has been confirmed
|
||||
|
||||
@ -160,11 +160,11 @@ class AdminController extends Controller
|
||||
$this->make(AjaxRequestModelValidator::class, [$user])->validate();
|
||||
|
||||
if ($user->load(Yii::$app->request->post())) {
|
||||
$this->trigger(ActiveRecord::EVENT_BEFORE_UPDATE, $event);
|
||||
$this->trigger(UserEvent::EVENT_BEFORE_ACCOUNT_UPDATE, $event);
|
||||
|
||||
if ($user->save()) {
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'Account details have been updated'));
|
||||
$this->trigger(ActiveRecord::EVENT_AFTER_UPDATE, $event);
|
||||
$this->trigger(UserEvent::EVENT_AFTER_ACCOUNT_UPDATE, $event);
|
||||
|
||||
return $this->refresh();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user