Fix some more ldap issues
Summary: - LDAP import needs to use envelopes. - Use ldap_sprintf(). Test Plan: Configured an LDAP server. Added an account. Imported it; logged in with it. Tried to login with accounts like ",", etc., got good errors. Reviewers: vrana, btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D2995
This commit is contained in:
@@ -35,10 +35,12 @@ final class PhabricatorLDAPLoginController extends PhabricatorAuthController {
|
||||
$current_user = $this->getRequest()->getUser();
|
||||
$request = $this->getRequest();
|
||||
|
||||
$ldap_username = $request->getCookie('phusr');
|
||||
if ($request->isFormPost()) {
|
||||
$ldap_username = $request->getStr('username');
|
||||
try {
|
||||
$envelope = new PhutilOpaqueEnvelope($request->getStr('password'));
|
||||
$this->provider->auth($request->getStr('username'), $envelope);
|
||||
$this->provider->auth($ldap_username, $envelope);
|
||||
} catch (Exception $e) {
|
||||
$errors[] = $e->getMessage();
|
||||
}
|
||||
@@ -124,7 +126,6 @@ final class PhabricatorLDAPLoginController extends PhabricatorAuthController {
|
||||
}
|
||||
}
|
||||
|
||||
$ldap_username = $request->getCookie('phusr');
|
||||
$ldap_form = new AphrontFormView();
|
||||
$ldap_form
|
||||
->setUser($request->getUser())
|
||||
|
||||
Reference in New Issue
Block a user