@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use DestructionEngine to destroy UserEmail objects

Summary: Ref T13444. Prepare to hook identity updates when user email addreses are destroyed.

Test Plan:
- Destroyed a user with `bin/remove destroy ... --trace`, saw email deleted.
- Destroyed an email from the web UI, saw email deleted.

Maniphest Tasks: T13444

Differential Revision: https://secure.phabricator.com/D20912

+19 -4
+4 -1
src/__phutil_library_map__.php
··· 11681 11681 'PhabricatorUserEditEngine' => 'PhabricatorEditEngine', 11682 11682 'PhabricatorUserEditor' => 'PhabricatorEditor', 11683 11683 'PhabricatorUserEditorTestCase' => 'PhabricatorTestCase', 11684 - 'PhabricatorUserEmail' => 'PhabricatorUserDAO', 11684 + 'PhabricatorUserEmail' => array( 11685 + 'PhabricatorUserDAO', 11686 + 'PhabricatorDestructibleInterface', 11687 + ), 11685 11688 'PhabricatorUserEmailTestCase' => 'PhabricatorTestCase', 11686 11689 'PhabricatorUserEmpowerTransaction' => 'PhabricatorUserTransactionType', 11687 11690 'PhabricatorUserFerretEngine' => 'PhabricatorFerretEngine',
+2 -1
src/applications/people/editor/PhabricatorUserEditor.php
··· 241 241 throw new Exception(pht('Email not owned by user!')); 242 242 } 243 243 244 - $email->delete(); 244 + id(new PhabricatorDestructionEngine()) 245 + ->destroyObject($email); 245 246 246 247 $log = PhabricatorUserLog::initializeNewLog( 247 248 $actor,
+1 -1
src/applications/people/storage/PhabricatorUser.php
··· 1148 1148 'userPHID = %s', 1149 1149 $this->getPHID()); 1150 1150 foreach ($emails as $email) { 1151 - $email->delete(); 1151 + $engine->destroyObject($email); 1152 1152 } 1153 1153 1154 1154 $sessions = id(new PhabricatorAuthSession())->loadAllWhere(
+12 -1
src/applications/people/storage/PhabricatorUserEmail.php
··· 4 4 * @task restrictions Domain Restrictions 5 5 * @task email Email About Email 6 6 */ 7 - final class PhabricatorUserEmail extends PhabricatorUserDAO { 7 + final class PhabricatorUserEmail 8 + extends PhabricatorUserDAO 9 + implements PhabricatorDestructibleInterface { 8 10 9 11 protected $userPHID; 10 12 protected $address; ··· 269 271 ->saveAndSend(); 270 272 271 273 return $this; 274 + } 275 + 276 + 277 + /* -( PhabricatorDestructibleInterface )----------------------------------- */ 278 + 279 + 280 + public function destroyObjectPermanently( 281 + PhabricatorDestructionEngine $engine) { 282 + $this->delete(); 272 283 } 273 284 274 285 }