change needed for integration of emailadmin

ldap bugfixing
This commit is contained in:
Lars Kneschke 2003-08-31 22:09:12 +00:00
parent ec432051ff
commit e3dde66e08
2 changed files with 20 additions and 5 deletions

View File

@ -682,6 +682,13 @@
}
*/
if ($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap' &&
(!$_userData['account_lastname'] && !$_userData['lastname']))
{
$error[$totalerrors] = lang('You must enter a lastname');
$totalerrors++;
}
if (!$_userData['account_lid'])
{
$error[$totalerrors] = lang('You must enter a loginid');

View File

@ -718,7 +718,7 @@
$entry['objectclass'][0] = 'top';
$entry['objectclass'][1] = 'posixGroup';
$entry['objectclass'][2] = 'phpgwAccount';
$entry['cn'] = $account_info['account_lid'];
$entry['cn'] = utf8_encode($account_info['account_lid']);
$entry['gidnumber'] = $account_id;
$entry['userpassword'] = $GLOBALS['phpgw']->common->encrypt_password($account_info['account_passwd']);
$entry['description'] = 'phpgw-created group';
@ -726,9 +726,17 @@
else
{
$dn = 'uid=' . $account_info['account_lid'] . ',' . $this->user_context;
$entry['cn'] = sprintf("%s %s", $account_info['account_firstname'], $account_info['account_lastname']);
$entry['sn'] = $account_info['account_lastname'];
$entry['givenname'] = $account_info['account_firstname'];
$entry['cn'] = utf8_encode(sprintf("%s %s",
$account_info['account_firstname'],
$account_info['account_lastname']
));
$entry['sn'] = utf8_encode($account_info['account_lastname']);
if($account_info['account_firstname'])
$entry['givenname'] = utf8_encode($account_info['account_firstname']);
$entry['uid'] = $account_info['account_lid'];
$entry['uidnumber'] = $account_id;
if ($GLOBALS['phpgw_info']['server']['ldap_group_id'])
@ -756,7 +764,7 @@
ldap_add($this->ds, $dn, $entry);
}
/* print ldap_error($this->ds); */
// print ldap_error($this->ds);
if($account_id && is_object($GLOBALS['phpgw']->preferences) && $default_prefs)
{