mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-04-26 15:20:16 +00:00
Rename username to name in group mappings, drop unused fullname from example
Usinger "username" for the group name is confusing and misleading. Just use name, but support our users who still have username. We don't use fullname, drop it from the example.
This commit is contained in:
parent
bb713137fd
commit
13083b07e8
@ -712,9 +712,8 @@ $c->admin_email = 'calendar-admin@example.com';
|
||||
// ),
|
||||
/* used to create the group based on the ldap properties */
|
||||
// 'group_mapping_field' => array(
|
||||
// "username" => "cn",
|
||||
// "name" => "cn",
|
||||
// "modified" => "modifyTimestamp",
|
||||
// "fullname" => "cn",
|
||||
// "members" => "member"
|
||||
// ),
|
||||
|
||||
|
||||
@ -498,6 +498,14 @@ function sync_LDAP_groups(){
|
||||
if ( ! $ldapDriver->valid ) return;
|
||||
|
||||
$mapping = $c->authenticate_hook['config']['group_mapping_field'];
|
||||
|
||||
// Old config (pre 1.1.13) used "username" as the group name, if that is in
|
||||
// use, copy it to the new name: name.
|
||||
if ( ! isset($mapping['name']) && isset($mapping['username']) ) {
|
||||
$mapping['name'] = $mapping['username'];
|
||||
unset($mapping['username']);
|
||||
}
|
||||
|
||||
$attributes = array_values_mapping($mapping);
|
||||
$ldap_groups_tmp = $ldapDriver->getAllGroups($attributes);
|
||||
|
||||
@ -510,8 +518,8 @@ function sync_LDAP_groups(){
|
||||
$dnfix = isset($c->authenticate_hook['config']['group_member_dnfix'])
|
||||
&& $c->authenticate_hook['config']['group_member_dnfix'];
|
||||
|
||||
foreach($ldap_groups_tmp as $key => $ldap_group){
|
||||
$group_mapping = $ldap_group[$mapping['username']];
|
||||
foreach ($ldap_groups_tmp as $key => $ldap_group) {
|
||||
$group_name = $ldap_group[$mapping['name']];
|
||||
$ldap_groups_info[$group_mapping] = $ldap_group;
|
||||
|
||||
if ( isset($ldap_groups_info[$group_mapping][$member_field]) ) {
|
||||
|
||||
@ -39,9 +39,9 @@
|
||||
//ldap "email" => "mail"
|
||||
//ldap ),
|
||||
//ldap 'group_mapping_field' => array(
|
||||
// Test with the old name, new name is "name""
|
||||
//ldap "username" => "cn",
|
||||
//ldap "modified" => "modifyTimestamp",
|
||||
//ldap "fullname" => "cn" ,
|
||||
//ldap "members" => "memberUid",
|
||||
//ldap ),
|
||||
//ldap 'format_updated' => array(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user