check for systemusers as well and deny creation, when such a user already exists

This commit is contained in:
Klaus Leithoff 2009-12-16 14:10:15 +00:00
parent 86346deefe
commit cbdd9507ad

View File

@ -352,7 +352,17 @@
$error[$totalerrors] = lang('The groups must include the primary group');
$totalerrors++;
}
// if accounts stored in ldap, there is a chance that users are systemusers as well.
// check if an account already exists there, and if it does deny creation (increase the totalerrors counter
// and the message thereof
if($GLOBALS['egw_info']['server']['account_repository'] == 'ldap')
{
if (posix_getpwnam($_userData['account_lid']))
{
$error[$totalerrors] = lang('There already is a system-user with this name. User\'s should not have the same name as a systemuser');
$totalerrors++;
}
}
if($_userData['old_loginid'] != $_userData['account_lid'])
{
if($GLOBALS['egw']->accounts->exists($_userData['account_lid']))