diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-05-08 14:28:36 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-05-08 14:28:36 +0200 |
commit | a522971cf853b2f0ccd1b569491a06218ebbaee9 (patch) | |
tree | cf0e8c6bbe0978cf302b112080370b9a01cf5900 /plugins | |
parent | ea6d6958e0a32c88bf8c00cbd118cfcd48fae096 (diff) | |
parent | c4723999e21da0b266b0467de6e58cbd26c4b5bf (diff) |
Merge branch 'master' of github.com:roundcube/roundcubemail
Conflicts:
program/js/list.js
Diffstat (limited to 'plugins')
30 files changed, 291 insertions, 62 deletions
diff --git a/plugins/acl/acl.php b/plugins/acl/acl.php index 938287b1a..28139e92c 100644 --- a/plugins/acl/acl.php +++ b/plugins/acl/acl.php @@ -384,7 +384,6 @@ class acl extends rcube_plugin $table->add_header(array('class' => 'acl'.$key, 'title' => $label), $label); } - $i = 1; $js_table = array(); foreach ($acl as $user => $rights) { if ($this->rc->storage->conn->user == $user) { @@ -433,8 +432,9 @@ class acl extends rcube_plugin $acl = trim(rcube_utils::get_input_value('_acl', rcube_utils::INPUT_GPC)); $oldid = trim(rcube_utils::get_input_value('_old', rcube_utils::INPUT_GPC)); - $acl = array_intersect(str_split($acl), $this->rights_supported()); - $users = $oldid ? array($user) : explode(',', $user); + $acl = array_intersect(str_split($acl), $this->rights_supported()); + $users = $oldid ? array($user) : explode(',', $user); + $result = 0; foreach ($users as $user) { $user = trim($user); diff --git a/plugins/attachment_reminder/attachment_reminder.js b/plugins/attachment_reminder/attachment_reminder.js new file mode 100755 index 000000000..a4f3e6325 --- /dev/null +++ b/plugins/attachment_reminder/attachment_reminder.js @@ -0,0 +1,51 @@ +/* Attachment Reminder plugin script */ + +function rcmail_get_compose_message() +{ + var msg; + + if (window.tinyMCE && (ed = tinyMCE.get(rcmail.env.composebody))) { + msg = ed.getContent(); + msg = msg.replace(/<blockquote[^>]*>(.|[\r\n])*<\/blockquote>/gmi, ''); + } + else { + msg = $('#' + rcmail.env.composebody).val(); + msg = msg.replace(/^>.*$/gmi, ''); + } + + return msg; +} + +function rcmail_check_message(msg) +{ + var i, rx, keywords = rcmail.gettext('keywords', 'attachment_reminder').split(",").concat([".doc", ".pdf"]); + + $.each(keywords, function(n) { return RegExp.escape(n); }); + rx = new RegExp('(' + keywords.join('|') + ')', 'i'); + + return msg.search(rx) != -1; +} + +function rcmail_have_attachments() +{ + return rcmail.env.attachments && $('li', rcmail.gui_objects.attachmentlist).length; +} + + +if (window.rcmail) { + rcmail.addEventListener('beforesend', function(evt) { + var msg = rcmail_get_compose_message(), + subject = $('#compose-subject').val(); + + if (!rcmail_have_attachments() && (rcmail_check_message(msg) || rcmail_check_message(subject))) { + if (confirm(rcmail.gettext('forgotattachment', 'attachment_reminder'))) { + if (window.UI && UI.show_uploadform) // Larry skin + UI.show_uploadform(); + else if (window.rcmail_ui && rcmail_ui.show_popup) // classic skin + rcmail_ui.show_popup('uploadmenu', true); + + return false; + } + } + }); +} diff --git a/plugins/attachment_reminder/attachment_reminder.php b/plugins/attachment_reminder/attachment_reminder.php new file mode 100755 index 000000000..0a2597329 --- /dev/null +++ b/plugins/attachment_reminder/attachment_reminder.php @@ -0,0 +1,81 @@ +<?php +/** + * Attachement Reminder + * + * A plugin that reminds a user to attach the files + * + * @version @package_version@ + * @author Thomas Yu - Sian, Liu + * @author Aleksander Machniak <machniak@kolabsys.com> + * + * Copyright (C) 2013 Thomas Yu - Sian, Liu + * Copyright (C) 2013, Kolab Systems AG + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/> + */ + +class attachment_reminder extends rcube_plugin +{ + public $task = 'mail|settings'; + public $noajax = true; + + + function init() + { + $rcmail = rcube::get_instance(); + + if ($rcmail->task == 'mail' && $rcmail->action == 'compose') { + $this->include_script('attachment_reminder.js'); + $this->add_texts('localization/', array('keywords', 'forgotattachment')); + } + + if ($rcmail->task == 'settings') { + $dont_override = $rcmail->config->get('dont_override', array()); + + if (!in_array('attachment_reminder', $dont_override)) { + $this->add_hook('preferences_list', array($this, 'prefs_list')); + $this->add_hook('preferences_save', array($this, 'prefs_save')); + } + } + } + + function prefs_list($args) + { + if ($args['section'] == 'compose') { + $this->add_texts('localization/'); + $reminder = rcube::get_instance()->config->get('attachment_reminder'); + $field_id = 'rcmfd_attachment_reminder'; + $checkbox = new html_checkbox(array('name' => '_attachment_reminder', 'id' => $field_id, 'value' => 1)); + + $args['blocks']['main']['options']['attachment_reminder'] = array( + 'title' => html::label($field_id, rcube::Q($this->gettext('reminderoption'))), + 'content' => $checkbox->show($reminder ? 1 : 0), + ); + } + + return $args; + } + + function prefs_save($args) + { + if ($args['section'] == 'compose') { + $dont_override = rcube::get_instance()->config->get('dont_override', array()); + if (!in_array('attachment_reminder', $dont_override)) { + $args['prefs']['attachment_reminder'] = !empty($_POST['_attachment_reminder']); + } + } + return $args; + } + +} diff --git a/plugins/attachment_reminder/localization/de_CH.inc b/plugins/attachment_reminder/localization/de_CH.inc new file mode 100644 index 000000000..bf6eef721 --- /dev/null +++ b/plugins/attachment_reminder/localization/de_CH.inc @@ -0,0 +1,5 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "Haben Sie möglicherweise vergessen eine Datei anzuhängen?"; +$messages['keywords'] = "anbei,im anhang,angehängt,angefügt,beigefügt,beliegend"; diff --git a/plugins/attachment_reminder/localization/de_DE.inc b/plugins/attachment_reminder/localization/de_DE.inc new file mode 100644 index 000000000..bf6eef721 --- /dev/null +++ b/plugins/attachment_reminder/localization/de_DE.inc @@ -0,0 +1,5 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "Haben Sie möglicherweise vergessen eine Datei anzuhängen?"; +$messages['keywords'] = "anbei,im anhang,angehängt,angefügt,beigefügt,beliegend"; diff --git a/plugins/attachment_reminder/localization/en_US.inc b/plugins/attachment_reminder/localization/en_US.inc new file mode 100644 index 000000000..a736682db --- /dev/null +++ b/plugins/attachment_reminder/localization/en_US.inc @@ -0,0 +1,6 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "Did you forget to attach a file?"; +$messages['reminderoption'] = "Remind about forgotten attachments"; +$messages['keywords'] = "attachment,file,attach,attached,attaching,enclosed,CV,cover letter"; diff --git a/plugins/attachment_reminder/localization/es_ES.inc b/plugins/attachment_reminder/localization/es_ES.inc new file mode 100644 index 000000000..8e3512182 --- /dev/null +++ b/plugins/attachment_reminder/localization/es_ES.inc @@ -0,0 +1,5 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "¿Olvidó adjuntar un fichero al mensaje?"; +$messages['keywords'] = "adjunto"; diff --git a/plugins/attachment_reminder/localization/fr_FR.inc b/plugins/attachment_reminder/localization/fr_FR.inc new file mode 100644 index 000000000..ab48cc517 --- /dev/null +++ b/plugins/attachment_reminder/localization/fr_FR.inc @@ -0,0 +1,5 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "Avez vous oublié d'attacher un fichier ?"; +$messages['keywords'] = "joins,joint,attaché,CV";
\ No newline at end of file diff --git a/plugins/attachment_reminder/localization/it_IT.inc b/plugins/attachment_reminder/localization/it_IT.inc new file mode 100644 index 000000000..2807bc185 --- /dev/null +++ b/plugins/attachment_reminder/localization/it_IT.inc @@ -0,0 +1,6 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "Sembra che tu abbia dimenticato di allegare un file!\nPremere Annulla per inviare lo stesso.\nOK per tornare al messaggio senza inviare."; +$messages['keywords'] = "allegato,allegati,allegata,allegate,allega,allego,alleghi,attaccato,file,attachment,attach"; + diff --git a/plugins/attachment_reminder/localization/nl_NL.inc b/plugins/attachment_reminder/localization/nl_NL.inc new file mode 100644 index 000000000..62564f103 --- /dev/null +++ b/plugins/attachment_reminder/localization/nl_NL.inc @@ -0,0 +1,5 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "Ben je vergeten het bestand bij te voegen?"; +$messages['keywords'] = "attachment,bestand,bijgaand,bijgaande,brief,bijgevoegd,bijgesloten,CV"; diff --git a/plugins/attachment_reminder/localization/pl_PL.inc b/plugins/attachment_reminder/localization/pl_PL.inc new file mode 100644 index 000000000..96f4f4989 --- /dev/null +++ b/plugins/attachment_reminder/localization/pl_PL.inc @@ -0,0 +1,6 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "Czy nie zapomniałeś załączyć pliku?"; +$messages['reminderoption'] = "Włącz przypominanie o brakującym załączniku"; +$messages['keywords'] = "załącznik,plik,załącz,CV"; diff --git a/plugins/attachment_reminder/localization/zh_CN.inc b/plugins/attachment_reminder/localization/zh_CN.inc new file mode 100644 index 000000000..27cf04b25 --- /dev/null +++ b/plugins/attachment_reminder/localization/zh_CN.inc @@ -0,0 +1,5 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "您似乎忘記加入附件了,你確定要寄出?"; +$messages['keywords'] = "附件,附加,附檔,附上,附加檔案"; diff --git a/plugins/attachment_reminder/localization/zh_TW.inc b/plugins/attachment_reminder/localization/zh_TW.inc new file mode 100644 index 000000000..27cf04b25 --- /dev/null +++ b/plugins/attachment_reminder/localization/zh_TW.inc @@ -0,0 +1,5 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "您似乎忘記加入附件了,你確定要寄出?"; +$messages['keywords'] = "附件,附加,附檔,附上,附加檔案"; diff --git a/plugins/attachment_reminder/package.xml b/plugins/attachment_reminder/package.xml new file mode 100644 index 000000000..43861182e --- /dev/null +++ b/plugins/attachment_reminder/package.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 + http://pear.php.net/dtd/tasks-1.0.xsd + http://pear.php.net/dtd/package-2.0 + http://pear.php.net/dtd/package-2.0.xsd"> + <name>Attachment Reminder</name> + <summary>Roundcube plugin that prompts you if it looks like you wanted to attach a file but you didn't.</summary> + <description> + This Roundcube plugin reminds the user to attach a file if the composed message text indicates that there should be any. + </description> + <lead> + <name>Aleksander Machniak</name> + <user>alec</user> + <email>alec@alec.pl</email> + <active>yes</active> + </lead> + <lead> + <name>Thomas Yu - Sian , Liu</name> + <active>yes</active> + </lead> + <version> + <release>1.1</release> + <api>1.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> + <notes>-</notes> + <contents> + <dir baseinstalldir="/" name="/"> + <file name="attachment_reminder.php" role="php"> + <tasks:replace from="@name@" to="name" type="package-info"/> + <tasks:replace from="@package_version@" to="version" type="package-info"/> + </file> + <file name="attachment_reminder.js" role="data"> + <tasks:replace from="@name@" to="name" type="package-info"/> + <tasks:replace from="@package_version@" to="version" type="package-info"/> + </file> + + <file name="localization/de_CH.inc" role="data"></file> + <file name="localization/de_DE.inc" role="data"></file> + <file name="localization/en_US.inc" role="data"></file> + <file name="localization/es_ES.inc" role="data"></file> + <file name="localization/fr_FR.inc" role="data"></file> + <file name="localization/it_IT.inc" role="data"></file> + <file name="localization/nl_NL.inc" role="data"></file> + <file name="localization/pl_PL.inc" role="data"></file> + <file name="localization/zh_CN.inc" role="data"></file> + <file name="localization/zh_TW.inc" role="data"></file> + </dir> + <!-- / --> + </contents> + <dependencies> + <required> + <php> + <min>5.2.1</min> + </php> + <pearinstaller> + <min>1.7.0</min> + </pearinstaller> + </required> + </dependencies> + <phprelease/> +</package> diff --git a/plugins/autologon/autologon.php b/plugins/autologon/autologon.php index 63ffb943e..9c7d5b6fc 100644 --- a/plugins/autologon/autologon.php +++ b/plugins/autologon/autologon.php @@ -19,8 +19,6 @@ class autologon extends rcube_plugin function startup($args) { - $rcmail = rcmail::get_instance(); - // change action to login if (empty($_SESSION['user_id']) && !empty($_GET['_autologin']) && $this->is_localhost()) $args['action'] = 'login'; @@ -37,7 +35,7 @@ class autologon extends rcube_plugin $args['cookiecheck'] = false; $args['valid'] = true; } - + return $args; } diff --git a/plugins/debug_logger/runlog/runlog.php b/plugins/debug_logger/runlog/runlog.php index c9f672615..0c766a13c 100644 --- a/plugins/debug_logger/runlog/runlog.php +++ b/plugins/debug_logger/runlog/runlog.php @@ -194,7 +194,7 @@ class runlog { public function print_totals(){ $totals = array(); - foreach ( $this->run_log as $k => $entry ) { + foreach ($this->run_log as $entry) { if ( $entry['type'] == 'start' && $entry['ended'] == true) { $totals[$entry['value']]['duration'] += $entry['duration']; $totals[$entry['value']]['count'] += 1; diff --git a/plugins/enigma/enigma.php b/plugins/enigma/enigma.php index c96b94620..25520a27d 100644 --- a/plugins/enigma/enigma.php +++ b/plugins/enigma/enigma.php @@ -47,6 +47,8 @@ class enigma extends rcube_plugin $rcmail = rcmail::get_instance(); $this->rc = $rcmail; + $section = rcube_utils::get_input_value('_section', rcube_utils::INPUT_GET); + if ($this->rc->task == 'mail') { // message parse/display hooks $this->add_hook('message_part_structure', array($this, 'parse_structure')); @@ -79,7 +81,6 @@ class enigma extends rcube_plugin $this->register_action('plugin.enigma', array($this, 'preferences_ui')); // grab keys/certs management iframe requests - $section = rcube_utils::get_input_value('_section', rcube_utils::INPUT_GET); if ($this->rc->action == 'edit-prefs' && preg_match('/^enigma(certs|keys)/', $section)) { $this->load_ui(); $this->ui->init($section); @@ -148,7 +149,7 @@ class enigma extends rcube_plugin */ function parse_structure($p) { - $struct = $p['structure']; +// $struct = $p['structure']; if ($p['mimetype'] == 'text/plain' || $p['mimetype'] == 'application/pgp') { $this->parse_plain($p); @@ -390,7 +391,7 @@ class enigma extends rcube_plugin function message_load($p) { $this->message = $p['object']; - + // handle attachments vcard attachments foreach ((array)$this->message->attachments as $attachment) { if ($this->is_keys_part($attachment)) { @@ -398,7 +399,7 @@ class enigma extends rcube_plugin } } // the same with message bodies - foreach ((array)$this->message->parts as $idx => $part) { + foreach ((array)$this->message->parts as $part) { if ($this->is_keys_part($part)) { $this->keys_parts[] = $part->mime_id; $this->keys_bodies[] = $part->mime_id; diff --git a/plugins/enigma/lib/enigma_engine.php b/plugins/enigma/lib/enigma_engine.php index 220d6c0b3..8a64c07ff 100644 --- a/plugins/enigma/lib/enigma_engine.php +++ b/plugins/enigma/lib/enigma_engine.php @@ -374,17 +374,15 @@ class enigma_engine { // @TODO: Handle big bodies using (temp) files // @TODO: caching of verification result - - $sig = $this->pgp_driver->verify($msg_body, $sig_body); + $sig = $this->pgp_driver->verify($msg_body, $sig_body); - if (($sig instanceof enigma_error) && $sig->getCode() != enigma_error::E_KEYNOTFOUND) - rcube::raise_error(array( + if (($sig instanceof enigma_error) && $sig->getCode() != enigma_error::E_KEYNOTFOUND) + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, - 'message' => "Enigma plugin: " . $error->getMessage() + 'message' => "Enigma plugin: " . $sig->getMessage() ), true, false); -//print_r($sig); return $sig; } @@ -399,11 +397,9 @@ class enigma_engine { // @TODO: Handle big bodies using (temp) files // @TODO: caching of verification result - + $key = ''; $pass = ''; // @TODO $result = $this->pgp_driver->decrypt($msg_body, $key, $pass); -//print_r($result); - if ($result instanceof enigma_error) { $err_code = $result->getCode(); if (!in_array($err_code, array(enigma_error::E_KEYNOTFOUND, enigma_error::E_BADPASS))) @@ -430,7 +426,7 @@ class enigma_engine { $this->load_pgp_driver(); $result = $this->pgp_driver->list_keys($pattern); - + if ($result instanceof enigma_error) { rcube::raise_error(array( 'code' => 600, 'type' => 'php', @@ -438,7 +434,7 @@ class enigma_engine 'message' => "Enigma plugin: " . $result->getMessage() ), true, false); } - + return $result; } @@ -501,9 +497,11 @@ class enigma_engine $uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST); $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST); $mime_id = rcube_utils::get_input_value('_part', rcube_utils::INPUT_POST); + $storage = $this->rc->get_storage(); if ($uid && $mime_id) { - $part = $this->rc->storage->get_message_part($uid, $mime_id); + $storage->set_folder($mbox); + $part = $storage->get_message_part($uid, $mime_id); } if ($part && is_array($result = $this->import_key($part))) { @@ -532,16 +530,4 @@ class enigma_engine $uid, $part->mime_id, $part); } } - - /** - * Adds CSS style file to the page header. - */ - private function add_css() - { - $skin = $this->rc->config->get('skin'); - if (!file_exists($this->home . "/skins/$skin/enigma.css")) - $skin = 'default'; - - $this->include_stylesheet("skins/$skin/enigma.css"); - } } diff --git a/plugins/enigma/lib/enigma_ui.php b/plugins/enigma/lib/enigma_ui.php index 47366b7e8..adb619d0c 100644 --- a/plugins/enigma/lib/enigma_ui.php +++ b/plugins/enigma/lib/enigma_ui.php @@ -176,8 +176,7 @@ class enigma_ui $search = rcube_utils::get_input_value('_q', rcube_utils::INPUT_GPC); // define list of cols to be displayed - $a_show_cols = array('name'); - $result = array(); +// $a_show_cols = array('name'); // Get the list $list = $this->enigma->engine->list_keys($search); @@ -200,7 +199,7 @@ class enigma_ui $size = count($list); // Add rows - foreach($list as $idx => $key) { + foreach ($list as $key) { $this->rc->output->command('enigma_add_list_row', array('name' => rcube::Q($key->name), 'id' => $key->id)); } diff --git a/plugins/help/help.php b/plugins/help/help.php index 4b11dceb3..69da6828e 100644 --- a/plugins/help/help.php +++ b/plugins/help/help.php @@ -21,8 +21,6 @@ class help extends rcube_plugin function init() { - $rcmail = rcmail::get_instance(); - $this->add_texts('localization/', false); // register task diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php index 80f590f4b..0e95b0fba 100644 --- a/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php +++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php @@ -206,7 +206,6 @@ class rcube_sieve_script // rules foreach ($this->content as $rule) { - $extension = ''; $script = ''; $tests = array(); $i = 0; @@ -1015,11 +1014,10 @@ class rcube_sieve_script * @param mixed $num Number of tokens to return, 0 for all * or True for all tokens until separator is found. * Separator will be returned as last token. - * @param int $in_list Enable to call recursively inside a list * * @return mixed Tokens array or string if $num=1 */ - static function tokenize(&$str, $num=0, $in_list=false) + static function tokenize(&$str, $num=0) { $result = array(); @@ -1054,7 +1052,7 @@ class rcube_sieve_script // Parenthesized list case '[': $str = substr($str, 1); - $result[] = self::tokenize($str, 0, true); + $result[] = self::tokenize($str, 0); break; case ']': $str = substr($str, 1); diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php index 817fa8650..fc2a79ddb 100644 --- a/plugins/managesieve/managesieve.php +++ b/plugins/managesieve/managesieve.php @@ -1640,7 +1640,7 @@ class managesieve extends rcube_plugin .'value="' . rcube::Q($action['value']) . '" size="35" ' . $this->error_class($id, 'action', 'value', 'action_varvalue') .' />'; $out .= '<br /><span class="label">' .rcube::Q($this->gettext('setvarmodifiers')) . '</span><br />'; - foreach ($set_modifiers as $j => $s_m) { + foreach ($set_modifiers as $s_m) { $s_m_id = 'action_varmods' . $id . $s_m; $out .= sprintf('<input type="checkbox" name="_action_varmods[%s][]" value="%s" id="%s"%s />%s<br>', $id, $s_m, $s_m_id, @@ -1902,7 +1902,7 @@ class managesieve extends rcube_plugin $user_script = $_SESSION['managesieve_user_script']; // if the script is not active... - if ($user_script && ($key = array_search($name, $this->active)) === false) { + if ($user_script && array_search($name, $this->active) === false) { // ...rewrite USER file adding appropriate include command if ($this->sieve->load($user_script)) { $script = $this->sieve->script->as_array(); @@ -1920,7 +1920,7 @@ class managesieve extends rcube_plugin // get all active scripts for sorting foreach ($script as $rid => $rules) { - foreach ($rules['actions'] as $aid => $action) { + foreach ($rules['actions'] as $action) { if ($action['type'] == 'include' && empty($action['global'])) { $target = $extension ? preg_replace($regexp, '', $action['target']) : $action['target']; $list[] = $target; @@ -1988,7 +1988,7 @@ class managesieve extends rcube_plugin $name = $name.$extension; foreach ($script as $rid => $rules) { - foreach ($rules['actions'] as $aid => $action) { + foreach ($rules['actions'] as $action) { if ($action['type'] == 'include' && empty($action['global']) && $action['target'] == $name ) { diff --git a/plugins/new_user_identity/new_user_identity.php b/plugins/new_user_identity/new_user_identity.php index f98145b6c..d32051e00 100644 --- a/plugins/new_user_identity/new_user_identity.php +++ b/plugins/new_user_identity/new_user_identity.php @@ -33,8 +33,6 @@ class new_user_identity extends rcube_plugin 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) { diff --git a/plugins/password/drivers/directadmin.php b/plugins/password/drivers/directadmin.php index 8bf0dc613..44ecea406 100644 --- a/plugins/password/drivers/directadmin.php +++ b/plugins/password/drivers/directadmin.php @@ -297,7 +297,6 @@ class HTTPSocket { $status = socket_get_status($socket); $startTime = time(); $length = 0; - $prevSecond = 0; while ( !feof($socket) && !$status['timed_out'] ) { $chunk = fgets($socket,1024); diff --git a/plugins/password/drivers/pam.php b/plugins/password/drivers/pam.php index 8cd94c737..4d0ba1656 100644 --- a/plugins/password/drivers/pam.php +++ b/plugins/password/drivers/pam.php @@ -11,7 +11,8 @@ class rcube_pam_password { function save($currpass, $newpass) { - $user = $_SESSION['username']; + $user = $_SESSION['username']; + $error = ''; if (extension_loaded('pam') || extension_loaded('pam_auth')) { if (pam_auth($user, $currpass, $error, false)) { diff --git a/plugins/password/drivers/sql.php b/plugins/password/drivers/sql.php index e02bff146..7a51dfe44 100644 --- a/plugins/password/drivers/sql.php +++ b/plugins/password/drivers/sql.php @@ -34,8 +34,9 @@ class rcube_sql_password $db = $rcmail->get_dbh(); } - if ($err = $db->is_error()) + if ($db->is_error()) { return PASSWORD_ERROR; + } // crypted password if (strpos($sql, '%c') !== FALSE) { @@ -183,8 +184,8 @@ class rcube_sql_password $res = $db->query($sql, $sql_vars); if (!$db->is_error()) { - if (strtolower(substr(trim($query),0,6))=='select') { - if ($result = $db->fetch_array($res)) + if (strtolower(substr(trim($sql),0,6)) == 'select') { + if ($db->fetch_array($res)) return PASSWORD_SUCCESS; } else { // This is the good case: 1 row updated diff --git a/plugins/password/drivers/xmail.php b/plugins/password/drivers/xmail.php index 37abc3001..59e467c5b 100644 --- a/plugins/password/drivers/xmail.php +++ b/plugins/password/drivers/xmail.php @@ -67,7 +67,7 @@ class XMail { function send($msg) { socket_write($this->socket,$msg); - if (substr($in = socket_read($this->socket, 512, PHP_BINARY_READ),0,1) != "+") { + if (substr(socket_read($this->socket, 512, PHP_BINARY_READ),0,1) != "+") { return false; } return true; @@ -85,7 +85,7 @@ class XMail { return false; } - if (substr($in = socket_read($this->socket, 512, PHP_BINARY_READ),0,1) != "+") { + if (substr(socket_read($this->socket, 512, PHP_BINARY_READ),0,1) != "+") { socket_close($this->socket); return false; } diff --git a/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php b/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php index d5d0d47ec..e882a2f37 100644 --- a/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php +++ b/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php @@ -63,7 +63,7 @@ class squirrelmail_usercopy extends rcube_plugin if ($this->prefs['___sig'.$i.'___']) $ident_data['signature'] = $this->prefs['___sig'.$i.'___']; // insert identity - $identid = $rcmail->user->insert_identity($ident_data); + $rcmail->user->insert_identity($ident_data); } } diff --git a/plugins/vcard_attachments/vcard_attachments.php b/plugins/vcard_attachments/vcard_attachments.php index 4905b373e..cf7e22d3a 100644 --- a/plugins/vcard_attachments/vcard_attachments.php +++ b/plugins/vcard_attachments/vcard_attachments.php @@ -45,7 +45,7 @@ class vcard_attachments extends rcube_plugin } } // the same with message bodies - foreach ((array)$this->message->parts as $idx => $part) { + foreach ((array)$this->message->parts as $part) { if ($this->is_vcard($part)) { $this->vcard_parts[] = $part->mime_id; $this->vcard_bodies[] = $part->mime_id; @@ -63,7 +63,6 @@ class vcard_attachments extends rcube_plugin function html_output($p) { $attach_script = false; - $icon = 'plugins/vcard_attachments/' .$this->local_skin_path(). '/vcard_add_contact.png'; foreach ($this->vcard_parts as $part) { $vcards = rcube_vcard::import($this->message->get_part_content($part, null, true)); diff --git a/plugins/zipdownload/zipdownload.php b/plugins/zipdownload/zipdownload.php index 7e132bfbb..fbf1d2342 100644 --- a/plugins/zipdownload/zipdownload.php +++ b/plugins/zipdownload/zipdownload.php @@ -169,7 +169,7 @@ class zipdownload extends rcube_plugin for ($i = 0; ($i * $imap->get_pagesize()) <= $count; $i++) { $a_headers = $imap->list_messages($mbox_name, ($i + 1)); - foreach ($a_headers as $n => $header) { + foreach ($a_headers as $header) { if (empty($header)) continue; @@ -199,7 +199,7 @@ class zipdownload extends rcube_plugin $zip = new ZipArchive(); $zip->open($tmpfname, ZIPARCHIVE::OVERWRITE); - foreach ($uids as $key => $uid){ + foreach ($uids as $uid){ $headers = $imap->get_message_headers($uid); $subject = rcube_mime::decode_mime_string((string)$headers->subject); $subject = $this->_convert_filename($subject); |