From ef2e7b3f9d264ec146d4dae257b1e295ab3b462a Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Tue, 21 Apr 2015 12:45:58 +0200 Subject: updates - plugins as a separate git folder --- plugins/identity_select/composer.json | 24 --------- plugins/identity_select/identity_select.php | 68 ------------------------ plugins/identity_select/tests/IdentitySelect.php | 22 -------- 3 files changed, 114 deletions(-) delete mode 100644 plugins/identity_select/composer.json delete mode 100644 plugins/identity_select/identity_select.php delete mode 100644 plugins/identity_select/tests/IdentitySelect.php (limited to 'plugins/identity_select') diff --git a/plugins/identity_select/composer.json b/plugins/identity_select/composer.json deleted file mode 100644 index c31239360..000000000 --- a/plugins/identity_select/composer.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "roundcube/identity_select", - "type": "roundcube-plugin", - "description": "On reply to a message user identity selection is based on\n\t\tcontent of standard headers like From, To, Cc and Return-Path.\n\t\tHere you can add header(s) set by your SMTP server (e.g.\n\t\tDelivered-To, Envelope-To, X-Envelope-To, X-RCPT-TO) to make\n\t\tidentity selection more accurate.", - "license": "GPLv3+", - "version": "1.0", - "authors": [ - { - "name": "Aleksander Machniak", - "email": "alec@alec.pl", - "role": "Lead" - } - ], - "repositories": [ - { - "type": "composer", - "url": "http://plugins.roundcube.net" - } - ], - "require": { - "php": ">=5.3.0", - "roundcube/plugin-installer": ">=0.1.3" - } -} diff --git a/plugins/identity_select/identity_select.php b/plugins/identity_select/identity_select.php deleted file mode 100644 index 7973b5dad..000000000 --- a/plugins/identity_select/identity_select.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @license GNU GPLv3+ - */ -class identity_select extends rcube_plugin -{ - public $task = 'mail'; - - - function init() - { - $this->add_hook('identity_select', array($this, 'select')); - $this->add_hook('storage_init', array($this, 'storage_init')); - } - - /** - * Adds additional headers to supported headers list - */ - function storage_init($p) - { - $rcmail = rcmail::get_instance(); - - if ($add_headers = (array)$rcmail->config->get('identity_select_headers', array())) { - $p['fetch_headers'] = trim($p['fetch_headers'] . ' ' . strtoupper(join(' ', $add_headers))); - } - - return $p; - } - - /** - * Identity selection - */ - function select($p) - { - if ($p['selected'] !== null || !is_object($p['message']->headers)) { - return $p; - } - - $rcmail = rcmail::get_instance(); - - foreach ((array)$rcmail->config->get('identity_select_headers', array()) as $header) { - if ($header = $p['message']->headers->get($header, false)) { - foreach ($p['identities'] as $idx => $ident) { - if (in_array($ident['email_ascii'], (array)$header)) { - $p['selected'] = $idx; - break 2; - } - } - } - } - - return $p; - } -} diff --git a/plugins/identity_select/tests/IdentitySelect.php b/plugins/identity_select/tests/IdentitySelect.php deleted file mode 100644 index 461e79d85..000000000 --- a/plugins/identity_select/tests/IdentitySelect.php +++ /dev/null @@ -1,22 +0,0 @@ -api); - - $this->assertInstanceOf('identity_select', $plugin); - $this->assertInstanceOf('rcube_plugin', $plugin); - } -} -- cgit v1.2.3