mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-11 08:28:43 +01:00
1) using hint-values of auth class about name, group, email, primary-group in $GLOBALS['auto_create_acct'], as the sql-class already does
2) using default group as specified in Setup >> Configuration for the primary group too, if none is given, this should fix also bug [ 958418 ] Registration problem with LDAP accounts
This commit is contained in:
parent
ee82c376f6
commit
0a5573a0fe
@ -1016,15 +1016,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$default_group_id = $this->name2id($GLOBALS['phpgw_info']['server']['default_group_lid']);
|
||||||
|
if (!$default_group_id)
|
||||||
|
{
|
||||||
|
$default_group_id = (int) $this->name2id('Default');
|
||||||
|
}
|
||||||
|
$primary_group = $GLOBALS['auto_create_acct']['primary_group'] &&
|
||||||
|
$this->get_type((int)$GLOBALS['auto_create_acct']['primary_group']) == 'g' ?
|
||||||
|
(int) $GLOBALS['auto_create_acct']['primary_group'] : $default_group_id;
|
||||||
|
|
||||||
$acct_info = array(
|
$acct_info = array(
|
||||||
'account_lid' => $accountname,
|
'account_lid' => $accountname,
|
||||||
'account_type' => 'u',
|
'account_type' => 'u',
|
||||||
'account_passwd' => $passwd,
|
'account_passwd' => $passwd,
|
||||||
'account_firstname' => 'New',
|
'account_firstname' => $GLOBALS['auto_create_acct']['firstname'] ? $GLOBALS['auto_create_acct']['firstname'] : 'New',
|
||||||
'account_lastname' => 'User',
|
'account_lastname' => $GLOBALS['auto_create_acct']['lastname'] ? $GLOBALS['auto_create_acct']['lastname'] : 'User',
|
||||||
'account_status' => $account_status,
|
'account_status' => $account_status,
|
||||||
'account_expires' => $expires
|
'account_expires' => $expires,
|
||||||
|
'account_primary_group' => $primary_group,
|
||||||
);
|
);
|
||||||
|
if ($GLOBALS['auto_create_acct']['email'])
|
||||||
|
{
|
||||||
|
$acct_info['account_email'] = $GLOBALS['auto_create_acct']['email'];
|
||||||
|
}
|
||||||
$this->create($acct_info,$default_prefs);
|
$this->create($acct_info,$default_prefs);
|
||||||
$accountid = $this->name2id($accountname);
|
$accountid = $this->name2id($accountname);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user