mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
8870ca5c5d
|
@ -296,6 +296,7 @@
|
||||||
- allow to set expiration dates in the past again
|
- allow to set expiration dates in the past again
|
||||||
- fix authentication with ldap if AD is used
|
- fix authentication with ldap if AD is used
|
||||||
- fix progress bar in list of users if quota is active
|
- fix progress bar in list of users if quota is active
|
||||||
|
- field storing email in ldap can be configured
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Changes in version 5.1.34
|
Changes in version 5.1.34
|
||||||
|
|
|
@ -35,6 +35,14 @@ is set to false. In that case the common name (cn) and email address is taken
|
||||||
from ldap. An already existing account in SeedDMS will be updated with data from
|
from ldap. An already existing account in SeedDMS will be updated with data from
|
||||||
ldap.
|
ldap.
|
||||||
|
|
||||||
|
Since version 5.1.35 and 6.0.28 the field name of the email address in ldap
|
||||||
|
can be set with the attribute `mailField`. If it is not set it defaults to `mail`.
|
||||||
|
|
||||||
|
Since version 5.1.34 and 6.0.27 the groups of a user stored in the ldap directory
|
||||||
|
can be synchronised with the groups in SeedDMS. The ldap field storing
|
||||||
|
the groups can be configured with the attribute `mailField`. This will add
|
||||||
|
new groups in SeedDMS and aѕsign them to the user.
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
|
|
@ -29,15 +29,17 @@ class SeedDMS_LdapAuthentication extends SeedDMS_Authentication {
|
||||||
var $settings;
|
var $settings;
|
||||||
|
|
||||||
protected function addUser($username, $info) {
|
protected function addUser($username, $info) {
|
||||||
return $this->dms->addUser($username, null, $info['cn'][0], isset($info['mail']) ? $info['mail'][0] : '', $this->settings->_language, $this->settings->_theme, "User was added from LDAP");
|
$mailfield = !empty($settings->_ldapMailField) ? $settings->_ldapMailField : 'mail';
|
||||||
|
return $this->dms->addUser($username, null, $info['cn'][0], isset($info[$mailfield]) ? $info[$mailfield][0] : '', $this->settings->_language, $this->settings->_theme, "User was added from LDAP");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function updateUser($user, $info) {
|
protected function updateUser($user, $info) {
|
||||||
|
$mailfield = !empty($settings->_ldapMailField) ? $settings->_ldapMailField : 'mail';
|
||||||
if(isset($info['cn'][0]) && ($info['cn'][0] != $user->getFullName())) {
|
if(isset($info['cn'][0]) && ($info['cn'][0] != $user->getFullName())) {
|
||||||
$user->setFullName($info['cn'][0]);
|
$user->setFullName($info['cn'][0]);
|
||||||
}
|
}
|
||||||
if(isset($info['mail'][0]) && ($info['mail'][0] != $user->getEmail())) {
|
if(isset($info[$mailfield][0]) && ($info[$mailfield][0] != $user->getEmail())) {
|
||||||
$user->setEmail($info['mail'][0]);
|
$user->setEmail($info[$mailfield][0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -404,6 +404,8 @@ class Settings { /* {{{ */
|
||||||
// Name of the ldap field containing the groups of the user, e.g. memeberOf
|
// Name of the ldap field containing the groups of the user, e.g. memeberOf
|
||||||
// This field must contain the DN of the groups
|
// This field must contain the DN of the groups
|
||||||
var $_ldapGroupField = "";
|
var $_ldapGroupField = "";
|
||||||
|
// Name of the ldap field containing the email of the user, e.g. mail, or mailprimaryaddress
|
||||||
|
var $_ldapMailField = "";
|
||||||
// Type of Ldap server: 0 = ldap; 1 = AD
|
// Type of Ldap server: 0 = ldap; 1 = AD
|
||||||
var $_ldapType = 1;
|
var $_ldapType = 1;
|
||||||
// Additional filter when searching for the user. If not set, the user will be searched
|
// Additional filter when searching for the user. If not set, the user will be searched
|
||||||
|
@ -744,6 +746,7 @@ class Settings { /* {{{ */
|
||||||
$this->_ldapType = 0;
|
$this->_ldapType = 0;
|
||||||
$this->_ldapFilter = strVal($connectorNode["filter"]);
|
$this->_ldapFilter = strVal($connectorNode["filter"]);
|
||||||
$this->_ldapGroupField = strVal($connectorNode["groupField"]);
|
$this->_ldapGroupField = strVal($connectorNode["groupField"]);
|
||||||
|
$this->_ldapMailField = strVal($connectorNode["mailField"]);
|
||||||
}
|
}
|
||||||
else if ($params['enable'] && ($typeConn == "AD"))
|
else if ($params['enable'] && ($typeConn == "AD"))
|
||||||
{
|
{
|
||||||
|
@ -756,6 +759,7 @@ class Settings { /* {{{ */
|
||||||
$this->_ldapFilter = strVal($connectorNode["filter"]);
|
$this->_ldapFilter = strVal($connectorNode["filter"]);
|
||||||
$this->_ldapAccountDomainName = strVal($connectorNode["accountDomainName"]);
|
$this->_ldapAccountDomainName = strVal($connectorNode["accountDomainName"]);
|
||||||
$this->_ldapGroupField = strVal($connectorNode["groupField"]);
|
$this->_ldapGroupField = strVal($connectorNode["groupField"]);
|
||||||
|
$this->_ldapMailField = strVal($connectorNode["mailField"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user