Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
| Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
| $adapter->setLoginUsername($username); | $adapter->setLoginUsername($username); | ||||
| $adapter->setLoginPassword($password); | $adapter->setLoginPassword($password); | ||||
| // TODO: This calls ldap_bind() eventually, which dumps cleartext | // TODO: This calls ldap_bind() eventually, which dumps cleartext | ||||
| // passwords to the error log. See note in PhutilLDAPAuthAdapter. | // passwords to the error log. See note in PhutilLDAPAuthAdapter. | ||||
| // See T3351. | // See T3351. | ||||
| DarkConsoleErrorLogPluginAPI::enableDiscardMode(); | DarkConsoleErrorLogPluginAPI::enableDiscardMode(); | ||||
| $account_id = $adapter->getAccountID(); | $identifiers = $adapter->getAccountIdentifiers(); | ||||
| DarkConsoleErrorLogPluginAPI::disableDiscardMode(); | DarkConsoleErrorLogPluginAPI::disableDiscardMode(); | ||||
| } else { | } else { | ||||
| throw new Exception(pht('Username and password are required!')); | throw new Exception(pht('Username and password are required!')); | ||||
| } | } | ||||
| } catch (PhutilAuthCredentialException $ex) { | } catch (PhutilAuthCredentialException $ex) { | ||||
| $response = $controller->buildProviderPageResponse( | $response = $controller->buildProviderPageResponse( | ||||
| $this, | $this, | ||||
| $this->renderLoginForm($request, 'login')); | $this->renderLoginForm($request, 'login')); | ||||
| return array($account, $response); | return array($account, $response); | ||||
| } catch (Exception $ex) { | } catch (Exception $ex) { | ||||
| // TODO: Make this cleaner. | // TODO: Make this cleaner. | ||||
| throw $ex; | throw $ex; | ||||
| } | } | ||||
| } | } | ||||
| return array($this->loadOrCreateAccount($account_id), $response); | return array($this->loadOrCreateAccount($identifiers), $response); | ||||
| } | } | ||||
| const KEY_HOSTNAME = 'ldap:host'; | const KEY_HOSTNAME = 'ldap:host'; | ||||
| const KEY_PORT = 'ldap:port'; | const KEY_PORT = 'ldap:port'; | ||||
| const KEY_DISTINGUISHED_NAME = 'ldap:dn'; | const KEY_DISTINGUISHED_NAME = 'ldap:dn'; | ||||
| const KEY_SEARCH_ATTRIBUTES = 'ldap:search-attribute'; | const KEY_SEARCH_ATTRIBUTES = 'ldap:search-attribute'; | ||||
| const KEY_USERNAME_ATTRIBUTE = 'ldap:username-attribute'; | const KEY_USERNAME_ATTRIBUTE = 'ldap:username-attribute'; | ||||
| ▲ Show 20 Lines • Show All 303 Lines • Show Last 20 Lines | |||||