Skip to content

Commit

Permalink
fix evo3 events
Browse files Browse the repository at this point in the history
  • Loading branch information
Pathologic committed Jul 3, 2023
1 parent b415341 commit bb53fac
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/modUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ class modUsers extends MODxAPI
{
use RoleTV;

const ON_CHANGE_PASSWORD_EVENT = 'OnWebChangePassword';
const ON_SAVE_USER_EVENT = 'OnWebSaveUser';
const ON_DELETE_USER_EVENT = 'OnWebDeleteUser';
const ON_USER_LOGIN_EVENT = 'OnWebLogin';
const ON_USER_AUTHENTICATION_EVENT = 'OnWebAuthentication';
const ON_CHANGE_PASSWORD_EVENT = 'OnUserChangePassword';
const ON_SAVE_USER_EVENT = 'OnUserSave';
const ON_DELETE_USER_EVENT = 'OnUserDelete';
const ON_USER_LOGIN_EVENT = 'OnUserLogin';
const ON_USER_BEFORE_LOGOUT_EVENT = 'OnBeforeUserLogout';
const ON_USER_LOGOUT_EVENT = 'OnUserLogout';
const ON_USER_AUTHENTICATION_EVENT = 'OnUserAuthentication';

/**
* @var array
Expand Down Expand Up @@ -747,9 +749,9 @@ public function logOut($cookieName = 'WebLoginPE', $fire_events = false)
'internalKey' => $uid,
'userid' => $uid // Bugfix by TS
];
$this->invokeEvent('OnBeforeWebLogout', $params, $fire_events);
$this->invokeEvent(self::ON_USER_BEFORE_LOGOUT_EVENT, $params, $fire_events);
$this->SessionHandler('destroy', $cookieName ? $cookieName : 'WebLoginPE');
$this->invokeEvent('OnWebLogout', $params, $fire_events);
$this->invokeEvent(self::ON_USER_LOGOUT_EVENT, $params, $fire_events);
}

/**
Expand All @@ -773,6 +775,7 @@ protected function SessionHandler($directive, $cookieName, $remember = true)
$_SESSION['webShortname'] = $this->get('username');
$_SESSION['webFullname'] = $this->get('fullname');
$_SESSION['webEmail'] = $this->get('email');
$_SESSION['webPhoto'] = $this->get('photo');
$_SESSION['webValidated'] = 1;
$_SESSION['webRole'] = $this->get('role');
$_SESSION['webInternalKey'] = $this->getID();
Expand All @@ -793,6 +796,7 @@ protected function SessionHandler($directive, $cookieName, $remember = true)
unset($_SESSION['webShortname']);
unset($_SESSION['webFullname']);
unset($_SESSION['webEmail']);
unset($_SESSION['webPhoto']);
unset($_SESSION['webValidated']);
unset($_SESSION['webRole']);
unset($_SESSION['webInternalKey']);
Expand Down

0 comments on commit bb53fac

Please sign in to comment.