Remove alias handling - the feature doesn't exist in core anymore

This commit is contained in:
Aleksander Machniak 2012-09-23 09:25:06 +02:00
parent 39552da980
commit 73d1dba092
4 changed files with 16 additions and 28 deletions

View file

@ -12,7 +12,6 @@ $rcmail_config['kolab_auth_login'] = 'email';
// Use this fields (from fieldmap configuration) for default identity // Use this fields (from fieldmap configuration) for default identity
$rcmail_config['kolab_auth_name'] = 'name'; $rcmail_config['kolab_auth_name'] = 'name';
$rcmail_config['kolab_auth_alias'] = 'alias';
$rcmail_config['kolab_auth_email'] = 'email'; $rcmail_config['kolab_auth_email'] = 'email';
// Login and password of the admin user. Enables "Login As" feature. // Login and password of the admin user. Enables "Login As" feature.
@ -20,10 +19,10 @@ $rcmail_config['kolab_auth_admin_login'] = '';
$rcmail_config['kolab_auth_admin_password'] = ''; $rcmail_config['kolab_auth_admin_password'] = '';
// Enable audit logging for abuse of administrative privileges. // Enable audit logging for abuse of administrative privileges.
$rcmail_config['kolab_auth_auditlog'] = true; $rcmail_config['kolab_auth_auditlog'] = true;
// Role field (from fieldmap configuration) // Role field (from fieldmap configuration)
$rcmail_config['kolab_auth_role'] = 'role'; $rcmail_config['kolab_auth_role'] = 'role';
// The required value for the role attribute to contain should the user be allowed // The required value for the role attribute to contain should the user be allowed
// to login as another user. // to login as another user.
$rcmail_config['kolab_auth_role_value'] = ''; $rcmail_config['kolab_auth_role_value'] = '';

View file

@ -203,8 +203,6 @@ class kolab_auth extends rcube_plugin
$args['user_email'] = $this->data['user_email']; $args['user_email'] = $this->data['user_email'];
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'];
if (!empty($this->data['user_alias']))
$args['user_alias'] = $this->data['user_alias'];
return $args; return $args;
} }
@ -253,7 +251,6 @@ class kolab_auth extends rcube_plugin
$admin_login = $rcmail->config->get('kolab_auth_admin_login'); $admin_login = $rcmail->config->get('kolab_auth_admin_login');
$admin_pass = $rcmail->config->get('kolab_auth_admin_password'); $admin_pass = $rcmail->config->get('kolab_auth_admin_password');
$login_attr = $rcmail->config->get('kolab_auth_login'); $login_attr = $rcmail->config->get('kolab_auth_login');
$alias_attr = $rcmail->config->get('kolab_auth_alias');
$name_attr = $rcmail->config->get('kolab_auth_name'); $name_attr = $rcmail->config->get('kolab_auth_name');
// get username and host // get username and host
@ -351,8 +348,6 @@ class kolab_auth extends rcube_plugin
if ($login_attr) if ($login_attr)
$this->data['user_login'] = is_array($record[$login_attr]) ? $record[$login_attr][0] : $record[$login_attr]; $this->data['user_login'] = is_array($record[$login_attr]) ? $record[$login_attr][0] : $record[$login_attr];
if ($alias_attr)
$this->data['user_alias'] = is_array($record[$alias_attr]) ? $record[$alias_attr][0] : $record[$alias_attr];
if ($name_attr) if ($name_attr)
$this->data['user_name'] = is_array($record[$name_attr]) ? $record[$name_attr][0] : $record[$name_attr]; $this->data['user_name'] = is_array($record[$name_attr]) ? $record[$name_attr][0] : $record[$name_attr];

View file

@ -12,7 +12,6 @@ $rcmail_config['ldap_authentication_login'] = 'email';
// Use this fields (from fieldmap configuration) for default identity // Use this fields (from fieldmap configuration) for default identity
$rcmail_config['ldap_authentication_name'] = 'name'; $rcmail_config['ldap_authentication_name'] = 'name';
$rcmail_config['ldap_authentication_alias'] = 'alias'; $rcmail_config['ldap_authentication_email'] = 'email';
$rcmail_config['ldap_authentication_email'] = 'email';
?> ?>

View file

@ -32,23 +32,21 @@ class ldap_authentication extends rcube_plugin
private $ldap; private $ldap;
private $data = array(); private $data = array();
function init() function init()
{ {
$this->add_hook('authenticate', array($this, 'authenticate')); $this->add_hook('authenticate', array($this, 'authenticate'));
$this->add_hook('user_create', array($this, 'user_create')); $this->add_hook('user_create', array($this, 'user_create'));
} }
function user_create($args) function user_create($args)
{ {
if (!empty($this->data['user_email'])) if (!empty($this->data['user_email']))
$args['user_email'] = $this->data['user_email']; $args['user_email'] = $this->data['user_email'];
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'];
if (!empty($this->data['user_alias']))
$args['user_alias'] = $this->data['user_alias'];
return $args; return $args;
} }
function authenticate($args) function authenticate($args)
{ {
@ -83,13 +81,10 @@ class ldap_authentication extends rcube_plugin
$record = $results->records[0]; $record = $results->records[0];
$login_attr = $rcmail->config->get('ldap_authentication_login'); $login_attr = $rcmail->config->get('ldap_authentication_login');
$alias_attr = $rcmail->config->get('ldap_authentication_alias');
$name_attr = $rcmail->config->get('ldap_authentication_name'); $name_attr = $rcmail->config->get('ldap_authentication_name');
if ($login_attr) if ($login_attr)
$this->data['user_login'] = is_array($record[$login_attr]) ? $record[$login_attr][0] : $record[$login_attr]; $this->data['user_login'] = is_array($record[$login_attr]) ? $record[$login_attr][0] : $record[$login_attr];
if ($alias_attr)
$this->data['user_alias'] = is_array($record[$alias_attr]) ? $record[$alias_attr][0] : $record[$alias_attr];
if ($name_attr) if ($name_attr)
$this->data['user_name'] = is_array($record[$name_attr]) ? $record[$name_attr][0] : $record[$name_attr]; $this->data['user_name'] = is_array($record[$name_attr]) ? $record[$name_attr][0] : $record[$name_attr];