Event does not fire on_user_deactivate

hello everyone,

I have a requirement, send an email to the user, and deleted his login attempts from the "userloginattempts" table.
both functionalities will be called on the deactivate account.
I have written some code in the \application\bootstrap\app.php file.
following the code
Events::addListener('on_user_deactivate', function($event) {
    $user = $event->getUserInfoObject();
    $userEmail = $user->getUserEmail();
    $uId = $user->getUserId();
    $db = Loader::db();
    $q = "DELETE FROM userloginattempts WHERE userId = $uId";
    \Log::info(sprintf('User deactivated %s', $user->getUserName()));

There is using "on_user_deactivate" event, functionalities are inside the function, but it is not fired since the account deactivated

Note: User account gets deactivate when he attempts the wrong password 3 times.

Abdul Qayyum

View Replies: