Aleksander Machniak
2015-11-22 9f1f754daf4b57a0d0d3aea95d2321716d218cf5
CS fixes
20 files modified
234 ■■■■ changed files
plugins/acl/acl.php 2 ●●● patch | view | raw | blame | history
plugins/attachment_reminder/attachment_reminder.js patch | view | raw | blame | history
plugins/attachment_reminder/attachment_reminder.php patch | view | raw | blame | history
plugins/database_attachments/database_attachments.php 2 ●●● patch | view | raw | blame | history
plugins/debug_logger/debug_logger.php 2 ●●● patch | view | raw | blame | history
plugins/debug_logger/runlog/runlog.php 2 ●●● patch | view | raw | blame | history
plugins/enigma/lib/enigma_error.php 7 ●●●● patch | view | raw | blame | history
plugins/enigma/lib/enigma_mime_message.php 2 ●●● patch | view | raw | blame | history
plugins/help/help.php 5 ●●●●● patch | view | raw | blame | history
plugins/hide_blockquote/hide_blockquote.php 4 ●●●● patch | view | raw | blame | history
plugins/http_authentication/http_authentication.php 2 ●●● patch | view | raw | blame | history
plugins/managesieve/lib/Roundcube/rcube_sieve.php 2 ●●● patch | view | raw | blame | history
plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php 8 ●●●● patch | view | raw | blame | history
plugins/managesieve/lib/Roundcube/rcube_sieve_vacation.php 6 ●●●● patch | view | raw | blame | history
plugins/managesieve/managesieve.php 2 ●●● patch | view | raw | blame | history
plugins/markasjunk/markasjunk.php 101 ●●●● patch | view | raw | blame | history
plugins/redundant_attachments/redundant_attachments.php 2 ●●● patch | view | raw | blame | history
plugins/subscriptions_option/subscriptions_option.php 2 ●●● patch | view | raw | blame | history
plugins/userinfo/userinfo.php 79 ●●●● patch | view | raw | blame | history
plugins/zipdownload/zipdownload.php 4 ●●●● patch | view | raw | blame | history
plugins/acl/acl.php
@@ -123,7 +123,7 @@
                    $group_id = is_array($record[$group_field]) ? $record[$group_field][0] : $record[$group_field];
                    if ($group) {
                        $users[] = array('name' => ($prefix ? $prefix : '') . $group_id, 'display' => $group, 'type' => 'group');
                        $users[] = array('name' => ($prefix ?: '') . $group_id, 'display' => $group, 'type' => 'group');
                        $keys[]  = $group;
                    }
                }
plugins/attachment_reminder/attachment_reminder.js
old mode 100755 new mode 100644
plugins/attachment_reminder/attachment_reminder.php
old mode 100755 new mode 100644
plugins/database_attachments/database_attachments.php
@@ -155,7 +155,7 @@
     */
    protected function _key($args)
    {
        $uname = $args['path'] ? $args['path'] : $args['name'];
        $uname = $args['path'] ?: $args['name'];
        return $args['group'] . md5(time() . $uname . $_SESSION['user_id']);
    }
plugins/debug_logger/debug_logger.php
@@ -18,7 +18,7 @@
 * @version @package_version@
 * @author Ziba Scott
 * @website http://roundcube.net
 *
 *
 * Example:
 *
 * config.inc.php:
plugins/debug_logger/runlog/runlog.php
@@ -130,7 +130,7 @@
        $this->debug_messages[] = $msg;
        $this->run_log[] = array(
                'type'    => 'note',
                'tag'     => $tag ? $tag:"text",
                'tag'     => $tag ?: 'text',
                'value'   => htmlentities($msg),
                'time'    => microtime(true),
                'parents' => $this->parent_stack,
plugins/enigma/lib/enigma_error.php
@@ -51,11 +51,6 @@
    function getData($name)
    {
        if ($name) {
            return $this->data[$name];
        }
        else {
            return $this->data;
        }
        return $name ? $this->data[$name] : $this->data;
    }
}
plugins/enigma/lib/enigma_mime_message.php
@@ -264,7 +264,7 @@
    {
        $this->checkParams();
        $eol = !empty($this->build_params['eol']) ? $this->build_params['eol'] : "\r\n";
        $eol = $this->build_params['eol'] ?: "\r\n";
        // multipart message: and boundary
        if (!empty($this->build_params['boundary'])) {
plugins/help/help.php
@@ -155,9 +155,10 @@
    private function resolve_language($path)
    {
        // resolve language placeholder
        $rcmail = rcmail::get_instance();
        $rcmail  = rcmail::get_instance();
        $langmap = $rcmail->config->get('help_language_map', array('*' => 'en_US'));
        $lang = !empty($langmap[$_SESSION['language']]) ? $langmap[$_SESSION['language']] : $langmap['*'];
        $lang    = $langmap[$_SESSION['language']] ?: $langmap['*'];
        return str_replace('%l', $lang, $path);
    }
}
plugins/hide_blockquote/hide_blockquote.php
@@ -59,8 +59,8 @@
        $input    = new html_inputfield(array('name' => '_'.$field_id, 'id' => $field_id, 'size' => 5));
        $args['blocks']['main']['options']['hide_blockquote_limit'] = array(
            'title' => $this->gettext('quotelimit'),
            'content' => $input->show($limit ? $limit : '')
            'title'   => $this->gettext('quotelimit'),
            'content' => $input->show($limit ?: '')
        );
        return $args;
plugins/http_authentication/http_authentication.php
@@ -93,7 +93,7 @@
        // We'll set it back on startup (#1486553)
        rcmail::get_instance()->session->remove('password');
    }
    function login($args)
    {
        // Redirect to the previous QUERY_STRING
plugins/managesieve/lib/Roundcube/rcube_sieve.php
@@ -111,7 +111,7 @@
     */
    public function error()
    {
        return $this->error ? $this->error : false;
        return $this->error ?: false;
    }
    /**
plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
@@ -633,8 +633,8 @@
            foreach ($sizeitems as $item)
                $items[] = $item;
            $this->form['disabled'] = $_POST['_disabled'] ? true : false;
            $this->form['join']     = $join=='allof' ? true : false;
            $this->form['disabled'] = !empty($_POST['_disabled']);
            $this->form['join']     = $join == 'allof';
            $this->form['name']     = $name;
            $this->form['tests']    = array();
            $this->form['actions']  = array();
@@ -1685,7 +1685,7 @@
            $test = $rule['type'];
        }
        else if (in_array($rule['test'], $set)) {
            $test = ($rule['not'] ? 'not' : '') . ($rule['type'] ? $rule['type'] : 'is');
            $test = ($rule['not'] ? 'not' : '') . ($rule['type'] ?: 'is');
        }
        else {
            $test = ($rule['not'] ? 'not' : '') . $rule['test'];
@@ -2358,7 +2358,7 @@
            if (empty($filter['actions'])) {
                continue;
            }
            $fname = $filter['name'] ? $filter['name'] : "#$i";
            $fname = $filter['name'] ?: "#$i";
            $result[] = array(
                'id'    => $idx,
                'name'  => $fname,
plugins/managesieve/lib/Roundcube/rcube_sieve_vacation.php
@@ -312,7 +312,7 @@
            }
        }
        $this->rc->output->show_message($error ? $error : 'managesieve.saveerror', 'error');
        $this->rc->output->show_message($error ?: 'managesieve.saveerror', 'error');
        $this->rc->output->send();
    }
@@ -327,7 +327,7 @@
        $seconds_extension = in_array('vacation-seconds', $this->exts);
        // build FORM tag
        $form_id = !empty($attrib['id']) ? $attrib['id'] : 'form';
        $form_id = $attrib['id'] ?: 'form';
        $out     = $this->rc->output->request_form(array(
            'id'      => $form_id,
            'name'    => $form_id,
@@ -597,7 +597,7 @@
            }
        }
        return $interval ? $interval : '';
        return $interval ?: '';
    }
    /**
plugins/managesieve/managesieve.php
@@ -239,7 +239,7 @@
            $include_path .= ini_get('include_path');
            set_include_path($include_path);
            $class_name = 'rcube_sieve_' . ($type ? $type : 'engine');
            $class_name = 'rcube_sieve_' . ($type ?: 'engine');
            $this->engine = new $class_name($this);
        }
plugins/markasjunk/markasjunk.php
@@ -12,64 +12,67 @@
 */
class markasjunk extends rcube_plugin
{
  public $task = 'mail';
    public $task = 'mail';
  function init()
  {
    $rcmail = rcmail::get_instance();
    function init()
    {
        $rcmail = rcmail::get_instance();
    $this->register_action('plugin.markasjunk', array($this, 'request_action'));
    $this->add_hook('storage_init', array($this, 'storage_init'));
        $this->register_action('plugin.markasjunk', array($this, 'request_action'));
        $this->add_hook('storage_init', array($this, 'storage_init'));
    if ($rcmail->action == '' || $rcmail->action == 'show') {
      $skin_path = $this->local_skin_path();
      $this->include_script('markasjunk.js');
      if (is_file($this->home . "/$skin_path/markasjunk.css"))
        $this->include_stylesheet("$skin_path/markasjunk.css");
      $this->add_texts('localization', true);
        if ($rcmail->action == '' || $rcmail->action == 'show') {
            $skin_path = $this->local_skin_path();
      $this->add_button(array(
        'type' => 'link',
        'label' => 'buttontext',
        'command' => 'plugin.markasjunk',
        'class' => 'button buttonPas junk disabled',
        'classact' => 'button junk',
        'title' => 'buttontitle',
        'domain' => 'markasjunk'), 'toolbar');
    }
  }
            $this->add_texts('localization', true);
            $this->include_script('markasjunk.js');
  function storage_init($args)
  {
    $flags = array(
      'JUNK'    => 'Junk',
      'NONJUNK' => 'NonJunk',
    );
            if (is_file($this->home . "/$skin_path/markasjunk.css")) {
                $this->include_stylesheet("$skin_path/markasjunk.css");
            }
    // register message flags
    $args['message_flags'] = array_merge((array)$args['message_flags'], $flags);
    return $args;
  }
  function request_action()
  {
    $this->add_texts('localization');
    $rcmail  = rcmail::get_instance();
    $storage = $rcmail->get_storage();
    foreach (rcmail::get_uids() as $mbox => $uids) {
      $storage->unset_flag($uids, 'NONJUNK', $mbox);
      $storage->set_flag($uids, 'JUNK', $mbox);
            $this->add_button(array(
                    'type'     => 'link',
                    'label'    => 'buttontext',
                    'command'  => 'plugin.markasjunk',
                    'class'    => 'button buttonPas junk disabled',
                    'classact' => 'button junk',
                    'title'    => 'buttontitle',
                    'domain'   => 'markasjunk'
                ),'toolbar');
        }
    }
    if (($junk_mbox = $rcmail->config->get('junk_mbox'))) {
      $rcmail->output->command('move_messages', $junk_mbox);
    function storage_init($args)
    {
        $flags = array(
            'JUNK'    => 'Junk',
            'NONJUNK' => 'NonJunk',
        );
        // register message flags
        $args['message_flags'] = array_merge((array)$args['message_flags'], $flags);
        return $args;
    }
    $rcmail->output->command('display_message', $this->gettext('reportedasjunk'), 'confirmation');
    $rcmail->output->send();
  }
    function request_action()
    {
        $this->add_texts('localization');
        $rcmail  = rcmail::get_instance();
        $storage = $rcmail->get_storage();
        foreach (rcmail::get_uids() as $mbox => $uids) {
            $storage->unset_flag($uids, 'NONJUNK', $mbox);
            $storage->set_flag($uids, 'JUNK', $mbox);
        }
        if (($junk_mbox = $rcmail->config->get('junk_mbox'))) {
            $rcmail->output->command('move_messages', $junk_mbox);
        }
        $rcmail->output->command('display_message', $this->gettext('reportedasjunk'), 'confirmation');
        $rcmail->output->send();
    }
}
plugins/redundant_attachments/redundant_attachments.php
@@ -90,7 +90,7 @@
     */
    private function _key($args)
    {
        $uname = $args['path'] ? $args['path'] : $args['name'];
        $uname = $args['path'] ?: $args['name'];
        return $args['group'] . md5(time() . $uname . $_SESSION['user_id']);
    }
plugins/subscriptions_option/subscriptions_option.php
@@ -61,7 +61,7 @@
            $rcmail = rcmail::get_instance();
            $use_subscriptions = $rcmail->config->get('use_subscriptions');
            $args['prefs']['use_subscriptions'] = isset($_POST['_use_subscriptions']) ? true : false;
            $args['prefs']['use_subscriptions'] = isset($_POST['_use_subscriptions']);
            // if the use_subscriptions preference changes, flush the folder cache
            if (($use_subscriptions && !isset($_POST['_use_subscriptions'])) ||
plugins/userinfo/userinfo.php
@@ -6,50 +6,49 @@
 */
class userinfo extends rcube_plugin
{
  public $task    = 'settings';
  public $noajax  = true;
  public $noframe = true;
    public $task    = 'settings';
    public $noajax  = true;
    public $noframe = true;
  function init()
  {
    $this->add_texts('localization/', array('userinfo'));
    $this->register_action('plugin.userinfo', array($this, 'infostep'));
    $this->include_script('userinfo.js');
  }
    function init()
    {
        $this->add_texts('localization/', array('userinfo'));
        $this->register_action('plugin.userinfo', array($this, 'infostep'));
        $this->include_script('userinfo.js');
    }
  function infostep()
  {
    $this->register_handler('plugin.body', array($this, 'infohtml'));
    rcmail::get_instance()->output->send('plugin');
  }
  function infohtml()
  {
    $rcmail = rcmail::get_instance();
    $user = $rcmail->user;
    $table = new html_table(array('cols' => 2, 'cellpadding' => 3));
    function infostep()
    {
        $this->register_handler('plugin.body', array($this, 'infohtml'));
        rcmail::get_instance()->output->send('plugin');
    }
    $table->add('title', 'ID');
    $table->add('', rcube::Q($user->ID));
    $table->add('title', rcube::Q($this->gettext('username')));
    $table->add('', rcube::Q($user->data['username']));
    $table->add('title', rcube::Q($this->gettext('server')));
    $table->add('', rcube::Q($user->data['mail_host']));
    function infohtml()
    {
        $rcmail   = rcmail::get_instance();
        $user     = $rcmail->user;
        $identity = $user->get_identity();
    $table->add('title', rcube::Q($this->gettext('created')));
    $table->add('', rcube::Q($user->data['created']));
        $table = new html_table(array('cols' => 2, 'cellpadding' => 3));
    $table->add('title', rcube::Q($this->gettext('lastlogin')));
    $table->add('', rcube::Q($user->data['last_login']));
    $identity = $user->get_identity();
    $table->add('title', rcube::Q($this->gettext('defaultidentity')));
    $table->add('', rcube::Q($identity['name'] . ' <' . $identity['email'] . '>'));
    return html::tag('h4', null, rcube::Q('Infos for ' . $user->get_username())) . $table->show();
  }
        $table->add('title', 'ID');
        $table->add('', rcube::Q($user->ID));
        $table->add('title', rcube::Q($this->gettext('username')));
        $table->add('', rcube::Q($user->data['username']));
        $table->add('title', rcube::Q($this->gettext('server')));
        $table->add('', rcube::Q($user->data['mail_host']));
        $table->add('title', rcube::Q($this->gettext('created')));
        $table->add('', rcube::Q($user->data['created']));
        $table->add('title', rcube::Q($this->gettext('lastlogin')));
        $table->add('', rcube::Q($user->data['last_login']));
        $table->add('title', rcube::Q($this->gettext('defaultidentity')));
        $table->add('', rcube::Q($identity['name'] . ' <' . $identity['email'] . '>'));
        return html::tag('h4', null, rcube::Q('Infos for ' . $user->get_username())) . $table->show();
    }
}
plugins/zipdownload/zipdownload.php
@@ -156,7 +156,7 @@
        $zip->close();
        $filename = ($message->subject ? $message->subject : 'roundcube') . '.zip';
        $filename = ($message->subject ?: 'roundcube') . '.zip';
        $this->_deliver_zipfile($tmpfname, $filename);
        // delete temporary files from disk
@@ -247,7 +247,7 @@
                    $subject = $this->_convert_filename($subject);
                    $subject = substr($subject, 0, 16);
                    $disp_name = ($subject ? $subject : 'message_rfc822') . ".eml";
                    $disp_name = ($subject ?: 'message_rfc822') . ".eml";
                    $disp_name = $path . $uid . "_" . $disp_name;
                    $tmpfn = tempnam($temp_dir, 'zipmessage');