mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-22 11:39:03 +01:00
Survive mild misconfiguration of Realname Attributes in LDAP
Summary: Currently, we'll fatal on array typehint issues if this is misconfigured. Instead, we should just reject the configuration. See some discussion in IRC. Test Plan: Used LDAP to log in. Reviewers: btrahan, totorico Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D6489
This commit is contained in:
parent
85798368be
commit
ab5ee5d193
1 changed files with 7 additions and 2 deletions
|
@ -24,6 +24,12 @@ final class PhabricatorAuthProviderLDAP
|
||||||
public function getAdapter() {
|
public function getAdapter() {
|
||||||
if (!$this->adapter) {
|
if (!$this->adapter) {
|
||||||
$conf = $this->getProviderConfig();
|
$conf = $this->getProviderConfig();
|
||||||
|
|
||||||
|
$realname_attributes = $conf->getProperty(self::KEY_REALNAME_ATTRIBUTES);
|
||||||
|
if (!is_array($realname_attributes)) {
|
||||||
|
$realname_attributes = array();
|
||||||
|
}
|
||||||
|
|
||||||
$adapter = id(new PhutilAuthAdapterLDAP())
|
$adapter = id(new PhutilAuthAdapterLDAP())
|
||||||
->setHostname(
|
->setHostname(
|
||||||
$conf->getProperty(self::KEY_HOSTNAME))
|
$conf->getProperty(self::KEY_HOSTNAME))
|
||||||
|
@ -35,8 +41,7 @@ final class PhabricatorAuthProviderLDAP
|
||||||
$conf->getProperty(self::KEY_SEARCH_ATTRIBUTE))
|
$conf->getProperty(self::KEY_SEARCH_ATTRIBUTE))
|
||||||
->setUsernameAttribute(
|
->setUsernameAttribute(
|
||||||
$conf->getProperty(self::KEY_USERNAME_ATTRIBUTE))
|
$conf->getProperty(self::KEY_USERNAME_ATTRIBUTE))
|
||||||
->setRealNameAttributes(
|
->setRealNameAttributes($realname_attributes)
|
||||||
$conf->getProperty(self::KEY_REALNAME_ATTRIBUTES, array()))
|
|
||||||
->setLDAPVersion(
|
->setLDAPVersion(
|
||||||
$conf->getProperty(self::KEY_VERSION))
|
$conf->getProperty(self::KEY_VERSION))
|
||||||
->setLDAPReferrals(
|
->setLDAPReferrals(
|
||||||
|
|
Loading…
Add table
Reference in a new issue