diff options
author | Olav Morken <olav.morken@uninett.no> | 2009-03-17 08:05:15 +0000 |
---|---|---|
committer | Olav Morken <olav.morken@uninett.no> | 2009-03-17 08:05:15 +0000 |
commit | 74e85a7722baa45fb629bfa9cfbba7a10d4876a3 (patch) | |
tree | 4db8c3b866b95565f05522a1e3f2397e9293e526 /modules/ldap/lib/Auth/Source | |
parent | bd976907472e965fc92eee483ce09ba554dd83de (diff) | |
download | simplesamlphp-74e85a7722baa45fb629bfa9cfbba7a10d4876a3.zip simplesamlphp-74e85a7722baa45fb629bfa9cfbba7a10d4876a3.tar.gz simplesamlphp-74e85a7722baa45fb629bfa9cfbba7a10d4876a3.tar.bz2 |
ldap:LDAPMulti: Add support for including the organization as part of the username.
This commit introduces a new configuration option for LDAPMulti authentication
sources (include_organization_in_username). When this option is set to TRUE,
the organization will be appended to the username.
git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1412 44740490-163a-0410-bde0-09ae8108e29a
Diffstat (limited to 'modules/ldap/lib/Auth/Source')
-rw-r--r-- | modules/ldap/lib/Auth/Source/LDAPMulti.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/ldap/lib/Auth/Source/LDAPMulti.php b/modules/ldap/lib/Auth/Source/LDAPMulti.php index 4c56749..4535694 100644 --- a/modules/ldap/lib/Auth/Source/LDAPMulti.php +++ b/modules/ldap/lib/Auth/Source/LDAPMulti.php @@ -23,6 +23,11 @@ class sspmod_ldap_Auth_Source_LDAPMulti extends sspmod_core_Auth_UserPassOrgBase */ private $ldapOrgs; + /** + * Whether we should include the organization as part of the username. + */ + private $includeOrgInUsername; + /** * Constructor for this authentication source. @@ -53,6 +58,12 @@ class sspmod_ldap_Auth_Source_LDAPMulti extends sspmod_core_Auth_UserPassOrgBase continue; } + if ($name === 'include_organization_in_username') { + $this->includeOrgInUsername = $cfgHelper->getBoolean( + 'include_organization_in_username', FALSE); + continue; + } + $orgCfg = $cfgHelper->getArray($name); $orgId = $name; @@ -91,6 +102,10 @@ class sspmod_ldap_Auth_Source_LDAPMulti extends sspmod_core_Auth_UserPassOrgBase throw new SimpleSAML_Error_Error('WRONGUSERPASS'); } + if ($this->includeOrgInUsername) { + $username = $username . '@' . $org; + } + return $this->ldapOrgs[$org]->login($username, $password); } |