Differential D20108 Diff 48058 src/applications/legalpad/controller/LegalpadDocumentSignController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/legalpad/controller/LegalpadDocumentSignController.php
| Show First 20 Lines • Show All 358 Lines • ▼ Show 20 Lines | switch ($document->getSignatureType()) { | ||||
| } else if ($request->isFormPost()) { | } else if ($request->isFormPost()) { | ||||
| $email = new PhutilEmailAddress($request->getStr('email')); | $email = new PhutilEmailAddress($request->getStr('email')); | ||||
| if (strlen($email->getDomainName())) { | if (strlen($email->getDomainName())) { | ||||
| $email_obj = id(new PhabricatorUserEmail()) | $email_obj = id(new PhabricatorUserEmail()) | ||||
| ->loadOneWhere('address = %s', $email->getAddress()); | ->loadOneWhere('address = %s', $email->getAddress()); | ||||
| if ($email_obj) { | if ($email_obj) { | ||||
| return $this->signInResponse(); | return $this->signInResponse(); | ||||
| } | } | ||||
| $external_account = id(new PhabricatorExternalAccountQuery()) | |||||
| ->setViewer($viewer) | |||||
| ->withAccountTypes(array('email')) | |||||
| ->withAccountDomains(array($email->getDomainName())) | |||||
| ->withAccountIDs(array($email->getAddress())) | |||||
| ->loadOneOrCreate(); | |||||
| if ($external_account->getUserPHID()) { | |||||
| return $this->signInResponse(); | |||||
| } | |||||
| $signer_phid = $external_account->getPHID(); | |||||
| } | } | ||||
| } | } | ||||
| break; | break; | ||||
| case LegalpadDocument::SIGNATURE_TYPE_CORPORATION: | case LegalpadDocument::SIGNATURE_TYPE_CORPORATION: | ||||
| $signer_phid = $viewer->getPHID(); | $signer_phid = $viewer->getPHID(); | ||||
| if ($signer_phid) { | if ($signer_phid) { | ||||
| $signature_data = array( | $signature_data = array( | ||||
| 'contact.name' => $viewer->getRealName(), | 'contact.name' => $viewer->getRealName(), | ||||
| ▲ Show 20 Lines • Show All 322 Lines • Show Last 20 Lines | |||||