public function parsePasswordAction($context) { if ($this->validateElement('password')) { // Use delegate name to determine action switch ($context['delegate']) { case 'AuthorPostPasswordResetSuccess': $action = 'reset'; break; case 'AuthorPostPasswordResetFailure': $action = 'attempted to reset'; break; case 'AuthorPostPasswordChange': $action = 'changed'; break; case 'AuthorPostPasswordResetRequest': $action = 'requested to reset'; break; } // If the user's unknown, set ID to 0 and store their email. if ($action == 'attempted to reset') { $account = 0; $item = $context['email']; } else { $account = $context['author_id']; if (!$this->validateUser($account)) { return; } $item = NULL; } Tracker::log('password-reset', $item, $action, $account, $this->getTimestamp()); } }