Create identity for each email address of a new user
This commit is contained in:
parent
a7c06ff2fd
commit
bde912a1fe
3 changed files with 14 additions and 7 deletions
|
@ -11,8 +11,9 @@ $rcmail_config['kolab_auth_filter'] = '(&(objectClass=kolabInetOrgPerson)(|(uid=
|
||||||
$rcmail_config['kolab_auth_login'] = 'email';
|
$rcmail_config['kolab_auth_login'] = 'email';
|
||||||
|
|
||||||
// Use this fields (from fieldmap configuration) for default identity.
|
// Use this fields (from fieldmap configuration) for default identity.
|
||||||
// Note: These aren't LDAP attributes, but field names in config
|
|
||||||
// If the value array contains more than one field, first non-empty will be used
|
// If the value array contains more than one field, first non-empty will be used
|
||||||
|
// Note: These aren't LDAP attributes, but field names in config
|
||||||
|
// Note: If there's more than one email address, as many identities will be created
|
||||||
$rcmail_config['kolab_auth_name'] = array('name', 'cn');
|
$rcmail_config['kolab_auth_name'] = array('name', 'cn');
|
||||||
$rcmail_config['kolab_auth_email'] = array('email');
|
$rcmail_config['kolab_auth_email'] = array('email');
|
||||||
|
|
||||||
|
|
|
@ -206,8 +206,15 @@ class kolab_auth extends rcube_plugin
|
||||||
public function user_create($args)
|
public function user_create($args)
|
||||||
{
|
{
|
||||||
if (!empty($this->data['user_email'])) {
|
if (!empty($this->data['user_email'])) {
|
||||||
$args['user_email'] = $this->data['user_email'];
|
// addresses list is supported
|
||||||
|
if (array_key_exists('email_list', $args)) {
|
||||||
|
$args['email_list'] = array_unique($this->data['user_email']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$args['user_email'] = $this->data['user_email'][0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($this->data['user_name'])) {
|
if (!empty($this->data['user_name'])) {
|
||||||
$args['user_name'] = $this->data['user_name'];
|
$args['user_name'] = $this->data['user_name'];
|
||||||
}
|
}
|
||||||
|
@ -374,12 +381,11 @@ class kolab_auth extends rcube_plugin
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// User email for identity (first log in)
|
// User email(s) for identity (first log in)
|
||||||
foreach ((array)$email_attr as $field) {
|
foreach ((array)$email_attr as $field) {
|
||||||
$email = is_array($record[$field]) ? $record[$field][0] : $record[$field];
|
$email = is_array($record[$field]) ? array_filter($record[$field]) : $record[$field];
|
||||||
if (!empty($email)) {
|
if (!empty($email)) {
|
||||||
$this->data['user_email'] = $email;
|
$this->data['user_email'] = array_merge((array)$this->data['user_email'], (array)$email);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
</lead>
|
</lead>
|
||||||
<date>2012-10-08</date>
|
<date>2012-10-08</date>
|
||||||
<version>
|
<version>
|
||||||
<release>0.3</release>
|
<release>0.4</release>
|
||||||
<api>0.1</api>
|
<api>0.1</api>
|
||||||
</version>
|
</version>
|
||||||
<stability>
|
<stability>
|
||||||
|
|
Loading…
Add table
Reference in a new issue