diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-05-07 18:05:33 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-05-07 18:05:33 -0400 |
commit | 55ee906ba36cf66c3a390c98dde75e241de26e65 (patch) | |
tree | ed4e5419bb6254c97d63d6a5cab5ab74536201a0 /app/User | |
parent | aac11a609c58ec8356e1ca479da456876034b06c (diff) |
Added support for language LDAP attribute
Diffstat (limited to 'app/User')
-rw-r--r-- | app/User/LdapUserProvider.php | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/app/User/LdapUserProvider.php b/app/User/LdapUserProvider.php index 3e2dcd2b..74cf4cd5 100644 --- a/app/User/LdapUserProvider.php +++ b/app/User/LdapUserProvider.php @@ -3,6 +3,7 @@ namespace Kanboard\User; use Kanboard\Core\User\UserProviderInterface; +use Kanboard\Model\Language; /** * LDAP User Provider @@ -69,6 +70,14 @@ class LdapUserProvider implements UserProviderInterface protected $photo = ''; /** + * User language + * + * @access protected + * @var string + */ + protected $language = ''; + + /** * Constructor * * @access public @@ -80,7 +89,7 @@ class LdapUserProvider implements UserProviderInterface * @param string[] $groupIds * @param string $photo */ - public function __construct($dn, $username, $name, $email, $role, array $groupIds, $photo = '') + public function __construct($dn, $username, $name, $email, $role, array $groupIds, $photo = '', $language = '') { $this->dn = $dn; $this->username = $username; @@ -89,6 +98,7 @@ class LdapUserProvider implements UserProviderInterface $this->role = $role; $this->groupIds = $groupIds; $this->photo = $photo; + $this->language = $language; } /** @@ -198,9 +208,13 @@ class LdapUserProvider implements UserProviderInterface */ public function getExtraAttributes() { - return array( - 'is_ldap_user' => 1, - ); + $attributes = array('is_ldap_user' => 1); + + if (! empty($this->language)) { + $attributes['language'] = Language::findCode($this->language); + } + + return $attributes; } /** |