Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/storage/PhabricatorUserLog.php
<?php | <?php | ||||
final class PhabricatorUserLog extends PhabricatorUserDAO | final class PhabricatorUserLog extends PhabricatorUserDAO | ||||
implements PhabricatorPolicyInterface { | implements PhabricatorPolicyInterface { | ||||
const ACTION_LOGIN = 'login'; | |||||
const ACTION_LOGIN_PARTIAL = 'login-partial'; | |||||
const ACTION_LOGIN_FULL = 'login-full'; | |||||
const ACTION_LOGOUT = 'logout'; | |||||
const ACTION_LOGIN_FAILURE = 'login-fail'; | |||||
const ACTION_LOGIN_LEGALPAD = 'login-legalpad'; | |||||
const ACTION_RESET_PASSWORD = 'reset-pass'; | |||||
const ACTION_CONDUIT_CERTIFICATE = 'conduit-cert'; | |||||
const ACTION_CONDUIT_CERTIFICATE_FAILURE = 'conduit-cert-fail'; | |||||
const ACTION_EMAIL_PRIMARY = 'email-primary'; | |||||
const ACTION_EMAIL_REMOVE = 'email-remove'; | |||||
const ACTION_EMAIL_ADD = 'email-add'; | |||||
const ACTION_EMAIL_VERIFY = 'email-verify'; | |||||
const ACTION_EMAIL_REASSIGN = 'email-reassign'; | |||||
const ACTION_CHANGE_PASSWORD = 'change-password'; | |||||
const ACTION_ENTER_HISEC = 'hisec-enter'; | |||||
const ACTION_EXIT_HISEC = 'hisec-exit'; | |||||
const ACTION_FAIL_HISEC = 'hisec-fail'; | |||||
const ACTION_MULTI_ADD = 'multi-add'; | |||||
const ACTION_MULTI_REMOVE = 'multi-remove'; | |||||
protected $actorPHID; | protected $actorPHID; | ||||
protected $userPHID; | protected $userPHID; | ||||
protected $action; | protected $action; | ||||
protected $oldValue; | protected $oldValue; | ||||
protected $newValue; | protected $newValue; | ||||
protected $details = array(); | protected $details = array(); | ||||
protected $remoteAddr; | protected $remoteAddr; | ||||
protected $session; | protected $session; | ||||
public static function getActionTypeMap() { | |||||
return array( | |||||
self::ACTION_LOGIN => pht('Login'), | |||||
self::ACTION_LOGIN_PARTIAL => pht('Login: Partial Login'), | |||||
self::ACTION_LOGIN_FULL => pht('Login: Upgrade to Full'), | |||||
self::ACTION_LOGIN_FAILURE => pht('Login: Failure'), | |||||
self::ACTION_LOGIN_LEGALPAD => | |||||
pht('Login: Signed Required Legalpad Documents'), | |||||
self::ACTION_LOGOUT => pht('Logout'), | |||||
self::ACTION_RESET_PASSWORD => pht('Reset Password'), | |||||
self::ACTION_CONDUIT_CERTIFICATE | |||||
=> pht('Conduit: Read Certificate'), | |||||
self::ACTION_CONDUIT_CERTIFICATE_FAILURE | |||||
=> pht('Conduit: Read Certificate Failure'), | |||||
self::ACTION_EMAIL_PRIMARY => pht('Email: Change Primary'), | |||||
self::ACTION_EMAIL_ADD => pht('Email: Add Address'), | |||||
self::ACTION_EMAIL_REMOVE => pht('Email: Remove Address'), | |||||
self::ACTION_EMAIL_VERIFY => pht('Email: Verify'), | |||||
self::ACTION_EMAIL_REASSIGN => pht('Email: Reassign'), | |||||
self::ACTION_CHANGE_PASSWORD => pht('Change Password'), | |||||
self::ACTION_ENTER_HISEC => pht('Hisec: Enter'), | |||||
self::ACTION_EXIT_HISEC => pht('Hisec: Exit'), | |||||
self::ACTION_FAIL_HISEC => pht('Hisec: Failed Attempt'), | |||||
self::ACTION_MULTI_ADD => pht('Multi-Factor: Add Factor'), | |||||
self::ACTION_MULTI_REMOVE => pht('Multi-Factor: Remove Factor'), | |||||
); | |||||
} | |||||
public static function initializeNewLog( | public static function initializeNewLog( | ||||
PhabricatorUser $actor = null, | PhabricatorUser $actor = null, | ||||
$object_phid = null, | $object_phid = null, | ||||
$action = null) { | $action = null) { | ||||
$log = new PhabricatorUserLog(); | $log = new PhabricatorUserLog(); | ||||
if ($actor) { | if ($actor) { | ||||
▲ Show 20 Lines • Show All 126 Lines • Show Last 20 Lines |