* LDAP: fixed not working creation of new groups (with empty describtion)

This commit is contained in:
Ralf Becker 2015-03-29 16:10:02 +00:00
parent 86d0b31b3b
commit 55082bcc68

View File

@ -285,7 +285,7 @@ class accounts_ldap
// now we merge the user or group data // now we merge the user or group data
if ($is_group) if ($is_group)
{ {
$to_write = $this->_merge_group($to_write,$data_utf8); $to_write = $this->_merge_group($to_write, $data_utf8, $old);
$data['account_type'] = 'g'; $data['account_type'] = 'g';
$objectclass = $old ? $old['objectclass'] : $to_write['objectclass']; $objectclass = $old ? $old['objectclass'] : $to_write['objectclass'];
@ -551,12 +551,14 @@ class accounts_ldap
* @param array $data array with account-data in utf-8 * @param array $data array with account-data in utf-8
* @return array merged data * @return array merged data
*/ */
protected function _merge_group($to_write,$data) protected function _merge_group($to_write,$data,$old=null)
{ {
$to_write['gidnumber'] = abs($data['account_id']); $to_write['gidnumber'] = abs($data['account_id']);
$to_write['cn'] = $data['account_lid']; $to_write['cn'] = $data['account_lid'];
$to_write['description'] = $data['account_description']; if (!empty($data['account_description']) || $old)
{
$to_write['description'] = !empty($data['account_description']) ? $data['account_description'] : array();
}
return $to_write; return $to_write;
} }