@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.

Remove weird integration between Legalpad and the ExternalAccount table

Summary:
Depends on D20107. Ref T6703. Legalpad currently inserts "email" records into the external account table, but they're never used for anything and nothing else references them.

They also aren't necessary for anything important to work, and the only effect they have is making the UI say "External Account" instead of "None" under the "Account" column. In particular, the signatures still record the actual email address.

Stop doing this, remove all the references, and destroy all the rows.

(Long ago, Maniphest may also have done this, but no longer does. Nuance/Gatekeeper use a more modern and more suitable "ExternalObject" thing that I initially started adapting here before realizing that Legalpad doesn't actually care about this data.)

Test Plan: Signed documents with an email address, saw signature reflected properly in UI. Grepped for other callsites.

Reviewers: amckinley

Reviewed By: amckinley

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T6703

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

+5 -42
+2
resources/sql/autopatches/20190206.external.01.legalpad.sql
··· 1 + UPDATE {$NAMESPACE}_legalpad.legalpad_documentsignature 2 + SET signerPHID = NULL WHERE signerPHID LIKE 'PHID-XUSR-%';
+2
resources/sql/autopatches/20190206.external.02.email.sql
··· 1 + DELETE FROM {$NAMESPACE}_user.user_externalaccount 2 + WHERE accountType = 'email';
-31
src/applications/auth/query/PhabricatorExternalAccountQuery.php
··· 168 168 return 'PhabricatorPeopleApplication'; 169 169 } 170 170 171 - /** 172 - * Attempts to find an external account and if none exists creates a new 173 - * external account with a shiny new ID and PHID. 174 - * 175 - * NOTE: This function assumes the first item in various query parameters is 176 - * the correct value to use in creating a new external account. 177 - */ 178 - public function loadOneOrCreate() { 179 - $account = $this->executeOne(); 180 - if (!$account) { 181 - $account = new PhabricatorExternalAccount(); 182 - if ($this->accountIDs) { 183 - $account->setAccountID(reset($this->accountIDs)); 184 - } 185 - if ($this->accountTypes) { 186 - $account->setAccountType(reset($this->accountTypes)); 187 - } 188 - if ($this->accountDomains) { 189 - $account->setAccountDomain(reset($this->accountDomains)); 190 - } 191 - if ($this->accountSecrets) { 192 - $account->setAccountSecret(reset($this->accountSecrets)); 193 - } 194 - if ($this->userPHIDs) { 195 - $account->setUserPHID(reset($this->userPHIDs)); 196 - } 197 - $account->save(); 198 - } 199 - return $account; 200 - } 201 - 202 171 }
-10
src/applications/legalpad/controller/LegalpadDocumentSignController.php
··· 364 364 if ($email_obj) { 365 365 return $this->signInResponse(); 366 366 } 367 - $external_account = id(new PhabricatorExternalAccountQuery()) 368 - ->setViewer($viewer) 369 - ->withAccountTypes(array('email')) 370 - ->withAccountDomains(array($email->getDomainName())) 371 - ->withAccountIDs(array($email->getAddress())) 372 - ->loadOneOrCreate(); 373 - if ($external_account->getUserPHID()) { 374 - return $this->signInResponse(); 375 - } 376 - $signer_phid = $external_account->getPHID(); 377 367 } 378 368 } 379 369 break;
+1 -1
src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php
··· 226 226 $handles[$document->getPHID()]->renderLink(), 227 227 $signer_phid 228 228 ? $handles[$signer_phid]->renderLink() 229 - : null, 229 + : phutil_tag('em', array(), pht('None')), 230 230 $name, 231 231 phutil_tag( 232 232 'a',