Page MenuHomePhabricator

D7953.diff
No OneTemporary

D7953.diff

Index: src/applications/auth/controller/PhabricatorLogoutController.php
===================================================================
--- src/applications/auth/controller/PhabricatorLogoutController.php
+++ src/applications/auth/controller/PhabricatorLogoutController.php
@@ -23,9 +23,9 @@
if ($request->isFormPost()) {
- $log = PhabricatorUserLog::newLog(
- $user,
+ $log = PhabricatorUserLog::initializeNewLog(
$user,
+ $user->getPHID(),
PhabricatorUserLog::ACTION_LOGOUT);
$log->save();
Index: src/applications/auth/provider/PhabricatorAuthProviderPassword.php
===================================================================
--- src/applications/auth/provider/PhabricatorAuthProviderPassword.php
+++ src/applications/auth/provider/PhabricatorAuthProviderPassword.php
@@ -185,9 +185,9 @@
}
if (!$account) {
- $log = PhabricatorUserLog::newLog(
+ $log = PhabricatorUserLog::initializeNewLog(
null,
- $log_user,
+ $log_user ? $log_user->getPHID() : null,
PhabricatorUserLog::ACTION_LOGIN_FAILURE);
$log->save();
Index: src/applications/people/controller/PhabricatorPeopleEditController.php
===================================================================
--- src/applications/people/controller/PhabricatorPeopleEditController.php
+++ src/applications/people/controller/PhabricatorPeopleEditController.php
@@ -356,9 +356,9 @@
if ($request->isFormPost()) {
- $log_template = PhabricatorUserLog::newLog(
+ $log_template = PhabricatorUserLog::initializeNewLog(
$admin,
- $user,
+ $user->getPHID(),
null);
$logs = array();
Index: src/applications/people/editor/PhabricatorUserEditor.php
===================================================================
--- src/applications/people/editor/PhabricatorUserEditor.php
+++ src/applications/people/editor/PhabricatorUserEditor.php
@@ -64,9 +64,9 @@
throw $ex;
}
- $log = PhabricatorUserLog::newLog(
+ $log = PhabricatorUserLog::initializeNewLog(
$this->requireActor(),
- $user,
+ $user->getPHID(),
PhabricatorUserLog::ACTION_CREATE);
$log->setNewValue($email->getAddress());
$log->save();
@@ -93,9 +93,9 @@
$email->save();
}
- $log = PhabricatorUserLog::newLog(
+ $log = PhabricatorUserLog::initializeNewLog(
$this->requireActor(),
- $user,
+ $user->getPHID(),
PhabricatorUserLog::ACTION_EDIT);
$log->save();
@@ -122,9 +122,9 @@
$user->setPassword($envelope);
$user->save();
- $log = PhabricatorUserLog::newLog(
+ $log = PhabricatorUserLog::initializeNewLog(
$this->requireActor(),
- $user,
+ $user->getPHID(),
PhabricatorUserLog::ACTION_CHANGE_PASSWORD);
$log->save();
@@ -161,9 +161,9 @@
throw $ex;
}
- $log = PhabricatorUserLog::newLog(
+ $log = PhabricatorUserLog::initializeNewLog(
$actor,
- $user,
+ $user->getPHID(),
PhabricatorUserLog::ACTION_CHANGE_USERNAME);
$log->setOldValue($old_username);
$log->setNewValue($username);
@@ -198,14 +198,14 @@
return $this;
}
- $log = PhabricatorUserLog::newLog(
+ $log = PhabricatorUserLog::initializeNewLog(
$actor,
- $user,
+ $user->getPHID(),
PhabricatorUserLog::ACTION_ADMIN);
$log->setOldValue($user->getIsAdmin());
$log->setNewValue($admin);
- $user->setIsAdmin($admin);
+ $user->setIsAdmin((int)$admin);
$user->save();
$log->save();
@@ -236,9 +236,9 @@
return $this;
}
- $log = PhabricatorUserLog::newLog(
+ $log = PhabricatorUserLog::initializeNewLog(
$actor,
- $user,
+ $user->getPHID(),
PhabricatorUserLog::ACTION_SYSTEM_AGENT);
$log->setOldValue($user->getIsSystemAgent());
$log->setNewValue($system_agent);
@@ -275,14 +275,14 @@
return $this;
}
- $log = PhabricatorUserLog::newLog(
+ $log = PhabricatorUserLog::initializeNewLog(
$actor,
- $user,
+ $user->getPHID(),
PhabricatorUserLog::ACTION_DISABLE);
$log->setOldValue($user->getIsDisabled());
$log->setNewValue($disable);
- $user->setIsDisabled($disable);
+ $user->setIsDisabled((int)$disable);
$user->save();
$log->save();
@@ -314,9 +314,9 @@
return $this;
}
- $log = PhabricatorUserLog::newLog(
+ $log = PhabricatorUserLog::initializeNewLog(
$actor,
- $user,
+ $user->getPHID(),
PhabricatorUserLog::ACTION_APPROVE);
$log->setOldValue($user->getIsApproved());
$log->setNewValue($approve);
@@ -382,9 +382,9 @@
$email->delete();
}
- $log = PhabricatorUserLog::newLog(
+ $log = PhabricatorUserLog::initializeNewLog(
$actor,
- $user,
+ $user->getPHID(),
PhabricatorUserLog::ACTION_DELETE);
$log->save();
@@ -435,9 +435,9 @@
throw $ex;
}
- $log = PhabricatorUserLog::newLog(
+ $log = PhabricatorUserLog::initializeNewLog(
$actor,
- $user,
+ $user->getPHID(),
PhabricatorUserLog::ACTION_EMAIL_ADD);
$log->setNewValue($email->getAddress());
$log->save();
@@ -480,9 +480,9 @@
$email->delete();
- $log = PhabricatorUserLog::newLog(
+ $log = PhabricatorUserLog::initializeNewLog(
$actor,
- $user,
+ $user->getPHID(),
PhabricatorUserLog::ACTION_EMAIL_REMOVE);
$log->setOldValue($email->getAddress());
$log->save();
@@ -536,9 +536,9 @@
$email->setIsPrimary(1);
$email->save();
- $log = PhabricatorUserLog::newLog(
+ $log = PhabricatorUserLog::initialieNewLog(
$actor,
- $user,
+ $user->getPHID(),
PhabricatorUserLog::ACTION_EMAIL_PRIMARY);
$log->setOldValue($old_primary ? $old_primary->getAddress() : null);
$log->setNewValue($email->getAddress());
Index: src/applications/people/storage/PhabricatorUser.php
===================================================================
--- src/applications/people/storage/PhabricatorUser.php
+++ src/applications/people/storage/PhabricatorUser.php
@@ -431,9 +431,9 @@
}
}
- $log = PhabricatorUserLog::newLog(
- $this,
+ $log = PhabricatorUserLog::initializeNewLog(
$this,
+ $this->getPHID(),
PhabricatorUserLog::ACTION_LOGIN);
$log->setDetails(
array(
Index: src/applications/people/storage/PhabricatorUserLog.php
===================================================================
--- src/applications/people/storage/PhabricatorUserLog.php
+++ src/applications/people/storage/PhabricatorUserLog.php
@@ -35,9 +35,9 @@
protected $remoteAddr;
protected $session;
- public static function newLog(
+ public static function initializeNewLog(
PhabricatorUser $actor = null,
- PhabricatorUser $user = null,
+ $object_phid,
$action) {
$log = new PhabricatorUserLog();
@@ -46,15 +46,8 @@
$log->setActorPHID($actor->getPHID());
}
- if ($user) {
- $log->setUserPHID($user->getPHID());
- } else {
- $log->setUserPHID('');
- }
-
- if ($action) {
- $log->setAction($action);
- }
+ $log->setUserPHID((string)$object_phid);
+ $log->setAction($action);
return $log;
}

File Metadata

Mime Type
text/plain
Expires
Wed, May 22, 1:18 AM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6290320
Default Alt Text
D7953.diff (7 KB)

Event Timeline