diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-01-18 15:24:49 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-01-18 15:24:49 +0100 |
commit | 61be822d62ea245b7f54ad313f49a956ab49076d (patch) | |
tree | 2e351bb7796481af16502c85c6f24a896094f522 | |
parent | 4d7964d9101d08b5e7533cea50e52e07bf3f783a (diff) |
Remove deprecated functions (from bc.php file) usage in plugins
38 files changed, 380 insertions, 374 deletions
diff --git a/plugins/acl/acl.php b/plugins/acl/acl.php index 1952dad49..5ae9e4e0a 100644 --- a/plugins/acl/acl.php +++ b/plugins/acl/acl.php @@ -55,7 +55,7 @@ class acl extends rcube_plugin */ function acl_actions() { - $action = trim(get_input_value('_act', RCUBE_INPUT_GPC)); + $action = trim(rcube_utils::get_input_value('_act', rcube_utils::INPUT_GPC)); // Connect to IMAP $this->rc->storage_init(); @@ -85,8 +85,8 @@ class acl extends rcube_plugin { $this->load_config(); - $search = get_input_value('_search', RCUBE_INPUT_GPC, true); - $sid = get_input_value('_id', RCUBE_INPUT_GPC); + $search = rcube_utils::get_input_value('_search', rcube_utils::INPUT_GPC, true); + $sid = rcube_utils::get_input_value('_id', rcube_utils::INPUT_GPC); $users = array(); if ($this->init_ldap()) { @@ -157,12 +157,12 @@ class acl extends rcube_plugin // add Info fieldset if it doesn't exist if (!isset($args['form']['props']['fieldsets']['info'])) $args['form']['props']['fieldsets']['info'] = array( - 'name' => rcube_label('info'), + 'name' => $this->rc->gettext('info'), 'content' => array()); // Display folder rights to 'Info' fieldset $args['form']['props']['fieldsets']['info']['content']['myrights'] = array( - 'label' => Q($this->gettext('myrights')), + 'label' => rcube::Q($this->gettext('myrights')), 'value' => $this->acl2text($myrights) ); @@ -186,7 +186,7 @@ class acl extends rcube_plugin $this->rc->output->add_label('autocompletechars', 'autocompletemore'); $args['form']['sharing'] = array( - 'name' => Q($this->gettext('sharing')), + 'name' => rcube::Q($this->gettext('sharing')), 'content' => $this->rc->output->parse('acl.table', false, false), ); @@ -392,14 +392,14 @@ class acl extends rcube_plugin // filter out virtual rights (c or d) the server may return $userrights = array_intersect($rights, $supported); - $userid = html_identifier($user); + $userid = rcube_utils::html_identifier($user); if (!empty($this->specials) && in_array($user, $this->specials)) { $user = $this->gettext($user); } $table->add_row(array('id' => 'rcmrow'.$userid)); - $table->add('user', Q($user)); + $table->add('user', rcube::Q($user)); foreach ($items as $key => $right) { $in = $this->acl_compare($userrights, $right); @@ -427,10 +427,10 @@ class acl extends rcube_plugin */ private function action_save() { - $mbox = trim(get_input_value('_mbox', RCUBE_INPUT_GPC, true)); // UTF7-IMAP - $user = trim(get_input_value('_user', RCUBE_INPUT_GPC)); - $acl = trim(get_input_value('_acl', RCUBE_INPUT_GPC)); - $oldid = trim(get_input_value('_old', RCUBE_INPUT_GPC)); + $mbox = trim(rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC, true)); // UTF7-IMAP + $user = trim(rcube_utils::get_input_value('_user', rcube_utils::INPUT_GPC)); + $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); @@ -443,7 +443,7 @@ class acl extends rcube_plugin } else { if (!strpos($user, '@') && ($realm = $this->get_realm())) { - $user .= '@' . rcube_idn_to_ascii(preg_replace('/^@/', '', $realm)); + $user .= '@' . rcube_utils::idn_to_ascii(preg_replace('/^@/', '', $realm)); } $username = $user; } @@ -454,7 +454,7 @@ class acl extends rcube_plugin if ($user != $_SESSION['username'] && $username != $_SESSION['username']) { if ($this->rc->storage->set_acl($mbox, $user, $acl)) { - $ret = array('id' => html_identifier($user), + $ret = array('id' => rcube_utils::html_identifier($user), 'username' => $username, 'acl' => implode($acl), 'old' => $oldid); $this->rc->output->command('acl_update', $ret); $result++; @@ -475,15 +475,15 @@ class acl extends rcube_plugin */ private function action_delete() { - $mbox = trim(get_input_value('_mbox', RCUBE_INPUT_GPC, true)); //UTF7-IMAP - $user = trim(get_input_value('_user', RCUBE_INPUT_GPC)); + $mbox = trim(rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC, true)); //UTF7-IMAP + $user = trim(rcube_utils::get_input_value('_user', rcube_utils::INPUT_GPC)); $user = explode(',', $user); foreach ($user as $u) { $u = trim($u); if ($this->rc->storage->delete_acl($mbox, $u)) { - $this->rc->output->command('acl_remove_row', html_identifier($u)); + $this->rc->output->command('acl_remove_row', rcube_utils::html_identifier($u)); } else { $error = true; @@ -507,8 +507,8 @@ class acl extends rcube_plugin return; } - $this->mbox = trim(get_input_value('_mbox', RCUBE_INPUT_GPC, true)); // UTF7-IMAP - $advanced = trim(get_input_value('_mode', RCUBE_INPUT_GPC)); + $this->mbox = trim(rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC, true)); // UTF7-IMAP + $advanced = trim(rcube_utils::get_input_value('_mode', rcube_utils::INPUT_GPC)); $advanced = $advanced == 'advanced' ? true : false; // Save state in user preferences @@ -543,12 +543,12 @@ class acl extends rcube_plugin foreach ($supported as $right) { if (in_array($right, $rights)) { - $list[] = html::tag('li', null, Q($this->gettext('acl' . $right))); + $list[] = html::tag('li', null, rcube::Q($this->gettext('acl' . $right))); } } if (count($list) == count($supported)) - return Q($this->gettext('aclfull')); + return rcube::Q($this->gettext('aclfull')); return html::tag('ul', $attrib, implode("\n", $list)); } diff --git a/plugins/archive/archive.php b/plugins/archive/archive.php index 0a298cbe3..9b03cb186 100644 --- a/plugins/archive/archive.php +++ b/plugins/archive/archive.php @@ -104,7 +104,7 @@ class archive extends rcube_plugin // load folders list when needed if ($CURR_SECTION) - $select = rcmail_mailbox_select(array('noselection' => '---', 'realnames' => true, + $select = $rcmail->folder_selector(array('noselection' => '---', 'realnames' => true, 'maxlength' => 30, 'exceptions' => array('INBOX'), 'folder_filter' => 'mail', 'folder_rights' => 'w')); else $select = new html_select(); @@ -121,7 +121,7 @@ class archive extends rcube_plugin function save_prefs($args) { if ($args['section'] == 'folders') { - $args['prefs']['archive_mbox'] = get_input_value('_archive_mbox', RCUBE_INPUT_POST); + $args['prefs']['archive_mbox'] = rcube_utils::get_input_value('_archive_mbox', rcube_utils::INPUT_POST); return $args; } } diff --git a/plugins/database_attachments/database_attachments.php b/plugins/database_attachments/database_attachments.php index 079f4e567..2511dbbb2 100644 --- a/plugins/database_attachments/database_attachments.php +++ b/plugins/database_attachments/database_attachments.php @@ -46,7 +46,7 @@ class database_attachments extends filesystem_attachments $data = base64_encode($data); $status = $rcmail->db->query( - "INSERT INTO ".get_table_name('cache') + "INSERT INTO ".$rcmail->db->table_name('cache') ." (created, user_id, cache_key, data)" ." VALUES (".$rcmail->db->now().", ?, ?, ?)", $_SESSION['user_id'], @@ -82,7 +82,7 @@ class database_attachments extends filesystem_attachments $data = base64_encode($args['data']); $status = $rcmail->db->query( - "INSERT INTO ".get_table_name('cache') + "INSERT INTO ".$rcmail->db->table_name('cache') ." (created, user_id, cache_key, data)" ." VALUES (".$rcmail->db->now().", ?, ?, ?)", $_SESSION['user_id'], @@ -106,7 +106,7 @@ class database_attachments extends filesystem_attachments $args['status'] = false; $rcmail = rcmail::get_instance(); $status = $rcmail->db->query( - "DELETE FROM ".get_table_name('cache') + "DELETE FROM ".$rcmail->db->table_name('cache') ." WHERE user_id = ?" ." AND cache_key = ?", $_SESSION['user_id'], @@ -139,7 +139,7 @@ class database_attachments extends filesystem_attachments $sql_result = $rcmail->db->query( "SELECT data" - ." FROM ".get_table_name('cache') + ." FROM ".$rcmail->db->table_name('cache') ." WHERE user_id=?" ." AND cache_key=?", $_SESSION['user_id'], @@ -161,7 +161,7 @@ class database_attachments extends filesystem_attachments $prefix = $this->cache_prefix . $args['group']; $rcmail = rcmail::get_instance(); $rcmail->db->query( - "DELETE FROM ".get_table_name('cache') + "DELETE FROM ".$rcmail->db->table_name('cache') ." WHERE user_id = ?" ." AND cache_key LIKE '{$prefix}%'", $_SESSION['user_id']); diff --git a/plugins/enigma/enigma.php b/plugins/enigma/enigma.php index a4009ce26..c96b94620 100644 --- a/plugins/enigma/enigma.php +++ b/plugins/enigma/enigma.php @@ -79,7 +79,7 @@ class enigma extends rcube_plugin $this->register_action('plugin.enigma', array($this, 'preferences_ui')); // grab keys/certs management iframe requests - $section = get_input_value('_section', RCUBE_INPUT_GET); + $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); @@ -230,7 +230,7 @@ class enigma extends rcube_plugin { if ($p['section'] == 'enigmasettings') { $a['prefs'] = array( -// 'dummy' => get_input_value('_dummy', RCUBE_INPUT_POST), +// 'dummy' => rcube_utils::get_input_value('_dummy', rcube_utils::INPUT_POST), ); } @@ -285,16 +285,16 @@ class enigma extends rcube_plugin $attrib['class'] = 'enigmaerror'; $code = $status->getCode(); if ($code == enigma_error::E_KEYNOTFOUND) - $msg = Q(str_replace('$keyid', enigma_key::format_id($status->getData('id')), + $msg = rcube::Q(str_replace('$keyid', enigma_key::format_id($status->getData('id')), $this->gettext('decryptnokey'))); else if ($code == enigma_error::E_BADPASS) - $msg = Q($this->gettext('decryptbadpass')); + $msg = rcube::Q($this->gettext('decryptbadpass')); else - $msg = Q($this->gettext('decrypterror')); + $msg = rcube::Q($this->gettext('decrypterror')); } else { $attrib['class'] = 'enigmanotice'; - $msg = Q($this->gettext('decryptok')); + $msg = rcube::Q($this->gettext('decryptok')); } $p['prefix'] .= html::div($attrib, $msg); @@ -315,27 +315,27 @@ class enigma extends rcube_plugin if ($sig->valid) { $attrib['class'] = 'enigmanotice'; $sender = ($sig->name ? $sig->name . ' ' : '') . '<' . $sig->email . '>'; - $msg = Q(str_replace('$sender', $sender, $this->gettext('sigvalid'))); + $msg = rcube::Q(str_replace('$sender', $sender, $this->gettext('sigvalid'))); } else { $attrib['class'] = 'enigmawarning'; $sender = ($sig->name ? $sig->name . ' ' : '') . '<' . $sig->email . '>'; - $msg = Q(str_replace('$sender', $sender, $this->gettext('siginvalid'))); + $msg = rcube::Q(str_replace('$sender', $sender, $this->gettext('siginvalid'))); } } else if ($sig->getCode() == enigma_error::E_KEYNOTFOUND) { $attrib['class'] = 'enigmawarning'; - $msg = Q(str_replace('$keyid', enigma_key::format_id($sig->getData('id')), + $msg = rcube::Q(str_replace('$keyid', enigma_key::format_id($sig->getData('id')), $this->gettext('signokey'))); } else { $attrib['class'] = 'enigmaerror'; - $msg = Q($this->gettext('sigerror')); + $msg = rcube::Q($this->gettext('sigerror')); } /* $msg .= ' ' . html::a(array('href' => "#sigdetails", - 'onclick' => JS_OBJECT_NAME.".command('enigma-sig-details')"), - Q($this->gettext('showdetails'))); + 'onclick' => rcmail_output::JS_OBJECT_NAME.".command('enigma-sig-details')"), + rcube::Q($this->gettext('showdetails'))); */ // test // $msg .= '<br /><pre>'.$sig->body.'</pre>'; @@ -433,7 +433,7 @@ class enigma extends rcube_plugin $p['content'] .= html::p(array('style' => $style), html::a(array( 'href' => "#", - 'onclick' => "return ".JS_OBJECT_NAME.".enigma_import_attachment('".JQ($part)."')", + 'onclick' => "return ".rcmail_output::JS_OBJECT_NAME.".enigma_import_attachment('".rcube::JQ($part)."')", 'title' => $this->gettext('keyattimport')), html::img(array('src' => $this->url('skins/classic/key_add.png'), 'style' => "vertical-align:middle"))) . ' ' . html::span(null, $this->gettext('keyattfound'))); diff --git a/plugins/enigma/lib/enigma_engine.php b/plugins/enigma/lib/enigma_engine.php index 89cb4b796..220d6c0b3 100644 --- a/plugins/enigma/lib/enigma_engine.php +++ b/plugins/enigma/lib/enigma_engine.php @@ -65,7 +65,7 @@ class enigma_engine $this->pgp_driver = new $driver($username); if (!$this->pgp_driver) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Enigma plugin: Unable to load PGP driver: $driver" @@ -76,7 +76,7 @@ class enigma_engine $result = $this->pgp_driver->init(); if ($result instanceof enigma_error) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Enigma plugin: ".$result->getMessage() @@ -102,7 +102,7 @@ class enigma_engine $this->smime_driver = new $driver($username); if (!$this->smime_driver) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Enigma plugin: Unable to load S/MIME driver: $driver" @@ -113,7 +113,7 @@ class enigma_engine $result = $this->smime_driver->init(); if ($result instanceof enigma_error) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Enigma plugin: ".$result->getMessage() @@ -378,7 +378,7 @@ class enigma_engine $sig = $this->pgp_driver->verify($msg_body, $sig_body); if (($sig instanceof enigma_error) && $sig->getCode() != enigma_error::E_KEYNOTFOUND) - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Enigma plugin: " . $error->getMessage() @@ -407,7 +407,7 @@ class enigma_engine if ($result instanceof enigma_error) { $err_code = $result->getCode(); if (!in_array($err_code, array(enigma_error::E_KEYNOTFOUND, enigma_error::E_BADPASS))) - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Enigma plugin: " . $result->getMessage() @@ -432,7 +432,7 @@ class enigma_engine $result = $this->pgp_driver->list_keys($pattern); if ($result instanceof enigma_error) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Enigma plugin: " . $result->getMessage() @@ -455,7 +455,7 @@ class enigma_engine $result = $this->pgp_driver->get_key($keyid); if ($result instanceof enigma_error) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Enigma plugin: " . $result->getMessage() @@ -479,7 +479,7 @@ class enigma_engine $result = $this->pgp_driver->import($content, $isfile); if ($result instanceof enigma_error) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Enigma plugin: " . $result->getMessage() @@ -498,9 +498,9 @@ class enigma_engine */ function import_file() { - $uid = get_input_value('_uid', RCUBE_INPUT_POST); - $mbox = get_input_value('_mbox', RCUBE_INPUT_POST); - $mime_id = get_input_value('_part', RCUBE_INPUT_POST); + $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); if ($uid && $mime_id) { $part = $this->rc->storage->get_message_part($uid, $mime_id); diff --git a/plugins/enigma/lib/enigma_ui.php b/plugins/enigma/lib/enigma_ui.php index dc3580872..47366b7e8 100644 --- a/plugins/enigma/lib/enigma_ui.php +++ b/plugins/enigma/lib/enigma_ui.php @@ -49,7 +49,7 @@ class enigma_ui // Enigma actions if ($this->rc->action == 'plugin.enigma') { - $action = get_input_value('_a', RCUBE_INPUT_GPC); + $action = rcube_utils::get_input_value('_a', rcube_utils::INPUT_GPC); switch ($action) { case 'keyedit': @@ -152,7 +152,7 @@ class enigma_ui $a_show_cols = array('name'); // create XHTML table - $out = rcube_table_output($attrib, array(), $a_show_cols, 'id'); + $out = $this->rc->table_output($attrib, array(), $a_show_cols, 'id'); // set client env $this->rc->output->add_gui_object('keyslist', $attrib['id']); @@ -172,8 +172,8 @@ class enigma_ui $this->enigma->load_engine(); $pagesize = $this->rc->config->get('pagesize', 100); - $page = max(intval(get_input_value('_p', RCUBE_INPUT_GPC)), 1); - $search = get_input_value('_q', RCUBE_INPUT_GPC); + $page = max(intval(rcube_utils::get_input_value('_p', rcube_utils::INPUT_GPC)), 1); + $search = rcube_utils::get_input_value('_q', rcube_utils::INPUT_GPC); // define list of cols to be displayed $a_show_cols = array('name'); @@ -202,7 +202,7 @@ class enigma_ui // Add rows foreach($list as $idx => $key) { $this->rc->output->command('enigma_add_list_row', - array('name' => Q($key->name), 'id' => $key->id)); + array('name' => rcube::Q($key->name), 'id' => $key->id)); } } } @@ -261,7 +261,7 @@ class enigma_ui */ private function key_info() { - $id = get_input_value('_id', RCUBE_INPUT_GET); + $id = rcube_utils::get_input_value('_id', rcube_utils::INPUT_GET); $this->enigma->load_engine(); $res = $this->enigma->engine->get_key($id); @@ -288,7 +288,7 @@ class enigma_ui */ function tpl_key_name($attrib) { - return Q($this->data->name); + return rcube::Q($this->data->name); } /** @@ -301,7 +301,7 @@ class enigma_ui // Key user ID $table->add('title', $this->enigma->gettext('keyuserid')); - $table->add(null, Q($this->data->name)); + $table->add(null, rcube::Q($this->data->name)); // Key ID $table->add('title', $this->enigma->gettext('keyid')); $table->add(null, $this->data->subkeys[0]->get_short_id()); @@ -369,7 +369,7 @@ class enigma_ui else if ($err = $_FILES['_file']['error']) { if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) { $this->rc->output->show_message('filesizeerror', 'error', - array('size' => show_bytes(parse_bytes(ini_get('upload_max_filesize'))))); + array('size' => $this->rc->show_bytes(parse_bytes(ini_get('upload_max_filesize'))))); } else { $this->rc->output->show_message('fileuploaderror', 'error'); } @@ -394,7 +394,7 @@ class enigma_ui 'id' => 'rcmimportfile', 'size' => 30)); $form = html::p(null, - Q($this->enigma->gettext('keyimporttext'), 'show') + rcube::Q($this->enigma->gettext('keyimporttext'), 'show') . html::br() . html::br() . $upload->show() ); @@ -433,15 +433,15 @@ class enigma_ui $chbox = new html_checkbox(array('value' => 1)); $menu->add(null, html::label(array('for' => 'enigmadefaultopt'), - Q($this->enigma->gettext('identdefault')))); + rcube::Q($this->enigma->gettext('identdefault')))); $menu->add(null, $chbox->show(1, array('name' => '_enigma_default', 'id' => 'enigmadefaultopt'))); $menu->add(null, html::label(array('for' => 'enigmasignopt'), - Q($this->enigma->gettext('signmsg')))); + rcube::Q($this->enigma->gettext('signmsg')))); $menu->add(null, $chbox->show(1, array('name' => '_enigma_sign', 'id' => 'enigmasignopt'))); $menu->add(null, html::label(array('for' => 'enigmacryptopt'), - Q($this->enigma->gettext('encryptmsg')))); + rcube::Q($this->enigma->gettext('encryptmsg')))); $menu->add(null, $chbox->show(1, array('name' => '_enigma_crypt', 'id' => 'enigmacryptopt'))); $menu = html::div(array('id' => 'enigmamenu', 'class' => 'popupmenu'), diff --git a/plugins/hide_blockquote/hide_blockquote.php b/plugins/hide_blockquote/hide_blockquote.php index 7af163dcd..1168656fd 100644 --- a/plugins/hide_blockquote/hide_blockquote.php +++ b/plugins/hide_blockquote/hide_blockquote.php @@ -69,7 +69,7 @@ class hide_blockquote extends rcube_plugin function save_prefs($args) { if ($args['section'] == 'mailview') { - $args['prefs']['hide_blockquote_limit'] = (int) get_input_value('_hide_blockquote_limit', RCUBE_INPUT_POST); + $args['prefs']['hide_blockquote_limit'] = (int) rcube_utils::get_input_value('_hide_blockquote_limit', rcube_utils::INPUT_POST); } return $args; diff --git a/plugins/http_authentication/http_authentication.php b/plugins/http_authentication/http_authentication.php index a94b6121a..57227cb03 100644 --- a/plugins/http_authentication/http_authentication.php +++ b/plugins/http_authentication/http_authentication.php @@ -53,7 +53,7 @@ class http_authentication extends rcube_plugin $host = rcmail::get_instance()->config->get('http_authentication_host'); if (is_string($host) && trim($host) !== '') - $args['host'] = rcube_idn_to_ascii(rcube_parse_host($host)); + $args['host'] = rcube_utils::idn_to_ascii(rcube_utils::parse_host($host)); // Allow entering other user data in login form, // e.g. after log out (#1487953) diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog index 19799a302..d8baf63ef 100644 --- a/plugins/managesieve/Changelog +++ b/plugins/managesieve/Changelog @@ -1,4 +1,5 @@ - Support tls:// prefix in managesieve_host option +- Removed depracated functions usage * version 6.1 [2012-12-21] ----------------------------------------------------------- diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve.php b/plugins/managesieve/lib/Roundcube/rcube_sieve.php index 4f66bf029..736f73146 100644 --- a/plugins/managesieve/lib/Roundcube/rcube_sieve.php +++ b/plugins/managesieve/lib/Roundcube/rcube_sieve.php @@ -379,6 +379,6 @@ class rcube_sieve */ public function debug_handler(&$sieve, $message) { - write_log('sieve', preg_replace('/\r\n$/', '', $message)); + rcube::write_log('sieve', preg_replace('/\r\n$/', '', $message)); } } diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php index d30404ac7..8f50cd5a2 100644 --- a/plugins/managesieve/managesieve.php +++ b/plugins/managesieve/managesieve.php @@ -205,8 +205,8 @@ class managesieve extends rcube_plugin $port = $this->rc->config->get('managesieve_port'); $tls = $this->rc->config->get('managesieve_usetls', false); - $host = rcube_parse_host($host); - $host = rcube_idn_to_ascii($host); + $host = rcube_utils::parse_host($host); + $host = rcube_utils::idn_to_ascii($host); // remove tls:// prefix, set TLS flag if (($host = preg_replace('|^tls://|i', '', $host, 1, $cnt)) && $cnt) { @@ -252,7 +252,7 @@ class managesieve extends rcube_plugin $list = $this->list_scripts(); if (!empty($_GET['_set']) || !empty($_POST['_set'])) { - $script_name = get_input_value('_set', RCUBE_INPUT_GPC, true); + $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); } else if (!empty($_SESSION['managesieve_current'])) { $script_name = $_SESSION['managesieve_current']; @@ -304,7 +304,7 @@ class managesieve extends rcube_plugin break; } - raise_error(array('code' => 403, 'type' => 'php', + rcube::raise_error(array('code' => 403, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Unable to connect to managesieve on $host:$port"), true, false); @@ -329,8 +329,8 @@ class managesieve extends rcube_plugin $error = $this->managesieve_start(); // Handle user requests - if ($action = get_input_value('_act', RCUBE_INPUT_GPC)) { - $fid = (int) get_input_value('_fid', RCUBE_INPUT_POST); + if ($action = rcube_utils::get_input_value('_act', rcube_utils::INPUT_GPC)) { + $fid = (int) rcube_utils::get_input_value('_fid', rcube_utils::INPUT_POST); if ($action == 'delete' && !$error) { if (isset($this->script[$fid])) { @@ -347,7 +347,7 @@ class managesieve extends rcube_plugin } else if ($action == 'move' && !$error) { if (isset($this->script[$fid])) { - $to = (int) get_input_value('_to', RCUBE_INPUT_POST); + $to = (int) rcube_utils::get_input_value('_to', rcube_utils::INPUT_POST); $rule = $this->script[$fid]; // remove rule @@ -408,7 +408,7 @@ class managesieve extends rcube_plugin } } else if ($action == 'setact' && !$error) { - $script_name = get_input_value('_set', RCUBE_INPUT_GPC, true); + $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); $result = $this->activate_script($script_name); $kep14 = $this->rc->config->get('managesieve_kolab_master'); @@ -422,7 +422,7 @@ class managesieve extends rcube_plugin } } else if ($action == 'deact' && !$error) { - $script_name = get_input_value('_set', RCUBE_INPUT_GPC, true); + $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); $result = $this->deactivate_script($script_name); if ($result === true) { @@ -435,7 +435,7 @@ class managesieve extends rcube_plugin } } else if ($action == 'setdel' && !$error) { - $script_name = get_input_value('_set', RCUBE_INPUT_GPC, true); + $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); $result = $this->remove_script($script_name); if ($result === true) { @@ -448,7 +448,7 @@ class managesieve extends rcube_plugin } } else if ($action == 'setget') { - $script_name = get_input_value('_set', RCUBE_INPUT_GPC, true); + $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); $script = $this->sieve->get_script($script_name); if (PEAR::isError($script)) @@ -479,14 +479,14 @@ class managesieve extends rcube_plugin $this->rc->output->command('managesieve_updatelist', 'list', array('list' => $result)); } else if ($action == 'ruleadd') { - $rid = get_input_value('_rid', RCUBE_INPUT_GPC); + $rid = rcube_utils::get_input_value('_rid', rcube_utils::INPUT_GPC); $id = $this->genid(); $content = $this->rule_div($fid, $id, false); $this->rc->output->command('managesieve_rulefill', $content, $id, $rid); } else if ($action == 'actionadd') { - $aid = get_input_value('_aid', RCUBE_INPUT_GPC); + $aid = rcube_utils::get_input_value('_aid', rcube_utils::INPUT_GPC); $id = $this->genid(); $content = $this->action_div($fid, $id, false); @@ -497,7 +497,7 @@ class managesieve extends rcube_plugin } else if ($this->rc->task == 'mail') { // Initialize the form - $rules = get_input_value('r', RCUBE_INPUT_GET); + $rules = rcube_utils::get_input_value('r', rcube_utils::INPUT_GET); if (!empty($rules)) { $i = 0; foreach ($rules as $rule) { @@ -570,9 +570,9 @@ class managesieve extends rcube_plugin } // filters set add action else if (!empty($_POST['_newset'])) { - $name = get_input_value('_name', RCUBE_INPUT_POST, true); - $copy = get_input_value('_copy', RCUBE_INPUT_POST, true); - $from = get_input_value('_from', RCUBE_INPUT_POST); + $name = rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true); + $copy = rcube_utils::get_input_value('_copy', rcube_utils::INPUT_POST, true); + $from = rcube_utils::get_input_value('_from', rcube_utils::INPUT_POST); $exceptions = $this->rc->config->get('managesieve_filename_exceptions'); $kolab = $this->rc->config->get('managesieve_kolab_master'); $name_uc = mb_strtolower($name); @@ -609,9 +609,9 @@ class managesieve extends rcube_plugin $err = $_FILES['_file']['error']; if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) { - $msg = rcube_label(array('name' => 'filesizeerror', + $msg = $this->rc->gettext(array('name' => 'filesizeerror', 'vars' => array('size' => - show_bytes(parse_bytes(ini_get('upload_max_filesize')))))); + $this->rc->show_bytes(parse_bytes(ini_get('upload_max_filesize')))))); } else { $this->errors['file'] = $this->gettext('fileuploaderror'); @@ -640,40 +640,40 @@ class managesieve extends rcube_plugin } // filter add/edit action else if (isset($_POST['_name'])) { - $name = trim(get_input_value('_name', RCUBE_INPUT_POST, true)); - $fid = trim(get_input_value('_fid', RCUBE_INPUT_POST)); - $join = trim(get_input_value('_join', RCUBE_INPUT_POST)); + $name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true)); + $fid = trim(rcube_utils::get_input_value('_fid', rcube_utils::INPUT_POST)); + $join = trim(rcube_utils::get_input_value('_join', rcube_utils::INPUT_POST)); // and arrays - $headers = get_input_value('_header', RCUBE_INPUT_POST); - $cust_headers = get_input_value('_custom_header', RCUBE_INPUT_POST); - $ops = get_input_value('_rule_op', RCUBE_INPUT_POST); - $sizeops = get_input_value('_rule_size_op', RCUBE_INPUT_POST); - $sizeitems = get_input_value('_rule_size_item', RCUBE_INPUT_POST); - $sizetargets = get_input_value('_rule_size_target', RCUBE_INPUT_POST); - $targets = get_input_value('_rule_target', RCUBE_INPUT_POST, true); - $mods = get_input_value('_rule_mod', RCUBE_INPUT_POST); - $mod_types = get_input_value('_rule_mod_type', RCUBE_INPUT_POST); - $body_trans = get_input_value('_rule_trans', RCUBE_INPUT_POST); - $body_types = get_input_value('_rule_trans_type', RCUBE_INPUT_POST, true); - $comparators = get_input_value('_rule_comp', RCUBE_INPUT_POST); - $act_types = get_input_value('_action_type', RCUBE_INPUT_POST, true); - $mailboxes = get_input_value('_action_mailbox', RCUBE_INPUT_POST, true); - $act_targets = get_input_value('_action_target', RCUBE_INPUT_POST, true); - $area_targets = get_input_value('_action_target_area', RCUBE_INPUT_POST, true); - $reasons = get_input_value('_action_reason', RCUBE_INPUT_POST, true); - $addresses = get_input_value('_action_addresses', RCUBE_INPUT_POST, true); - $days = get_input_value('_action_days', RCUBE_INPUT_POST); - $subject = get_input_value('_action_subject', RCUBE_INPUT_POST, true); - $flags = get_input_value('_action_flags', RCUBE_INPUT_POST); - $varnames = get_input_value('_action_varname', RCUBE_INPUT_POST); - $varvalues = get_input_value('_action_varvalue', RCUBE_INPUT_POST); - $varmods = get_input_value('_action_varmods', RCUBE_INPUT_POST); - $notifyaddrs = get_input_value('_action_notifyaddress', RCUBE_INPUT_POST); - $notifybodies = get_input_value('_action_notifybody', RCUBE_INPUT_POST); - $notifymessages = get_input_value('_action_notifymessage', RCUBE_INPUT_POST); - $notifyfrom = get_input_value('_action_notifyfrom', RCUBE_INPUT_POST); - $notifyimp = get_input_value('_action_notifyimportance', RCUBE_INPUT_POST); + $headers = rcube_utils::get_input_value('_header', rcube_utils::INPUT_POST); + $cust_headers = rcube_utils::get_input_value('_custom_header', rcube_utils::INPUT_POST); + $ops = rcube_utils::get_input_value('_rule_op', rcube_utils::INPUT_POST); + $sizeops = rcube_utils::get_input_value('_rule_size_op', rcube_utils::INPUT_POST); + $sizeitems = rcube_utils::get_input_value('_rule_size_item', rcube_utils::INPUT_POST); + $sizetargets = rcube_utils::get_input_value('_rule_size_target', rcube_utils::INPUT_POST); + $targets = rcube_utils::get_input_value('_rule_target', rcube_utils::INPUT_POST, true); + $mods = rcube_utils::get_input_value('_rule_mod', rcube_utils::INPUT_POST); + $mod_types = rcube_utils::get_input_value('_rule_mod_type', rcube_utils::INPUT_POST); + $body_trans = rcube_utils::get_input_value('_rule_trans', rcube_utils::INPUT_POST); + $body_types = rcube_utils::get_input_value('_rule_trans_type', rcube_utils::INPUT_POST, true); + $comparators = rcube_utils::get_input_value('_rule_comp', rcube_utils::INPUT_POST); + $act_types = rcube_utils::get_input_value('_action_type', rcube_utils::INPUT_POST, true); + $mailboxes = rcube_utils::get_input_value('_action_mailbox', rcube_utils::INPUT_POST, true); + $act_targets = rcube_utils::get_input_value('_action_target', rcube_utils::INPUT_POST, true); + $area_targets = rcube_utils::get_input_value('_action_target_area', rcube_utils::INPUT_POST, true); + $reasons = rcube_utils::get_input_value('_action_reason', rcube_utils::INPUT_POST, true); + $addresses = rcube_utils::get_input_value('_action_addresses', rcube_utils::INPUT_POST, true); + $days = rcube_utils::get_input_value('_action_days', rcube_utils::INPUT_POST); + $subject = rcube_utils::get_input_value('_action_subject', rcube_utils::INPUT_POST, true); + $flags = rcube_utils::get_input_value('_action_flags', rcube_utils::INPUT_POST); + $varnames = rcube_utils::get_input_value('_action_varname', rcube_utils::INPUT_POST); + $varvalues = rcube_utils::get_input_value('_action_varvalue', rcube_utils::INPUT_POST); + $varmods = rcube_utils::get_input_value('_action_varmods', rcube_utils::INPUT_POST); + $notifyaddrs = rcube_utils::get_input_value('_action_notifyaddress', rcube_utils::INPUT_POST); + $notifybodies = rcube_utils::get_input_value('_action_notifybody', rcube_utils::INPUT_POST); + $notifymessages = rcube_utils::get_input_value('_action_notifymessage', rcube_utils::INPUT_POST); + $notifyfrom = rcube_utils::get_input_value('_action_notifyfrom', rcube_utils::INPUT_POST); + $notifyimp = rcube_utils::get_input_value('_action_notifyimportance', rcube_utils::INPUT_POST); // we need a "hack" for radiobuttons foreach ($sizeitems as $item) @@ -858,7 +858,7 @@ class managesieve extends rcube_plugin if ($this->form['actions'][$i]['target'] == '') $this->errors['actions'][$i]['target'] = $this->gettext('cannotbeempty'); - else if (!check_email($this->form['actions'][$i]['target'])) + else if (!rcube_utils::check_email($this->form['actions'][$i]['target'])) $this->errors['actions'][$i]['target'] = $this->gettext('noemailwarning'); if ($type == 'redirect_copy') { @@ -895,7 +895,7 @@ class managesieve extends rcube_plugin $address = trim($address); if (!$address) unset($this->form['actions'][$i]['addresses'][$aidx]); - else if(!check_email($address)) { + else if(!rcube_utils::check_email($address)) { $this->errors['actions'][$i]['addresses'] = $this->gettext('noemailwarning'); break; } else @@ -932,10 +932,10 @@ class managesieve extends rcube_plugin if (empty($notifyaddrs[$idx])) { $this->errors['actions'][$i]['address'] = $this->gettext('cannotbeempty'); } - else if (!check_email($notifyaddrs[$idx])) { + else if (!rcube_utils::check_email($notifyaddrs[$idx])) { $this->errors['actions'][$i]['address'] = $this->gettext('noemailwarning'); } - if (!empty($notifyfrom[$idx]) && !check_email($notifyfrom[$idx])) { + if (!empty($notifyfrom[$idx]) && !rcube_utils::check_email($notifyfrom[$idx])) { $this->errors['actions'][$i]['from'] = $this->gettext('noemailwarning'); } $this->form['actions'][$i]['address'] = $notifyaddrs[$idx]; @@ -967,7 +967,7 @@ class managesieve extends rcube_plugin $this->rc->output->command('parent.managesieve_updatelist', isset($new) ? 'add' : 'update', array( - 'name' => Q($this->form['name']), + 'name' => rcube::Q($this->form['name']), 'id' => $fid, 'disabled' => $this->form['disabled'] )); @@ -1016,7 +1016,7 @@ class managesieve extends rcube_plugin $result = $this->list_rules(); // create XHTML table - $out = rcube_table_output($attrib, $result, $a_show_cols, 'id'); + $out = $this->rc->table_output($attrib, $result, $a_show_cols, 'id'); // set client env $this->rc->output->add_gui_object('filterslist', $attrib['id']); @@ -1049,7 +1049,7 @@ class managesieve extends rcube_plugin foreach ($list as $idx => $set) { $scripts['S'.$idx] = $set; $result[] = array( - 'name' => Q($set), + 'name' => rcube::Q($set), 'id' => 'S'.$idx, 'class' => !in_array($set, $this->active) ? 'disabled' : '', ); @@ -1057,7 +1057,7 @@ class managesieve extends rcube_plugin } // create XHTML table - $out = rcube_table_output($attrib, $result, $a_show_cols, 'id'); + $out = $this->rc->table_output($attrib, $result, $a_show_cols, 'id'); $this->rc->output->set_env('filtersets', $scripts); $this->rc->output->include_script('list.js'); @@ -1111,21 +1111,21 @@ class managesieve extends rcube_plugin $out .= $hiddenfields->show(); - $name = get_input_value('_name', RCUBE_INPUT_POST); - $copy = get_input_value('_copy', RCUBE_INPUT_POST); - $selected = get_input_value('_from', RCUBE_INPUT_POST); + $name = rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST); + $copy = rcube_utils::get_input_value('_copy', rcube_utils::INPUT_POST); + $selected = rcube_utils::get_input_value('_from', rcube_utils::INPUT_POST); // filter set name input $input_name = new html_inputfield(array('name' => '_name', 'id' => '_name', 'size' => 30, 'class' => ($this->errors['name'] ? 'error' : ''))); $out .= sprintf('<label for="%s"><b>%s:</b></label> %s<br /><br />', - '_name', Q($this->gettext('filtersetname')), $input_name->show($name)); + '_name', rcube::Q($this->gettext('filtersetname')), $input_name->show($name)); $out .="\n<fieldset class=\"itemlist\"><legend>" . $this->gettext('filters') . ":</legend>\n"; $out .= '<input type="radio" id="from_none" name="_from" value="none"' .(!$selected || $selected=='none' ? ' checked="checked"' : '').'></input>'; - $out .= sprintf('<label for="%s">%s</label> ', 'from_none', Q($this->gettext('none'))); + $out .= sprintf('<label for="%s">%s</label> ', 'from_none', rcube::Q($this->gettext('none'))); // filters set list $list = $this->list_scripts(); @@ -1143,7 +1143,7 @@ class managesieve extends rcube_plugin $out .= '<br /><input type="radio" id="from_set" name="_from" value="set"' .($selected=='set' ? ' checked="checked"' : '').'></input>'; - $out .= sprintf('<label for="%s">%s:</label> ', 'from_set', Q($this->gettext('fromset'))); + $out .= sprintf('<label for="%s">%s:</label> ', 'from_set', rcube::Q($this->gettext('fromset'))); $out .= $select->show($copy); } @@ -1153,7 +1153,7 @@ class managesieve extends rcube_plugin $out .= '<br /><input type="radio" id="from_file" name="_from" value="file"' .($selected=='file' ? ' checked="checked"' : '').'></input>'; - $out .= sprintf('<label for="%s">%s:</label> ', 'from_file', Q($this->gettext('fromfile'))); + $out .= sprintf('<label for="%s">%s:</label> ', 'from_file', rcube::Q($this->gettext('fromfile'))); $out .= $upload->show(); $out .= '</fieldset>'; @@ -1175,7 +1175,7 @@ class managesieve extends rcube_plugin if (!$attrib['id']) $attrib['id'] = 'rcmfilterform'; - $fid = get_input_value('_fid', RCUBE_INPUT_GPC); + $fid = rcube_utils::get_input_value('_fid', rcube_utils::INPUT_GPC); $scr = isset($this->form) ? $this->form : $this->script[$fid]; $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $this->rc->task)); @@ -1204,16 +1204,16 @@ class managesieve extends rcube_plugin $input_name = $input_name->show(); $out .= sprintf("\n<label for=\"%s\"><b>%s:</b></label> %s\n", - $field_id, Q($this->gettext('filtername')), $input_name); + $field_id, rcube::Q($this->gettext('filtername')), $input_name); // filter set selector if ($this->rc->task == 'mail') { $out .= sprintf("\n <label for=\"%s\"><b>%s:</b></label> %s\n", - $field_id, Q($this->gettext('filterset')), + $field_id, rcube::Q($this->gettext('filterset')), $this->filtersets_list(array('id' => 'sievescriptname'), true)); } - $out .= '<br /><br /><fieldset><legend>' . Q($this->gettext('messagesrules')) . "</legend>\n"; + $out .= '<br /><br /><fieldset><legend>' . rcube::Q($this->gettext('messagesrules')) . "</legend>\n"; // any, allof, anyof radio buttons $field_id = '_allof'; @@ -1226,7 +1226,7 @@ class managesieve extends rcube_plugin $input_join = $input_join->show(); $out .= sprintf("%s<label for=\"%s\">%s</label> \n", - $input_join, $field_id, Q($this->gettext('filterallof'))); + $input_join, $field_id, rcube::Q($this->gettext('filterallof'))); $field_id = '_anyof'; $input_join = new html_radiobutton(array('name' => '_join', 'id' => $field_id, 'value' => 'anyof', @@ -1238,7 +1238,7 @@ class managesieve extends rcube_plugin $input_join = $input_join->show('anyof'); // default $out .= sprintf("%s<label for=\"%s\">%s</label>\n", - $input_join, $field_id, Q($this->gettext('filteranyof'))); + $input_join, $field_id, rcube::Q($this->gettext('filteranyof'))); $field_id = '_any'; $input_join = new html_radiobutton(array('name' => '_join', 'id' => $field_id, 'value' => 'any', @@ -1247,7 +1247,7 @@ class managesieve extends rcube_plugin $input_join = $input_join->show($any ? 'any' : ''); $out .= sprintf("%s<label for=\"%s\">%s</label>\n", - $input_join, $field_id, Q($this->gettext('filterany'))); + $input_join, $field_id, rcube::Q($this->gettext('filterany'))); $rows_num = isset($scr) ? sizeof($scr['tests']) : 1; @@ -1259,7 +1259,7 @@ class managesieve extends rcube_plugin $out .= "</fieldset>\n"; // actions - $out .= '<fieldset><legend>' . Q($this->gettext('messagesactions')) . "</legend>\n"; + $out .= '<fieldset><legend>' . rcube::Q($this->gettext('messagesactions')) . "</legend>\n"; $rows_num = isset($scr) ? sizeof($scr['actions']) : 1; @@ -1293,11 +1293,11 @@ class managesieve extends rcube_plugin $select_header = new html_select(array('name' => "_header[]", 'id' => 'header'.$id, 'onchange' => 'rule_header_select(' .$id .')')); foreach($this->headers as $name => $val) - $select_header->add(Q($this->gettext($name)), Q($val)); + $select_header->add(rcube::Q($this->gettext($name)), Q($val)); if (in_array('body', $this->exts)) - $select_header->add(Q($this->gettext('body')), 'body'); - $select_header->add(Q($this->gettext('size')), 'size'); - $select_header->add(Q($this->gettext('...')), '...'); + $select_header->add(rcube::Q($this->gettext('body')), 'body'); + $select_header->add(rcube::Q($this->gettext('size')), 'size'); + $select_header->add(rcube::Q($this->gettext('...')), '...'); // TODO: list arguments $aout = ''; @@ -1337,38 +1337,38 @@ class managesieve extends rcube_plugin $tout = '<div id="custom_header' .$id. '" style="display:' .(isset($custom) ? 'inline' : 'none'). '"> <input type="text" name="_custom_header[]" id="custom_header_i'.$id.'" ' . $this->error_class($id, 'test', 'header', 'custom_header_i') - .' value="' .Q($custom). '" size="15" /> </div>' . "\n"; + .' value="' .rcube::Q($custom). '" size="15" /> </div>' . "\n"; // matching type select (operator) $select_op = new html_select(array('name' => "_rule_op[]", 'id' => 'rule_op'.$id, 'style' => 'display:' .($rule['test']!='size' ? 'inline' : 'none'), 'class' => 'operator_selector', 'onchange' => 'rule_op_select('.$id.')')); - $select_op->add(Q($this->gettext('filtercontains')), 'contains'); - $select_op->add(Q($this->gettext('filternotcontains')), 'notcontains'); - $select_op->add(Q($this->gettext('filteris')), 'is'); - $select_op->add(Q($this->gettext('filterisnot')), 'notis'); - $select_op->add(Q($this->gettext('filterexists')), 'exists'); - $select_op->add(Q($this->gettext('filternotexists')), 'notexists'); - $select_op->add(Q($this->gettext('filtermatches')), 'matches'); - $select_op->add(Q($this->gettext('filternotmatches')), 'notmatches'); + $select_op->add(rcube::Q($this->gettext('filtercontains')), 'contains'); + $select_op->add(rcube::Q($this->gettext('filternotcontains')), 'notcontains'); + $select_op->add(rcube::Q($this->gettext('filteris')), 'is'); + $select_op->add(rcube::Q($this->gettext('filterisnot')), 'notis'); + $select_op->add(rcube::Q($this->gettext('filterexists')), 'exists'); + $select_op->add(rcube::Q($this->gettext('filternotexists')), 'notexists'); + $select_op->add(rcube::Q($this->gettext('filtermatches')), 'matches'); + $select_op->add(rcube::Q($this->gettext('filternotmatches')), 'notmatches'); if (in_array('regex', $this->exts)) { - $select_op->add(Q($this->gettext('filterregex')), 'regex'); - $select_op->add(Q($this->gettext('filternotregex')), 'notregex'); + $select_op->add(rcube::Q($this->gettext('filterregex')), 'regex'); + $select_op->add(rcube::Q($this->gettext('filternotregex')), 'notregex'); } if (in_array('relational', $this->exts)) { - $select_op->add(Q($this->gettext('countisgreaterthan')), 'count-gt'); - $select_op->add(Q($this->gettext('countisgreaterthanequal')), 'count-ge'); - $select_op->add(Q($this->gettext('countislessthan')), 'count-lt'); - $select_op->add(Q($this->gettext('countislessthanequal')), 'count-le'); - $select_op->add(Q($this->gettext('countequals')), 'count-eq'); - $select_op->add(Q($this->gettext('countnotequals')), 'count-ne'); - $select_op->add(Q($this->gettext('valueisgreaterthan')), 'value-gt'); - $select_op->add(Q($this->gettext('valueisgreaterthanequal')), 'value-ge'); - $select_op->add(Q($this->gettext('valueislessthan')), 'value-lt'); - $select_op->add(Q($this->gettext('valueislessthanequal')), 'value-le'); - $select_op->add(Q($this->gettext('valueequals')), 'value-eq'); - $select_op->add(Q($this->gettext('valuenotequals')), 'value-ne'); + $select_op->add(rcube::Q($this->gettext('countisgreaterthan')), 'count-gt'); + $select_op->add(rcube::Q($this->gettext('countisgreaterthanequal')), 'count-ge'); + $select_op->add(rcube::Q($this->gettext('countislessthan')), 'count-lt'); + $select_op->add(rcube::Q($this->gettext('countislessthanequal')), 'count-le'); + $select_op->add(rcube::Q($this->gettext('countequals')), 'count-eq'); + $select_op->add(rcube::Q($this->gettext('countnotequals')), 'count-ne'); + $select_op->add(rcube::Q($this->gettext('valueisgreaterthan')), 'value-gt'); + $select_op->add(rcube::Q($this->gettext('valueisgreaterthanequal')), 'value-ge'); + $select_op->add(rcube::Q($this->gettext('valueislessthan')), 'value-lt'); + $select_op->add(rcube::Q($this->gettext('valueislessthanequal')), 'value-le'); + $select_op->add(rcube::Q($this->gettext('valueequals')), 'value-eq'); + $select_op->add(rcube::Q($this->gettext('valuenotequals')), 'value-ne'); } // target input (TODO: lists) @@ -1400,53 +1400,53 @@ class managesieve extends rcube_plugin $tout .= $select_op->show($test); $tout .= '<input type="text" name="_rule_target[]" id="rule_target' .$id. '" - value="' .Q($target). '" size="20" ' . $this->error_class($id, 'test', 'target', 'rule_target') + value="' .rcube::Q($target). '" size="20" ' . $this->error_class($id, 'test', 'target', 'rule_target') . ' style="display:' . ($rule['test']!='size' && $rule['test'] != 'exists' ? 'inline' : 'none') . '" />'."\n"; $select_size_op = new html_select(array('name' => "_rule_size_op[]", 'id' => 'rule_size_op'.$id)); - $select_size_op->add(Q($this->gettext('filterover')), 'over'); - $select_size_op->add(Q($this->gettext('filterunder')), 'under'); + $select_size_op->add(rcube::Q($this->gettext('filterover')), 'over'); + $select_size_op->add(rcube::Q($this->gettext('filterunder')), 'under'); $tout .= '<div id="rule_size' .$id. '" style="display:' . ($rule['test']=='size' ? 'inline' : 'none') .'">'; $tout .= $select_size_op->show($rule['test']=='size' ? $rule['type'] : ''); $tout .= '<input type="text" name="_rule_size_target[]" id="rule_size_i'.$id.'" value="'.$sizetarget.'" size="10" ' . $this->error_class($id, 'test', 'sizetarget', 'rule_size_i') .' /> <input type="radio" name="_rule_size_item['.$id.']" value=""' - . (!$sizeitem ? ' checked="checked"' : '') .' class="radio" />'.rcube_label('B').' + . (!$sizeitem ? ' checked="checked"' : '') .' class="radio" />'.$this->rc->gettext('B').' <input type="radio" name="_rule_size_item['.$id.']" value="K"' - . ($sizeitem=='K' ? ' checked="checked"' : '') .' class="radio" />'.rcube_label('KB').' + . ($sizeitem=='K' ? ' checked="checked"' : '') .' class="radio" />'.$this->rc->gettext('KB').' <input type="radio" name="_rule_size_item['.$id.']" value="M"' - . ($sizeitem=='M' ? ' checked="checked"' : '') .' class="radio" />'.rcube_label('MB').' + . ($sizeitem=='M' ? ' checked="checked"' : '') .' class="radio" />'.$this->rc->gettext('MB').' <input type="radio" name="_rule_size_item['.$id.']" value="G"' - . ($sizeitem=='G' ? ' checked="checked"' : '') .' class="radio" />'.rcube_label('GB'); + . ($sizeitem=='G' ? ' checked="checked"' : '') .' class="radio" />'.$this->rc->gettext('GB'); $tout .= '</div>'; // Advanced modifiers (address, envelope) $select_mod = new html_select(array('name' => "_rule_mod[]", 'id' => 'rule_mod_op'.$id, 'onchange' => 'rule_mod_select(' .$id .')')); - $select_mod->add(Q($this->gettext('none')), ''); - $select_mod->add(Q($this->gettext('address')), 'address'); + $select_mod->add(rcube::Q($this->gettext('none')), ''); + $select_mod->add(rcube::Q($this->gettext('address')), 'address'); if (in_array('envelope', $this->exts)) - $select_mod->add(Q($this->gettext('envelope')), 'envelope'); + $select_mod->add(rcube::Q($this->gettext('envelope')), 'envelope'); $select_type = new html_select(array('name' => "_rule_mod_type[]", 'id' => 'rule_mod_type'.$id)); - $select_type->add(Q($this->gettext('allparts')), 'all'); - $select_type->add(Q($this->gettext('domain')), 'domain'); - $select_type->add(Q($this->gettext('localpart')), 'localpart'); + $select_type->add(rcube::Q($this->gettext('allparts')), 'all'); + $select_type->add(rcube::Q($this->gettext('domain')), 'domain'); + $select_type->add(rcube::Q($this->gettext('localpart')), 'localpart'); if (in_array('subaddress', $this->exts)) { - $select_type->add(Q($this->gettext('user')), 'user'); - $select_type->add(Q($this->gettext('detail')), 'detail'); + $select_type->add(rcube::Q($this->gettext('user')), 'user'); + $select_type->add(rcube::Q($this->gettext('detail')), 'detail'); } $need_mod = $rule['test'] != 'size' && $rule['test'] != 'body'; $mout = '<div id="rule_mod' .$id. '" class="adv" style="display:' . ($need_mod ? 'block' : 'none') .'">'; $mout .= ' <span>'; - $mout .= Q($this->gettext('modifier')) . ' '; + $mout .= rcube::Q($this->gettext('modifier')) . ' '; $mout .= $select_mod->show($rule['test']); $mout .= '</span>'; $mout .= ' <span id="rule_mod_type' . $id . '"'; $mout .= ' style="display:' . (in_array($rule['test'], array('address', 'envelope')) ? 'inline' : 'none') .'">'; - $mout .= Q($this->gettext('modtype')) . ' '; + $mout .= rcube::Q($this->gettext('modtype')) . ' '; $mout .= $select_type->show($rule['part']); $mout .= '</span>'; $mout .= '</div>'; @@ -1454,13 +1454,13 @@ class managesieve extends rcube_plugin // Advanced modifiers (body transformations) $select_mod = new html_select(array('name' => "_rule_trans[]", 'id' => 'rule_trans_op'.$id, 'onchange' => 'rule_trans_select(' .$id .')')); - $select_mod->add(Q($this->gettext('text')), 'text'); - $select_mod->add(Q($this->gettext('undecoded')), 'raw'); - $select_mod->add(Q($this->gettext('contenttype')), 'content'); + $select_mod->add(rcube::Q($this->gettext('text')), 'text'); + $select_mod->add(rcube::Q($this->gettext('undecoded')), 'raw'); + $select_mod->add(rcube::Q($this->gettext('contenttype')), 'content'); $mout .= '<div id="rule_trans' .$id. '" class="adv" style="display:' . ($rule['test'] == 'body' ? 'block' : 'none') .'">'; $mout .= ' <span>'; - $mout .= Q($this->gettext('modifier')) . ' '; + $mout .= rcube::Q($this->gettext('modifier')) . ' '; $mout .= $select_mod->show($rule['part']); $mout .= '<input type="text" name="_rule_trans_type[]" id="rule_trans_type'.$id . '" value="'.(is_array($rule['content']) ? implode(',', $rule['content']) : $rule['content']) @@ -1471,16 +1471,16 @@ class managesieve extends rcube_plugin // Advanced modifiers (body transformations) $select_comp = new html_select(array('name' => "_rule_comp[]", 'id' => 'rule_comp_op'.$id)); - $select_comp->add(Q($this->gettext('default')), ''); - $select_comp->add(Q($this->gettext('octet')), 'i;octet'); - $select_comp->add(Q($this->gettext('asciicasemap')), 'i;ascii-casemap'); + $select_comp->add(rcube::Q($this->gettext('default')), ''); + $select_comp->add(rcube::Q($this->gettext('octet')), 'i;octet'); + $select_comp->add(rcube::Q($this->gettext('asciicasemap')), 'i;ascii-casemap'); if (in_array('comparator-i;ascii-numeric', $this->exts)) { - $select_comp->add(Q($this->gettext('asciinumeric')), 'i;ascii-numeric'); + $select_comp->add(rcube::Q($this->gettext('asciinumeric')), 'i;ascii-numeric'); } $mout .= '<div id="rule_comp' .$id. '" class="adv" style="display:' . ($rule['test'] != 'size' ? 'block' : 'none') .'">'; $mout .= ' <span>'; - $mout .= Q($this->gettext('comparator')) . ' '; + $mout .= rcube::Q($this->gettext('comparator')) . ' '; $mout .= $select_comp->show($rule['comparator']); $mout .= '</span>'; $mout .= '</div>'; @@ -1489,7 +1489,7 @@ class managesieve extends rcube_plugin $out = $div ? '<div class="rulerow" id="rulerow' .$id .'">'."\n" : ''; $out .= '<table><tr>'; $out .= '<td class="advbutton">'; - $out .= '<a href="#" id="ruleadv' . $id .'" title="'. Q($this->gettext('advancedopts')). '" + $out .= '<a href="#" id="ruleadv' . $id .'" title="'. rcube::Q($this->gettext('advancedopts')). '" onclick="rule_adv_switch(' . $id .', this)" class="show"> </a>'; $out .= '</td>'; $out .= '<td class="rowactions">' . $aout . '</td>'; @@ -1499,9 +1499,9 @@ class managesieve extends rcube_plugin // add/del buttons $out .= '<td class="rowbuttons">'; - $out .= '<a href="#" id="ruleadd' . $id .'" title="'. Q($this->gettext('add')). '" + $out .= '<a href="#" id="ruleadd' . $id .'" title="'. rcube::Q($this->gettext('add')). '" onclick="rcmail.managesieve_ruleadd(' . $id .')" class="button add"></a>'; - $out .= '<a href="#" id="ruledel' . $id .'" title="'. Q($this->gettext('del')). '" + $out .= '<a href="#" id="ruledel' . $id .'" title="'. rcube::Q($this->gettext('del')). '" onclick="rcmail.managesieve_ruledel(' . $id .')" class="button del' . ($rows_num<2 ? ' disabled' : '') .'"></a>'; $out .= '</td>'; $out .= '</tr></table>'; @@ -1524,31 +1524,31 @@ class managesieve extends rcube_plugin $select_action = new html_select(array('name' => "_action_type[$id]", 'id' => 'action_type'.$id, 'onchange' => 'action_type_select(' .$id .')')); if (in_array('fileinto', $this->exts)) - $select_action->add(Q($this->gettext('messagemoveto')), 'fileinto'); + $select_action->add(rcube::Q($this->gettext('messagemoveto')), 'fileinto'); if (in_array('fileinto', $this->exts) && in_array('copy', $this->exts)) - $select_action->add(Q($this->gettext('messagecopyto')), 'fileinto_copy'); - $select_action->add(Q($this->gettext('messageredirect')), 'redirect'); + $select_action->add(rcube::Q($this->gettext('messagecopyto')), 'fileinto_copy'); + $select_action->add(rcube::Q($this->gettext('messageredirect')), 'redirect'); if (in_array('copy', $this->exts)) - $select_action->add(Q($this->gettext('messagesendcopy')), 'redirect_copy'); + $select_action->add(rcube::Q($this->gettext('messagesendcopy')), 'redirect_copy'); if (in_array('reject', $this->exts)) - $select_action->add(Q($this->gettext('messagediscard')), 'reject'); + $select_action->add(rcube::Q($this->gettext('messagediscard')), 'reject'); else if (in_array('ereject', $this->exts)) - $select_action->add(Q($this->gettext('messagediscard')), 'ereject'); + $select_action->add(rcube::Q($this->gettext('messagediscard')), 'ereject'); if (in_array('vacation', $this->exts)) - $select_action->add(Q($this->gettext('messagereply')), 'vacation'); - $select_action->add(Q($this->gettext('messagedelete')), 'discard'); + $select_action->add(rcube::Q($this->gettext('messagereply')), 'vacation'); + $select_action->add(rcube::Q($this->gettext('messagedelete')), 'discard'); if (in_array('imapflags', $this->exts) || in_array('imap4flags', $this->exts)) { - $select_action->add(Q($this->gettext('setflags')), 'setflag'); - $select_action->add(Q($this->gettext('addflags')), 'addflag'); - $select_action->add(Q($this->gettext('removeflags')), 'removeflag'); + $select_action->add(rcube::Q($this->gettext('setflags')), 'setflag'); + $select_action->add(rcube::Q($this->gettext('addflags')), 'addflag'); + $select_action->add(rcube::Q($this->gettext('removeflags')), 'removeflag'); } if (in_array('variables', $this->exts)) { - $select_action->add(Q($this->gettext('setvariable')), 'set'); + $select_action->add(rcube::Q($this->gettext('setvariable')), 'set'); } if (in_array('enotify', $this->exts) || in_array('notify', $this->exts)) { - $select_action->add(Q($this->gettext('notify')), 'notify'); + $select_action->add(rcube::Q($this->gettext('notify')), 'notify'); } - $select_action->add(Q($this->gettext('rulestop')), 'stop'); + $select_action->add(rcube::Q($this->gettext('rulestop')), 'stop'); $select_type = $action['type']; if (in_array($action['type'], array('fileinto', 'redirect')) && $action['copy']) { @@ -1562,32 +1562,32 @@ class managesieve extends rcube_plugin $out .= '<td class="rowtargets">'; // shared targets $out .= '<input type="text" name="_action_target['.$id.']" id="action_target' .$id. '" ' - .'value="' .($action['type']=='redirect' ? Q($action['target'], 'strict', false) : ''). '" size="35" ' + .'value="' .($action['type']=='redirect' ? rcube::Q($action['target'], 'strict', false) : ''). '" size="35" ' .'style="display:' .($action['type']=='redirect' ? 'inline' : 'none') .'" ' . $this->error_class($id, 'action', 'target', 'action_target') .' />'; $out .= '<textarea name="_action_target_area['.$id.']" id="action_target_area' .$id. '" ' .'rows="3" cols="35" '. $this->error_class($id, 'action', 'targetarea', 'action_target_area') .'style="display:' .(in_array($action['type'], array('reject', 'ereject')) ? 'inline' : 'none') .'">' - . (in_array($action['type'], array('reject', 'ereject')) ? Q($action['target'], 'strict', false) : '') + . (in_array($action['type'], array('reject', 'ereject')) ? rcube::Q($action['target'], 'strict', false) : '') . "</textarea>\n"; // vacation $out .= '<div id="action_vacation' .$id.'" style="display:' .($action['type']=='vacation' ? 'inline' : 'none') .'">'; - $out .= '<span class="label">'. Q($this->gettext('vacationreason')) .'</span><br />' + $out .= '<span class="label">'. rcube::Q($this->gettext('vacationreason')) .'</span><br />' .'<textarea name="_action_reason['.$id.']" id="action_reason' .$id. '" ' .'rows="3" cols="35" '. $this->error_class($id, 'action', 'reason', 'action_reason') . '>' . Q($action['reason'], 'strict', false) . "</textarea>\n"; - $out .= '<br /><span class="label">' .Q($this->gettext('vacationsubject')) . '</span><br />' + $out .= '<br /><span class="label">' .rcube::Q($this->gettext('vacationsubject')) . '</span><br />' .'<input type="text" name="_action_subject['.$id.']" id="action_subject'.$id.'" ' - .'value="' . (is_array($action['subject']) ? Q(implode(', ', $action['subject']), 'strict', false) : $action['subject']) . '" size="35" ' + .'value="' . (is_array($action['subject']) ? rcube::Q(implode(', ', $action['subject']), 'strict', false) : $action['subject']) . '" size="35" ' . $this->error_class($id, 'action', 'subject', 'action_subject') .' />'; - $out .= '<br /><span class="label">' .Q($this->gettext('vacationaddresses')) . '</span><br />' + $out .= '<br /><span class="label">' .rcube::Q($this->gettext('vacationaddresses')) . '</span><br />' .'<input type="text" name="_action_addresses['.$id.']" id="action_addr'.$id.'" ' - .'value="' . (is_array($action['addresses']) ? Q(implode(', ', $action['addresses']), 'strict', false) : $action['addresses']) . '" size="35" ' + .'value="' . (is_array($action['addresses']) ? rcube::Q(implode(', ', $action['addresses']), 'strict', false) : $action['addresses']) . '" size="35" ' . $this->error_class($id, 'action', 'addresses', 'action_addr') .' />'; - $out .= '<br /><span class="label">' . Q($this->gettext('vacationdays')) . '</span><br />' + $out .= '<br /><span class="label">' . rcube::Q($this->gettext('vacationdays')) . '</span><br />' .'<input type="text" name="_action_days['.$id.']" id="action_days'.$id.'" ' - .'value="' .Q($action['days'], 'strict', false) . '" size="2" ' + .'value="' .rcube::Q($action['days'], 'strict', false) . '" size="2" ' . $this->error_class($id, 'action', 'days', 'action_days') .' />'; $out .= '</div>'; @@ -1607,7 +1607,7 @@ class managesieve extends rcube_plugin foreach ($flags as $fidx => $flag) { $out .= '<input type="checkbox" name="_action_flags[' .$id .'][]" value="' . $flag . '"' . (in_array_nocase($flag, $flags_target) ? 'checked="checked"' : '') . ' />' - . Q($this->gettext('flag'.$fidx)) .'<br>'; + . rcube::Q($this->gettext('flag'.$fidx)) .'<br>'; } $out .= '</div>'; @@ -1622,42 +1622,42 @@ class managesieve extends rcube_plugin ); $out .= '<div id="action_set' .$id.'" style="display:' .($action['type']=='set' ? 'inline' : 'none') .'">'; - $out .= '<span class="label">' .Q($this->gettext('setvarname')) . '</span><br />' + $out .= '<span class="label">' .rcube::Q($this->gettext('setvarname')) . '</span><br />' .'<input type="text" name="_action_varname['.$id.']" id="action_varname'.$id.'" ' - .'value="' . Q($action['name']) . '" size="35" ' + .'value="' . rcube::Q($action['name']) . '" size="35" ' . $this->error_class($id, 'action', 'name', 'action_varname') .' />'; - $out .= '<br /><span class="label">' .Q($this->gettext('setvarvalue')) . '</span><br />' + $out .= '<br /><span class="label">' .rcube::Q($this->gettext('setvarvalue')) . '</span><br />' .'<input type="text" name="_action_varvalue['.$id.']" id="action_varvalue'.$id.'" ' - .'value="' . Q($action['value']) . '" size="35" ' + .'value="' . rcube::Q($action['value']) . '" size="35" ' . $this->error_class($id, 'action', 'value', 'action_varvalue') .' />'; - $out .= '<br /><span class="label">' .Q($this->gettext('setvarmodifiers')) . '</span><br />'; + $out .= '<br /><span class="label">' .rcube::Q($this->gettext('setvarmodifiers')) . '</span><br />'; foreach ($set_modifiers as $j => $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, (array_key_exists($s_m, (array)$action) && $action[$s_m] ? ' checked="checked"' : ''), - Q($this->gettext('var' . $s_m))); + rcube::Q($this->gettext('var' . $s_m))); } $out .= '</div>'; // notify // skip :options tag - not used by the mailto method $out .= '<div id="action_notify' .$id.'" style="display:' .($action['type']=='notify' ? 'inline' : 'none') .'">'; - $out .= '<span class="label">' .Q($this->gettext('notifyaddress')) . '</span><br />' + $out .= '<span class="label">' .rcube::Q($this->gettext('notifyaddress')) . '</span><br />' .'<input type="text" name="_action_notifyaddress['.$id.']" id="action_notifyaddress'.$id.'" ' - .'value="' . Q($action['address']) . '" size="35" ' + .'value="' . rcube::Q($action['address']) . '" size="35" ' . $this->error_class($id, 'action', 'address', 'action_notifyaddress') .' />'; - $out .= '<br /><span class="label">'. Q($this->gettext('notifybody')) .'</span><br />' + $out .= '<br /><span class="label">'. rcube::Q($this->gettext('notifybody')) .'</span><br />' .'<textarea name="_action_notifybody['.$id.']" id="action_notifybody' .$id. '" ' .'rows="3" cols="35" '. $this->error_class($id, 'action', 'method', 'action_notifybody') . '>' - . Q($action['body'], 'strict', false) . "</textarea>\n"; - $out .= '<br /><span class="label">' .Q($this->gettext('notifysubject')) . '</span><br />' + . rcube::Q($action['body'], 'strict', false) . "</textarea>\n"; + $out .= '<br /><span class="label">' .rcube::Q($this->gettext('notifysubject')) . '</span><br />' .'<input type="text" name="_action_notifymessage['.$id.']" id="action_notifymessage'.$id.'" ' - .'value="' . Q($action['message']) . '" size="35" ' + .'value="' . rcube::Q($action['message']) . '" size="35" ' . $this->error_class($id, 'action', 'message', 'action_notifymessage') .' />'; - $out .= '<br /><span class="label">' .Q($this->gettext('notifyfrom')) . '</span><br />' + $out .= '<br /><span class="label">' .rcube::Q($this->gettext('notifyfrom')) . '</span><br />' .'<input type="text" name="_action_notifyfrom['.$id.']" id="action_notifyfrom'.$id.'" ' - .'value="' . Q($action['from']) . '" size="35" ' + .'value="' . rcube::Q($action['from']) . '" size="35" ' . $this->error_class($id, 'action', 'from', 'action_notifyfrom') .' />'; $importance_options = array( 3 => 'notifyimportancelow', @@ -1669,9 +1669,9 @@ class managesieve extends rcube_plugin 'id' => '_action_notifyimportance' . $id, 'class' => $this->error_class($id, 'action', 'importance', 'action_notifyimportance'))); foreach ($importance_options as $io_v => $io_n) { - $select_importance->add(Q($this->gettext($io_n)), $io_v); + $select_importance->add(rcube::Q($this->gettext($io_n)), $io_v); } - $out .= '<br /><span class="label">' . Q($this->gettext('notifyimportance')) . '</span><br />'; + $out .= '<br /><span class="label">' . rcube::Q($this->gettext('notifyimportance')) . '</span><br />'; $out .= $select_importance->show($action['importance'] ? $action['importance'] : 2); $out .= '</div>'; @@ -1681,7 +1681,7 @@ class managesieve extends rcube_plugin else $mailbox = ''; - $select = rcmail_mailbox_select(array( + $select = $this->rc->folder_selector(array( 'realnames' => false, 'maxlength' => 100, 'id' => 'action_mailbox' . $id, @@ -1693,9 +1693,9 @@ class managesieve extends rcube_plugin // add/del buttons $out .= '<td class="rowbuttons">'; - $out .= '<a href="#" id="actionadd' . $id .'" title="'. Q($this->gettext('add')). '" + $out .= '<a href="#" id="actionadd' . $id .'" title="'. rcube::Q($this->gettext('add')). '" onclick="rcmail.managesieve_actionadd(' . $id .')" class="button add"></a>'; - $out .= '<a href="#" id="actiondel' . $id .'" title="'. Q($this->gettext('del')). '" + $out .= '<a href="#" id="actiondel' . $id .'" title="'. rcube::Q($this->gettext('del')). '" onclick="rcmail.managesieve_actiondel(' . $id .')" class="button del' . ($rows_num<2 ? ' disabled' : '') .'"></a>'; $out .= '</td>'; @@ -1746,7 +1746,7 @@ class managesieve extends rcube_plugin if (empty($this->tips)) return; - $script = JS_OBJECT_NAME.'.managesieve_tip_register('.json_encode($this->tips).');'; + $script = rcmail_output::JS_OBJECT_NAME.'.managesieve_tip_register('.json_encode($this->tips).');'; $this->rc->output->add_script($script, 'foot'); } @@ -1766,12 +1766,12 @@ class managesieve extends rcube_plugin $mbox_encoding = $this->rc->config->get('managesieve_mbox_encoding', 'UTF7-IMAP'); if ($mode == 'out') { - $mailbox = rcube_charset_convert($mailbox, $mbox_encoding, 'UTF7-IMAP'); + $mailbox = rcube_charset::convert($mailbox, $mbox_encoding, 'UTF7-IMAP'); if ($replace_delimiter && $replace_delimiter != $delimiter) $mailbox = str_replace($replace_delimiter, $delimiter, $mailbox); } else { - $mailbox = rcube_charset_convert($mailbox, 'UTF7-IMAP', $mbox_encoding); + $mailbox = rcube_charset::convert($mailbox, 'UTF7-IMAP', $mbox_encoding); if ($replace_delimiter && $replace_delimiter != $delimiter) $mailbox = str_replace($delimiter, $replace_delimiter, $mailbox); } @@ -2039,7 +2039,7 @@ class managesieve extends rcube_plugin $fname = $filter['name'] ? $filter['name'] : "#$i"; $result[] = array( 'id' => $idx, - 'name' => Q($fname), + 'name' => rcube::Q($fname), 'class' => $filter['disabled'] ? 'disabled' : '', ); $i++; diff --git a/plugins/markasjunk/markasjunk.php b/plugins/markasjunk/markasjunk.php index 4db90c1bc..76b14c140 100644 --- a/plugins/markasjunk/markasjunk.php +++ b/plugins/markasjunk/markasjunk.php @@ -45,8 +45,8 @@ class markasjunk extends rcube_plugin $GLOBALS['IMAP_FLAGS']['JUNK'] = 'Junk'; $GLOBALS['IMAP_FLAGS']['NONJUNK'] = 'NonJunk'; - $uids = get_input_value('_uid', RCUBE_INPUT_POST); - $mbox = get_input_value('_mbox', RCUBE_INPUT_POST); + $uids = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST); + $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST); $rcmail = rcmail::get_instance(); $rcmail->storage->unset_flag($uids, 'NONJUNK'); diff --git a/plugins/new_user_dialog/new_user_dialog.php b/plugins/new_user_dialog/new_user_dialog.php index 9c9dcce1c..871384e47 100644 --- a/plugins/new_user_dialog/new_user_dialog.php +++ b/plugins/new_user_dialog/new_user_dialog.php @@ -63,7 +63,7 @@ class new_user_dialog extends rcube_plugin $table->add(null, html::tag('input', array( 'type' => 'text', 'name' => '_email', - 'value' => rcube_idn_to_utf8($identity['email']), + 'value' => rcube_utils::idn_to_utf8($identity['email']), 'disabled' => ($identities_level == 1 || $identities_level == 3) ))); @@ -86,8 +86,8 @@ class new_user_dialog extends rcube_plugin 'id' => 'newuserdialog', 'action' => $rcmail->url('plugin.newusersave'), 'method' => 'post'), - html::tag('h3', null, Q($this->gettext('identitydialogtitle'))) . - html::p('hint', Q($this->gettext('identitydialoghint'))) . + html::tag('h3', null, rcube::Q($this->gettext('identitydialogtitle'))) . + html::p('hint', rcube::Q($this->gettext('identitydialoghint'))) . $table->show() . html::p(array('class' => 'formbuttons'), html::tag('input', array('type' => 'submit', @@ -119,17 +119,17 @@ class new_user_dialog extends rcube_plugin $identities_level = intval($rcmail->config->get('identities_level', 0)); $save_data = array( - 'name' => get_input_value('_name', RCUBE_INPUT_POST), - 'email' => get_input_value('_email', RCUBE_INPUT_POST), - 'organization' => get_input_value('_organization', RCUBE_INPUT_POST), - 'signature' => get_input_value('_signature', RCUBE_INPUT_POST), + 'name' => rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST), + 'email' => rcube_utils::get_input_value('_email', rcube_utils::INPUT_POST), + 'organization' => rcube_utils::get_input_value('_organization', rcube_utils::INPUT_POST), + 'signature' => rcube_utils::get_input_value('_signature', rcube_utils::INPUT_POST), ); // don't let the user alter the e-mail address if disabled by config if ($identities_level == 1 || $identities_level == 3) $save_data['email'] = $identity['email']; else - $save_data['email'] = rcube_idn_to_ascii($save_data['email']); + $save_data['email'] = rcube_utils::idn_to_ascii($save_data['email']); // save data if not empty if (!empty($save_data['name']) && !empty($save_data['email'])) { diff --git a/plugins/new_user_identity/new_user_identity.php b/plugins/new_user_identity/new_user_identity.php index 200d9accd..f98145b6c 100644 --- a/plugins/new_user_identity/new_user_identity.php +++ b/plugins/new_user_identity/new_user_identity.php @@ -43,7 +43,7 @@ class new_user_identity extends rcube_plugin $args['user_name'] = $user_name; if (!$args['user_email'] && strpos($user_email, '@')) { - $args['user_email'] = rcube_idn_to_ascii($user_email); + $args['user_email'] = rcube_utils::idn_to_ascii($user_email); } } } diff --git a/plugins/newmail_notifier/newmail_notifier.php b/plugins/newmail_notifier/newmail_notifier.php index 942421166..a45eeaedb 100644 --- a/plugins/newmail_notifier/newmail_notifier.php +++ b/plugins/newmail_notifier/newmail_notifier.php @@ -93,7 +93,7 @@ class newmail_notifier extends rcube_plugin $this->gettext('test')); $args['blocks']['new_message']['options'][$key] = array( - 'title' => html::label($field_id, Q($this->gettext($type))), + 'title' => html::label($field_id, rcube::Q($this->gettext($type))), 'content' => $content ); } @@ -120,7 +120,7 @@ class newmail_notifier extends rcube_plugin foreach (array('basic', 'desktop', 'sound') as $type) { $key = 'newmail_notifier_' . $type; if (!in_array($key, $dont_override)) { - $args['prefs'][$key] = get_input_value('_'.$key, RCUBE_INPUT_POST) ? true : false; + $args['prefs'][$key] = rcube_utils::get_input_value('_'.$key, rcube_utils::INPUT_POST) ? true : false; } } diff --git a/plugins/password/drivers/chpasswd.php b/plugins/password/drivers/chpasswd.php index 3ea10159c..137275e69 100644 --- a/plugins/password/drivers/chpasswd.php +++ b/plugins/password/drivers/chpasswd.php @@ -26,7 +26,7 @@ class rcube_chpasswd_password return PASSWORD_SUCCESS; } else { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, diff --git a/plugins/password/drivers/dbmail.php b/plugins/password/drivers/dbmail.php index e4c0d52e3..529027b8d 100644 --- a/plugins/password/drivers/dbmail.php +++ b/plugins/password/drivers/dbmail.php @@ -29,7 +29,7 @@ class rcube_dbmail_password return PASSWORD_SUCCESS; } else { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, diff --git a/plugins/password/drivers/directadmin.php b/plugins/password/drivers/directadmin.php index fb156cea9..8bf0dc613 100644 --- a/plugins/password/drivers/directadmin.php +++ b/plugins/password/drivers/directadmin.php @@ -43,7 +43,7 @@ class rcube_directadmin_password $response = $Socket->fetch_parsed_body(); //DEBUG - //console("Password Plugin: [USER: $da_user] [HOST: $da_host] - Response: [SOCKET: ".$Socket->result_status_code."] [DA ERROR: ".strip_tags($response['error'])."] [TEXT: ".$response[text]."]"); + //rcube::console("Password Plugin: [USER: $da_user] [HOST: $da_host] - Response: [SOCKET: ".$Socket->result_status_code."] [DA ERROR: ".strip_tags($response['error'])."] [TEXT: ".$response[text]."]"); if($Socket->result_status_code != 200) return array('code' => PASSWORD_CONNECT_ERROR, 'message' => $Socket->error[0]); diff --git a/plugins/password/drivers/expect.php b/plugins/password/drivers/expect.php index 7a191e254..1f68924df 100644 --- a/plugins/password/drivers/expect.php +++ b/plugins/password/drivers/expect.php @@ -45,7 +45,7 @@ class rcube_expect_password return PASSWORD_SUCCESS; } else { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, diff --git a/plugins/password/drivers/hmail.php b/plugins/password/drivers/hmail.php index 104c851ae..a8f07a23b 100644 --- a/plugins/password/drivers/hmail.php +++ b/plugins/password/drivers/hmail.php @@ -26,8 +26,8 @@ class rcube_hmail_password $obApp = new COM("hMailServer.Application"); } catch (Exception $e) { - write_log('errors', "Plugin password (hmail driver): " . trim(strip_tags($e->getMessage()))); - write_log('errors', "Plugin password (hmail driver): This problem is often caused by DCOM permissions not being set."); + rcube::write_log('errors', "Plugin password (hmail driver): " . trim(strip_tags($e->getMessage()))); + rcube::write_log('errors', "Plugin password (hmail driver): This problem is often caused by DCOM permissions not being set."); return PASSWORD_ERROR; } @@ -39,8 +39,8 @@ class rcube_hmail_password else { $domain = $rcmail->config->get('username_domain',false); if (!$domain) { - write_log('errors','Plugin password (hmail driver): $rcmail_config[\'username_domain\'] is not defined.'); - write_log('errors','Plugin password (hmail driver): Hint: Use hmail_login plugin (http://myroundcube.googlecode.com'); + rcube::write_log('errors','Plugin password (hmail driver): $rcmail_config[\'username_domain\'] is not defined.'); + rcube::write_log('errors','Plugin password (hmail driver): Hint: Use hmail_login plugin (http://myroundcube.googlecode.com'); return PASSWORD_ERROR; } $username = $username . "@" . $domain; @@ -55,8 +55,8 @@ class rcube_hmail_password return PASSWORD_SUCCESS; } catch (Exception $e) { - write_log('errors', "Plugin password (hmail driver): " . trim(strip_tags($e->getMessage()))); - write_log('errors', "Plugin password (hmail driver): This problem is often caused by DCOM permissions not being set."); + rcube::write_log('errors', "Plugin password (hmail driver): " . trim(strip_tags($e->getMessage()))); + rcube::write_log('errors', "Plugin password (hmail driver): This problem is often caused by DCOM permissions not being set."); return PASSWORD_ERROR; } } diff --git a/plugins/password/drivers/ldap.php b/plugins/password/drivers/ldap.php index f773335ac..548d327e1 100644 --- a/plugins/password/drivers/ldap.php +++ b/plugins/password/drivers/ldap.php @@ -271,7 +271,7 @@ class rcube_ldap_password case 'samba': if (function_exists('hash')) { - $cryptedPassword = hash('md4', rcube_charset_convert($passwordClear, RCMAIL_CHARSET, 'UTF-16LE')); + $cryptedPassword = hash('md4', rcube_charset::convert($passwordClear, RCUBE_CHARSET, 'UTF-16LE')); $cryptedPassword = strtoupper($cryptedPassword); } else { /* Your PHP install does not have the hash() function */ diff --git a/plugins/password/drivers/ldap_simple.php b/plugins/password/drivers/ldap_simple.php index 01385f2d0..d47e14492 100644 --- a/plugins/password/drivers/ldap_simple.php +++ b/plugins/password/drivers/ldap_simple.php @@ -240,7 +240,7 @@ class rcube_ldap_simple_password break; case 'samba': if (function_exists('hash')) { - $crypted_password = hash('md4', rcube_charset_convert($password_clear, RCMAIL_CHARSET, 'UTF-16LE')); + $crypted_password = hash('md4', rcube_charset::convert($password_clear, RCUBE_CHARSET, 'UTF-16LE')); $crypted_password = strtoupper($crypted_password); } else { /* Your PHP install does not have the hash() function */ diff --git a/plugins/password/drivers/pam.php b/plugins/password/drivers/pam.php index 20524d9f1..8cd94c737 100644 --- a/plugins/password/drivers/pam.php +++ b/plugins/password/drivers/pam.php @@ -20,7 +20,7 @@ class rcube_pam_password } } else { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, @@ -29,7 +29,7 @@ class rcube_pam_password } } else { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, diff --git a/plugins/password/drivers/pw_usermod.php b/plugins/password/drivers/pw_usermod.php index 5b92fcbfb..237e275a7 100644 --- a/plugins/password/drivers/pw_usermod.php +++ b/plugins/password/drivers/pw_usermod.php @@ -28,7 +28,7 @@ class rcube_pw_usermod_password return PASSWORD_SUCCESS; } else { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, diff --git a/plugins/password/drivers/sasl.php b/plugins/password/drivers/sasl.php index 9380cf838..8776eff2e 100644 --- a/plugins/password/drivers/sasl.php +++ b/plugins/password/drivers/sasl.php @@ -32,7 +32,7 @@ class rcube_sasl_password return PASSWORD_SUCCESS; } else { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, diff --git a/plugins/password/drivers/smb.php b/plugins/password/drivers/smb.php index 88021156f..d56924eee 100644 --- a/plugins/password/drivers/smb.php +++ b/plugins/password/drivers/smb.php @@ -44,7 +44,7 @@ class rcube_smb_password return PASSWORD_SUCCESS; } else { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, diff --git a/plugins/password/drivers/sql.php b/plugins/password/drivers/sql.php index b08833dbf..e02bff146 100644 --- a/plugins/password/drivers/sql.php +++ b/plugins/password/drivers/sql.php @@ -117,7 +117,7 @@ class rcube_sql_password // hashed passwords if (preg_match('/%[n|q]/', $sql)) { if (!extension_loaded('hash')) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, @@ -164,14 +164,14 @@ class rcube_sql_password // convert domains to/from punnycode if ($rcmail->config->get('password_idn_ascii')) { - $domain_part = rcube_idn_to_ascii($domain_part); - $username = rcube_idn_to_ascii($username); - $host = rcube_idn_to_ascii($host); + $domain_part = rcube_utils::idn_to_ascii($domain_part); + $username = rcube_utils::idn_to_ascii($username); + $host = rcube_utils::idn_to_ascii($host); } else { - $domain_part = rcube_idn_to_utf8($domain_part); - $username = rcube_idn_to_utf8($username); - $host = rcube_idn_to_utf8($host); + $domain_part = rcube_utils::idn_to_utf8($domain_part); + $username = rcube_utils::idn_to_utf8($username); + $host = rcube_utils::idn_to_utf8($host); } // at least we should always have the local part diff --git a/plugins/password/drivers/virtualmin.php b/plugins/password/drivers/virtualmin.php index d2b765a9e..2c7aee617 100644 --- a/plugins/password/drivers/virtualmin.php +++ b/plugins/password/drivers/virtualmin.php @@ -67,7 +67,7 @@ class rcube_virtualmin_password return PASSWORD_SUCCESS; } else { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, diff --git a/plugins/password/drivers/xmail.php b/plugins/password/drivers/xmail.php index 33a49ffe3..37abc3001 100644 --- a/plugins/password/drivers/xmail.php +++ b/plugins/password/drivers/xmail.php @@ -32,7 +32,7 @@ class rcube_xmail_password $xmail->port = $rcmail->config->get('xmail_port'); if (!$xmail->connect()) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, @@ -42,7 +42,7 @@ class rcube_xmail_password } else if (!$xmail->send("userpasswd\t".$domain."\t".$user."\t".$newpass."\n")) { $xmail->close(); - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, diff --git a/plugins/password/password.php b/plugins/password/password.php index 806db0586..39020a0bf 100644 --- a/plugins/password/password.php +++ b/plugins/password/password.php @@ -112,22 +112,22 @@ class password extends rcube_plugin $rc_charset = strtoupper($rcmail->output->get_charset()); $sespwd = $rcmail->decrypt($_SESSION['password']); - $curpwd = $confirm ? get_input_value('_curpasswd', RCUBE_INPUT_POST, true, $charset) : $sespwd; - $newpwd = get_input_value('_newpasswd', RCUBE_INPUT_POST, true); - $conpwd = get_input_value('_confpasswd', RCUBE_INPUT_POST, true); + $curpwd = $confirm ? rcube_utils::get_input_value('_curpasswd', rcube_utils::INPUT_POST, true, $charset) : $sespwd; + $newpwd = rcube_utils::get_input_value('_newpasswd', rcube_utils::INPUT_POST, true); + $conpwd = rcube_utils::get_input_value('_confpasswd', rcube_utils::INPUT_POST, true); // check allowed characters according to the configured 'password_charset' option // by converting the password entered by the user to this charset and back to UTF-8 $orig_pwd = $newpwd; - $chk_pwd = rcube_charset_convert($orig_pwd, $rc_charset, $charset); - $chk_pwd = rcube_charset_convert($chk_pwd, $charset, $rc_charset); + $chk_pwd = rcube_charset::convert($orig_pwd, $rc_charset, $charset); + $chk_pwd = rcube_charset::convert($chk_pwd, $charset, $rc_charset); // WARNING: Default password_charset is ISO-8859-1, so conversion will // change national characters. This may disable possibility of using // the same password in other MUA's. // We're doing this for consistence with Roundcube core - $newpwd = rcube_charset_convert($newpwd, $rc_charset, $charset); - $conpwd = rcube_charset_convert($conpwd, $rc_charset, $charset); + $newpwd = rcube_charset::convert($newpwd, $rc_charset, $charset); + $conpwd = rcube_charset::convert($conpwd, $rc_charset, $charset); if ($chk_pwd != $orig_pwd) { $rcmail->output->command('display_message', $this->gettext('passwordforbidden'), 'error'); @@ -141,7 +141,7 @@ class password extends rcube_plugin } else if ($required_length && strlen($newpwd) < $required_length) { $rcmail->output->command('display_message', $this->gettext( - array('name' => 'passwordshort', 'vars' => array('length' => $required_length))), 'error'); + array('name' => 'passwordshort', 'vars' => array('length' => $required_length))), 'error'); } else if ($check_strength && (!preg_match("/[0-9]/", $newpwd) || !preg_match("/[^A-Za-z0-9]/", $newpwd))) { $rcmail->output->command('display_message', $this->gettext('passwordweak'), 'error'); @@ -163,8 +163,8 @@ class password extends rcube_plugin // Log password change if ($rcmail->config->get('password_log')) { - write_log('password', sprintf('Password changed for user %s (ID: %d) from %s', - $rcmail->get_user_name(), $rcmail->user->ID, rcmail_remote_ip())); + rcube::write_log('password', sprintf('Password changed for user %s (ID: %d) from %s', + $rcmail->get_user_name(), $rcmail->user->ID, rcube_utils::remote_ip())); } } else { @@ -172,7 +172,7 @@ class password extends rcube_plugin } } - rcmail_overwrite_action('plugin.password'); + $rcmail->overwrite_action('plugin.password'); $rcmail->output->send('plugin'); } @@ -197,7 +197,7 @@ class password extends rcube_plugin $input_curpasswd = new html_passwordfield(array('name' => '_curpasswd', 'id' => $field_id, 'size' => 20, 'autocomplete' => 'off')); - $table->add('title', html::label($field_id, Q($this->gettext('curpasswd')))); + $table->add('title', html::label($field_id, rcube::Q($this->gettext('curpasswd')))); $table->add(null, $input_curpasswd->show()); } @@ -206,7 +206,7 @@ class password extends rcube_plugin $input_newpasswd = new html_passwordfield(array('name' => '_newpasswd', 'id' => $field_id, 'size' => 20, 'autocomplete' => 'off')); - $table->add('title', html::label($field_id, Q($this->gettext('newpasswd')))); + $table->add('title', html::label($field_id, rcube::Q($this->gettext('newpasswd')))); $table->add(null, $input_newpasswd->show()); // show confirm password selection @@ -214,7 +214,7 @@ class password extends rcube_plugin $input_confpasswd = new html_passwordfield(array('name' => '_confpasswd', 'id' => $field_id, 'size' => 20, 'autocomplete' => 'off')); - $table->add('title', html::label($field_id, Q($this->gettext('confpasswd')))); + $table->add('title', html::label($field_id, rcube::Q($this->gettext('confpasswd')))); $table->add(null, $input_confpasswd->show()); $out = html::div(array('class' => 'box'), @@ -246,7 +246,7 @@ class password extends rcube_plugin $file = $this->home . "/drivers/$driver.php"; if (!file_exists($file)) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, @@ -258,7 +258,7 @@ class password extends rcube_plugin include_once $file; if (!class_exists($class, false) || !method_exists($class, 'save')) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, diff --git a/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php b/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php index 7849f915e..d5d0d47ec 100644 --- a/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php +++ b/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php @@ -73,8 +73,8 @@ class squirrelmail_usercopy extends rcube_plugin foreach ($this->abook as $rec) { // #1487096 handle multi-address and/or too long items $rec['email'] = array_shift(explode(';', $rec['email'])); - if (check_email(rcube_idn_to_ascii($rec['email']))) { - $rec['email'] = rcube_idn_to_utf8($rec['email']); + if (rcube_utils::check_email(rcube_utils::idn_to_ascii($rec['email']))) { + $rec['email'] = rcube_utils::idn_to_utf8($rec['email']); $contacts->insert($rec, true); } } @@ -167,7 +167,7 @@ class squirrelmail_usercopy extends rcube_plugin $sql_result = $db->query('SELECT * FROM '.$userprefs_table.' WHERE user=?', $uname); // ? is replaced with emailaddress while ($sql_array = $db->fetch_assoc($sql_result) ) { // fetch one row from result - $this->prefs[$sql_array['prefkey']] = rcube_charset_convert(rtrim($sql_array['prefval']), $db_charset); + $this->prefs[$sql_array['prefkey']] = rcube_charset::convert(rtrim($sql_array['prefval']), $db_charset); } /* retrieve address table data */ @@ -175,11 +175,11 @@ class squirrelmail_usercopy extends rcube_plugin // parse addres book while ($sql_array = $db->fetch_assoc($sql_result) ) { // fetch one row from result - $rec['name'] = rcube_charset_convert(rtrim($sql_array['nickname']), $db_charset); - $rec['firstname'] = rcube_charset_convert(rtrim($sql_array['firstname']), $db_charset); - $rec['surname'] = rcube_charset_convert(rtrim($sql_array['lastname']), $db_charset); - $rec['email'] = rcube_charset_convert(rtrim($sql_array['email']), $db_charset); - $rec['notes'] = rcube_charset_convert(rtrim($sql_array['label']), $db_charset); + $rec['name'] = rcube_charset::convert(rtrim($sql_array['nickname']), $db_charset); + $rec['firstname'] = rcube_charset::convert(rtrim($sql_array['firstname']), $db_charset); + $rec['surname'] = rcube_charset::convert(rtrim($sql_array['lastname']), $db_charset); + $rec['email'] = rcube_charset::convert(rtrim($sql_array['email']), $db_charset); + $rec['notes'] = rcube_charset::convert(rtrim($sql_array['label']), $db_charset); if ($rec['name'] && $rec['email']) $this->abook[] = $rec; diff --git a/plugins/subscriptions_option/subscriptions_option.php b/plugins/subscriptions_option/subscriptions_option.php index b81a5ac8a..7678d8e94 100644 --- a/plugins/subscriptions_option/subscriptions_option.php +++ b/plugins/subscriptions_option/subscriptions_option.php @@ -46,7 +46,7 @@ class subscriptions_option extends rcube_plugin $checkbox = new html_checkbox(array('name' => '_use_subscriptions', 'id' => $field_id, 'value' => 1)); $args['blocks']['main']['options']['use_subscriptions'] = array( - 'title' => html::label($field_id, Q($this->gettext('useimapsubscriptions'))), + 'title' => html::label($field_id, rcube::Q($this->gettext('useimapsubscriptions'))), 'content' => $checkbox->show($use_subscriptions?1:0), ); } diff --git a/plugins/userinfo/userinfo.php b/plugins/userinfo/userinfo.php index efb65f51d..a175563ef 100644 --- a/plugins/userinfo/userinfo.php +++ b/plugins/userinfo/userinfo.php @@ -31,25 +31,25 @@ class userinfo extends rcube_plugin $table = new html_table(array('cols' => 2, 'cellpadding' => 3)); $table->add('title', 'ID'); - $table->add('', Q($user->ID)); + $table->add('', rcube::Q($user->ID)); - $table->add('title', Q($this->gettext('username'))); - $table->add('', Q($user->data['username'])); + $table->add('title', rcube::Q($this->gettext('username'))); + $table->add('', rcube::Q($user->data['username'])); - $table->add('title', Q($this->gettext('server'))); - $table->add('', Q($user->data['mail_host'])); + $table->add('title', rcube::Q($this->gettext('server'))); + $table->add('', rcube::Q($user->data['mail_host'])); - $table->add('title', Q($this->gettext('created'))); - $table->add('', Q($user->data['created'])); + $table->add('title', rcube::Q($this->gettext('created'))); + $table->add('', rcube::Q($user->data['created'])); - $table->add('title', Q($this->gettext('lastlogin'))); - $table->add('', Q($user->data['last_login'])); + $table->add('title', rcube::Q($this->gettext('lastlogin'))); + $table->add('', rcube::Q($user->data['last_login'])); $identity = $user->get_identity(); - $table->add('title', Q($this->gettext('defaultidentity'))); - $table->add('', Q($identity['name'] . ' <' . $identity['email'] . '>')); + $table->add('title', rcube::Q($this->gettext('defaultidentity'))); + $table->add('', rcube::Q($identity['name'] . ' <' . $identity['email'] . '>')); - return html::tag('h4', null, Q('Infos for ' . $user->get_username())) . $table->show(); + return html::tag('h4', null, rcube::Q('Infos for ' . $user->get_username())) . $table->show(); } } diff --git a/plugins/vcard_attachments/vcard_attachments.php b/plugins/vcard_attachments/vcard_attachments.php index e7f7d5f1f..4905b373e 100644 --- a/plugins/vcard_attachments/vcard_attachments.php +++ b/plugins/vcard_attachments/vcard_attachments.php @@ -90,10 +90,10 @@ class vcard_attachments extends rcube_plugin $p['content'] .= html::p(array('class' => 'vcardattachment'), html::a(array( 'href' => "#", - 'onclick' => "return plugin_vcard_save_contact('" . JQ($part.':'.$idx) . "')", + 'onclick' => "return plugin_vcard_save_contact('" . rcube::JQ($part.':'.$idx) . "')", 'title' => $this->gettext('addvcardmsg'), ), - html::span(null, Q($display))) + html::span(null, rcube::Q($display))) ); } @@ -115,9 +115,9 @@ class vcard_attachments extends rcube_plugin { $this->add_texts('localization', true); - $uid = get_input_value('_uid', RCUBE_INPUT_POST); - $mbox = get_input_value('_mbox', RCUBE_INPUT_POST); - $mime_id = get_input_value('_part', RCUBE_INPUT_POST); + $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); $rcmail = rcmail::get_instance(); $storage = $rcmail->get_storage(); @@ -144,7 +144,7 @@ class vcard_attachments extends rcube_plugin } else { // We're using UTF8 internally - $email = rcube_idn_to_utf8($email); + $email = rcube_utils::idn_to_utf8($email); // compare e-mail address $existing = $CONTACTS->search('email', $email, 1, false); diff --git a/plugins/virtuser_file/virtuser_file.php b/plugins/virtuser_file/virtuser_file.php index 01032616c..2c705b2d0 100644 --- a/plugins/virtuser_file/virtuser_file.php +++ b/plugins/virtuser_file/virtuser_file.php @@ -41,7 +41,7 @@ class virtuser_file extends rcube_plugin $arr = preg_split('/\s+/', $r[$i]); if (count($arr) > 0 && strpos($arr[0], '@')) { - $result[] = rcube_idn_to_ascii(trim(str_replace('\\@', '@', $arr[0]))); + $result[] = rcube_utils::idn_to_ascii(trim(str_replace('\\@', '@', $arr[0]))); if ($p['first']) { $p['email'] = $result[0]; diff --git a/plugins/virtuser_query/virtuser_query.php b/plugins/virtuser_query/virtuser_query.php index 073b4e230..c479a4f7f 100644 --- a/plugins/virtuser_query/virtuser_query.php +++ b/plugins/virtuser_query/virtuser_query.php @@ -28,8 +28,8 @@ class virtuser_query extends rcube_plugin function init() { - $this->app = rcmail::get_instance(); - $this->config = $this->app->config->get('virtuser_query'); + $this->app = rcmail::get_instance(); + $this->config = $this->app->config->get('virtuser_query'); if (!empty($this->config)) { if (is_string($this->config)) { @@ -53,35 +53,35 @@ class virtuser_query extends rcube_plugin */ function user2email($p) { - $dbh = $this->app->get_dbh(); - - $sql_result = $dbh->query(preg_replace('/%u/', $dbh->escapeSimple($p['user']), $this->config['email'])); - - while ($sql_arr = $dbh->fetch_array($sql_result)) { - if (strpos($sql_arr[0], '@')) { - if ($p['extended'] && count($sql_arr) > 1) { - $result[] = array( - 'email' => rcube_idn_to_ascii($sql_arr[0]), - 'name' => $sql_arr[1], - 'organization' => $sql_arr[2], - 'reply-to' => rcube_idn_to_ascii($sql_arr[3]), - 'bcc' => rcube_idn_to_ascii($sql_arr[4]), - 'signature' => $sql_arr[5], - 'html_signature' => (int)$sql_arr[6], - ); - } - else { - $result[] = $sql_arr[0]; - } - - if ($p['first']) - break; - } - } - - $p['email'] = $result; - - return $p; + $dbh = $this->app->get_dbh(); + + $sql_result = $dbh->query(preg_replace('/%u/', $dbh->escapeSimple($p['user']), $this->config['email'])); + + while ($sql_arr = $dbh->fetch_array($sql_result)) { + if (strpos($sql_arr[0], '@')) { + if ($p['extended'] && count($sql_arr) > 1) { + $result[] = array( + 'email' => rcube_utils::idn_to_ascii($sql_arr[0]), + 'name' => $sql_arr[1], + 'organization' => $sql_arr[2], + 'reply-to' => rcube_utils::idn_to_ascii($sql_arr[3]), + 'bcc' => rcube_utils::idn_to_ascii($sql_arr[4]), + 'signature' => $sql_arr[5], + 'html_signature' => (int)$sql_arr[6], + ); + } + else { + $result[] = $sql_arr[0]; + } + + if ($p['first']) + break; + } + } + + $p['email'] = $result; + + return $p; } /** diff --git a/plugins/zipdownload/zipdownload.php b/plugins/zipdownload/zipdownload.php index 8bad9b341..96c76eec9 100644 --- a/plugins/zipdownload/zipdownload.php +++ b/plugins/zipdownload/zipdownload.php @@ -30,7 +30,7 @@ class zipdownload extends rcube_plugin } $rcmail = rcmail::get_instance(); - $this->charset = $rcmail->config->get('zipdownload_charset', RCMAIL_CHARSET); + $this->charset = $rcmail->config->get('zipdownload_charset', RCUBE_CHARSET); $this->load_config(); $this->add_texts('localization'); @@ -62,11 +62,14 @@ class zipdownload extends rcube_plugin // only show the link if there is more than the configured number of attachments if (substr_count($p['content'], '<li') > $rcmail->config->get('zipdownload_attachments', 1)) { - $link = html::a(array( - 'href' => rcmail_url('plugin.zipdownload.zip_attachments', array('_mbox' => $rcmail->output->env['mailbox'], '_uid' => $rcmail->output->env['uid'])), - 'class' => 'button zipdownload', - ), - Q($this->gettext('downloadall')) + $href = $rcmail->url(array( + '_action' => 'plugin.zipdownload.zip_attachments', + '_mbox' => $rcmail->output->env['mailbox'], + '_uid' => $rcmail->output->env['uid'], + )); + + $link = html::a(array('href' => $href, 'class' => 'button zipdownload'), + rcube::Q($this->gettext('downloadall')) ); // append link to attachments list, slightly different in some skins @@ -96,7 +99,7 @@ class zipdownload extends rcube_plugin $temp_dir = $rcmail->config->get('temp_dir'); $tmpfname = tempnam($temp_dir, 'zipdownload'); $tempfiles = array($tmpfname); - $message = new rcube_message(get_input_value('_uid', RCUBE_INPUT_GET)); + $message = new rcube_message(rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GET)); // open zip file $zip = new ZipArchive(); @@ -140,7 +143,7 @@ class zipdownload extends rcube_plugin public function download_selection() { if (isset($_REQUEST['_uid'])) { - $uids = explode(",", get_input_value('_uid', RCUBE_INPUT_GPC)); + $uids = explode(",", rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GPC)); if (sizeof($uids) > 0) $this->_download_messages($uids); @@ -157,7 +160,7 @@ class zipdownload extends rcube_plugin // initialize searching result if search_filter is used if ($_SESSION['search_filter'] && $_SESSION['search_filter'] != 'ALL') { - $imap->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET); + $imap->search($mbox_name, $_SESSION['search_filter'], RCUBE_CHARSET); } // fetch message headers for all pages @@ -234,7 +237,9 @@ class zipdownload extends rcube_plugin private function _deliver_zipfile($tmpfname, $filename) { $browser = new rcube_browser; - send_nocacheing_headers(); + $rcmail = rcmail::get_instance(); + + $rcmail->output->nocacheing_headers(); if ($browser->ie && $browser->ver < 7) $filename = rawurlencode(abbreviate_string($filename, 55)); @@ -258,9 +263,9 @@ class zipdownload extends rcube_plugin /** * Helper function to convert filenames to the configured charset */ - private function _convert_filename($str, $from = RCMAIL_CHARSET) + private function _convert_filename($str, $from = RCUBE_CHARSET) { - return strtr(rcube_charset_convert($str, $from, $this->charset), array(':'=>'', '/'=>'-')); + return strtr(rcube_charset::convert($str, $from, $this->charset), array(':'=>'', '/'=>'-')); } } diff --git a/program/include/rcmail.php b/program/include/rcmail.php index c734216ac..5f2a2177b 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -1692,7 +1692,7 @@ class rcmail extends rcube $count = count($path); if ($count > 1) { - for ($i = 1; $i < $count; $i++) { + for ($i = 0; $i < $count; $i++) { $folder = implode($delimiter, array_slice($path, 0, -$i)); if ($folder_class = $this->folder_classname($folder)) { $name = implode($delimiter, array_slice($path, $count - $i)); |