getRequest(); $user = $request->getUser(); $ldap_info = id(new PhabricatorUserLDAPInfo())->loadOneWhere( 'userID = %d', $user->getID()); if (!$ldap_info) { return new Aphront400Response(); } if (!$request->isDialogFormPost()) { $dialog = new AphrontDialogView(); $dialog->setUser($user); $dialog->setTitle('Really unlink account?'); $dialog->appendChild( '
You will not be able to login using this account '. 'once you unlink it. Continue?
'); $dialog->addSubmitButton('Unlink Account'); $dialog->addCancelButton('/settings/page/ldap/'); return id(new AphrontDialogResponse())->setDialog($dialog); } $ldap_info->delete(); return id(new AphrontRedirectResponse()) ->setURI('/settings/page/ldap/'); } }