From e6d8f97bf2e0bbb4d95df0c4e030eb7ec6ef75a5 Mon Sep 17 00:00:00 2001 From: thomasb Date: Sat, 31 Mar 2012 12:25:48 +0000 Subject: Move plugins repository into roundcubemail root folder; svn:externals are not defined anymore git-svn-id: https://svn.roundcube.net/trunk@6034 208e9e7b-5314-0410-a742-e7e81cd9613c --- plugins/new_user_identity/new_user_identity.php | 89 ------------------------- plugins/new_user_identity/package.xml | 49 -------------- 2 files changed, 138 deletions(-) delete mode 100644 plugins/new_user_identity/new_user_identity.php delete mode 100644 plugins/new_user_identity/package.xml (limited to 'plugins/new_user_identity') diff --git a/plugins/new_user_identity/new_user_identity.php b/plugins/new_user_identity/new_user_identity.php deleted file mode 100644 index 7b67578bf..000000000 --- a/plugins/new_user_identity/new_user_identity.php +++ /dev/null @@ -1,89 +0,0 @@ -add_hook('user_create', array($this, 'lookup_user_name')); - } - - function lookup_user_name($args) - { - $rcmail = rcmail::get_instance(); - - if ($this->init_ldap($args['host'])) { - $results = $this->ldap->search('*', $args['user'], TRUE); - if (count($results->records) == 1) { - $args['user_name'] = $results->records[0]['name']; - if (!$args['user_email'] && strpos($results->records[0]['email'], '@')) { - $args['user_email'] = rcube_idn_to_ascii($results->records[0]['email']); - } - if (($alias_col = $rcmail->config->get('new_user_identity_alias')) && $results->records[0][$alias_col]) { - $args['alias'] = $results->records[0][$alias_col]; - } - } - } - return $args; - } - - private function init_ldap($host) - { - if ($this->ldap) - return $this->ldap->ready; - - $rcmail = rcmail::get_instance(); - - $addressbook = $rcmail->config->get('new_user_identity_addressbook'); - $ldap_config = (array)$rcmail->config->get('ldap_public'); - $match = $rcmail->config->get('new_user_identity_match'); - - if (empty($addressbook) || empty($match) || empty($ldap_config[$addressbook])) { - return false; - } - - $this->ldap = new new_user_identity_ldap_backend( - $ldap_config[$addressbook], - $rcmail->config->get('ldap_debug'), - $rcmail->config->mail_domain($host), - $match); - - return $this->ldap->ready; - } -} - -class new_user_identity_ldap_backend extends rcube_ldap -{ - function __construct($p, $debug, $mail_domain, $search) - { - parent::__construct($p, $debug, $mail_domain); - $this->prop['search_fields'] = (array)$search; - } -} diff --git a/plugins/new_user_identity/package.xml b/plugins/new_user_identity/package.xml deleted file mode 100644 index 95f1dc0dc..000000000 --- a/plugins/new_user_identity/package.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - new_user_identity - pear.roundcube.net - Populates a new user's default identity from LDAP on their first visit. - - Populates a new user's default identity from LDAP on their first visit. - - - Aleksander Machniak - alec - alec@alec.pl - yes - - 2011-11-21 - - 1.0.5 - 1.0 - - - stable - stable - - GNU GPLv2 - - - - - - - - - - - - - - - 5.2.1 - - - 1.7.0 - - - - - -- cgit v1.2.3