本文整理汇总了PHP中rcube_utils::get_input_value方法的典型用法代码示例。如果您正苦于以下问题:PHP rcube_utils::get_input_value方法的具体用法?PHP rcube_utils::get_input_value怎么用?PHP rcube_utils::get_input_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rcube_utils
的用法示例。
在下文中一共展示了rcube_utils::get_input_value方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save_prefs
function save_prefs($args)
{
if ($args['section'] == 'mailview') {
$args['prefs']['hide_blockquote_limit'] = (int) rcube_utils::get_input_value('_hide_blockquote_limit', rcube_utils::INPUT_POST);
}
return $args;
}
示例2: save_data
/**
* Handler for submitted form (ajax request)
*
* Check fields and save to default identity if valid.
* Afterwards the session flag is removed and we're done.
*/
function save_data()
{
$rcmail = rcmail::get_instance();
$identity = $rcmail->user->get_identity();
$ident_level = intval($rcmail->config->get('identities_level', 0));
$disabled = array();
$save_data = array('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));
if ($ident_level == 4) {
$disabled = array('name', 'email', 'organization');
} else {
if (in_array($ident_level, array(1, 3))) {
$disabled = array('email');
}
}
foreach ($disabled as $key) {
$save_data[$key] = $identity[$key];
}
if (empty($save_data['name']) || empty($save_data['email'])) {
$rcmail->output->show_message('formincomplete', 'error');
} else {
if (!rcube_utils::check_email($save_data['email'] = rcube_utils::idn_to_ascii($save_data['email']))) {
$rcmail->output->show_message('emailformaterror', 'error', array('email' => $save_data['email']));
} else {
// save data
$rcmail->user->update_identity($identity['identity_id'], $save_data);
$rcmail->session->remove('plugin.newuserdialog');
// hide dialog
$rcmail->output->command('new_user_dialog_close');
$rcmail->output->show_message('successfullysaved', 'confirmation');
}
}
$rcmail->output->send();
}
示例3: ham
public function ham(&$uids)
{
$rcmail = rcube::get_instance();
$storage = $rcmail->storage;
$mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST);
$new_uids = array();
foreach (explode(",", $uids) as $uid) {
$saved = false;
$message = new rcube_message($uid);
if (sizeof($message->attachments) > 0) {
foreach ($message->attachments as $part) {
if ($part->ctype_primary == 'message' && $part->ctype_secondary == 'rfc822') {
$orig_message_raw = $storage->get_message_part($message->uid, $part->mime_id, $part);
$saved = $storage->save_message($mbox, $orig_message_raw);
if ($saved !== false) {
$rcmail->output->command('rcmail_markasjunk2_move', null, $uid);
array_push($new_uids, $saved);
}
}
}
}
}
if (sizeof($new_uids) > 0) {
$uids = implode(',', $new_uids);
}
}
示例4: authenticate
function authenticate($args)
{
if (isset($_POST['_user']) && isset($_POST['_pass'])) {
$args['host'] = $this->getHost(rcube_utils::get_input_value('_user', RCUBE_INPUT_POST));
}
return $args;
}
示例5: save_settings
function save_settings($args)
{
if ($args['section'] == 'mailbox') {
$args['prefs']['preview_pane'] = rcube_utils::get_input_value('_previewpane_layout', rcube_utils::INPUT_POST) == 'none' ? false : true;
$args['prefs']['previewpane_layout'] = rcube_utils::get_input_value('_previewpane_layout', rcube_utils::INPUT_POST) != 'none' ? rcube_utils::get_input_value('_previewpane_layout', rcube_utils::INPUT_POST) : rcube::get_instance()->config->get('previewpane_layout', 'below');
}
return $args;
}
示例6: messagecount
public function messagecount()
{
$storage = rcube::get_instance()->storage;
$mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST);
// send output
header("Content-Type: application/json; charset=" . RCUBE_CHARSET);
echo json_encode(array('messagecount' => $storage->count($mbox, 'EXISTS')));
exit;
}
示例7: mark_notjunk
function mark_notjunk()
{
$this->add_texts('localization');
$this->_set_flags();
$uids = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST);
$mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST);
if ($this->_ham($uids, $mbox, $this->ham_mbox)) {
$this->api->output->command('display_message', $this->gettext('reportedasnotjunk'), 'confirmation');
}
$this->api->output->send();
}
示例8: request_action
function request_action()
{
$this->add_texts('localization');
$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();
$storage = $rcmail->get_storage();
$storage->unset_flag($uids, 'NONJUNK');
$storage->set_flag($uids, 'JUNK');
if (($junk_mbox = $rcmail->config->get('junk_mbox')) && $mbox != $junk_mbox) {
$rcmail->output->command('move_messages', $junk_mbox);
}
$rcmail->output->command('display_message', $this->gettext('reportedasjunk'), 'confirmation');
$rcmail->output->send();
}
示例9: readfolder
public function readfolder()
{
$storage = rcube::get_instance()->storage;
$cbox = rcube_utils::get_input_value('_cur', rcube_utils::INPUT_POST);
$mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST);
$oact = rcube_utils::get_input_value('_oact', rcube_utils::INPUT_POST);
$uids = $storage->search_once($mbox, 'ALL UNSEEN', true);
if ($uids->is_empty()) {
return false;
}
$storage->set_flag($uids->get(), 'SEEN', $mbox);
if ($cbox == $mbox) {
$this->api->output->command('toggle_read_status', 'read', $uids->get());
}
rcmail_send_unread_count($mbox, true);
$this->api->output->send();
}
示例10: mark_message
function mark_message()
{
$this->add_texts('localization');
$is_spam = rcube::get_instance()->action == 'plugin.markasjunk2.junk' ? true : false;
$multi_folder = $_POST['_multifolder'] == 'true' ? true : false;
$messageset = rcmail::get_uids();
$mbox_name = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST);
$dest_mbox = $is_spam ? $this->spam_mbox : $this->ham_mbox;
$result = $is_spam ? $this->_spam($messageset, $dest_mbox) : $this->_ham($messageset, $dest_mbox);
if ($result) {
if ($dest_mbox && ($mbox_name !== $dest_mbox || $multi_folder)) {
$this->api->output->command('rcmail_markasjunk2_move', $dest_mbox, $this->_messageset_to_uids($messageset, $multi_folder));
} else {
$this->api->output->command('command', 'list', $mbox_name);
}
$this->api->output->command('display_message', $is_spam ? $this->gettext('reportedasjunk') : $this->gettext('reportedasnotjunk'), 'confirmation');
}
$this->api->output->send();
}
示例11: save
function save()
{
$enabled = rcube_utils::get_input_value('_autoreplyenabled', RCUBE_INPUT_POST);
$body = rcube_utils::get_input_value('_autoreplybody', RCUBE_INPUT_POST);
$subject = rcube_utils::get_input_value('_autoreplysubject', RCUBE_INPUT_POST);
$startdate = rcube_utils::get_input_value('_autoreplystarton', RCUBE_INPUT_POST);
$enddate = rcube_utils::get_input_value('_autoreplyendby', RCUBE_INPUT_POST);
$server_tz = new DateTimeZone(date_default_timezone_get());
$server_offset = $server_tz->getOffset(new DateTime());
$user_tz = new DateTimeZone($this->rcmail_inst->config->get('timezone'));
$user_offset = $user_tz->getOffset(new DateTime());
$startdate = strtotime($startdate) - ($user_offset - $server_offset);
$enddate = strtotime($enddate) - ($user_offset - $server_offset);
if ($enddate < $startdate) {
$enddate = $startdate + 86400;
}
$startdate = array('year' => date("Y", $startdate), 'month' => date("m", $startdate), 'day' => date("d", $startdate), 'hour' => date("H", $startdate), 'minute' => date("i", $startdate));
$enddate = array('year' => date("Y", $enddate), 'month' => date("m", $enddate), 'day' => date("d", $enddate), 'hour' => date("H", $enddate), 'minute' => date("i", $enddate));
if (!$enabled) {
$enabled = 'n';
} else {
$enabled = 'y';
}
try {
$session_id = $this->soap->login($this->rcmail_inst->config->get('remote_soap_user'), $this->rcmail_inst->config->get('remote_soap_pass'));
$mail_user = $this->soap->mail_user_get($session_id, array('login' => $this->rcmail_inst->user->data['username']));
$uid = $this->soap->client_get_id($session_id, $mail_user[0]['sys_userid']);
$params = $mail_user[0];
unset($params['password']);
$params['autoresponder'] = $enabled;
$params['autoresponder_text'] = $body;
$params['autoresponder_subject'] = $subject;
$params['autoresponder_start_date'] = $startdate;
$params['autoresponder_end_date'] = $enddate;
$update = $this->soap->mail_user_update($session_id, $uid, $mail_user[0]['mailuser_id'], $params);
$this->soap->logout($session_id);
$this->rcmail_inst->output->command('display_message', $this->gettext('successfullysaved'), 'confirmation');
} catch (SoapFault $e) {
$this->rcmail_inst->output->command('display_message', 'Soap Error: ' . $e->getMessage(), 'error');
}
$this->init_html();
}
示例12: init
/**
* Plugin initialization.
*/
function init()
{
$rcmail = rcmail::get_instance();
$this->rc = $rcmail;
$section = rcube_utils::get_input_value('_section', rcube_utils::INPUT_GET);
if ($this->rc->task == 'mail') {
// message parse/display hooks
$this->add_hook('message_part_structure', array($this, 'parse_structure'));
$this->add_hook('message_body_prefix', array($this, 'status_message'));
// message displaying
if ($rcmail->action == 'show' || $rcmail->action == 'preview') {
$this->add_hook('message_load', array($this, 'message_load'));
$this->add_hook('template_object_messagebody', array($this, 'message_output'));
$this->register_action('plugin.enigmaimport', array($this, 'import_file'));
} else {
if ($rcmail->action == 'compose') {
$this->load_ui();
$this->ui->init($section);
} else {
if ($rcmail->action == 'sendmail') {
//$this->add_hook('outgoing_message_body', array($this, 'msg_encode'));
//$this->add_hook('outgoing_message_body', array($this, 'msg_sign'));
}
}
}
} else {
if ($this->rc->task == 'settings') {
// add hooks for Enigma settings
$this->add_hook('preferences_sections_list', array($this, 'preferences_section'));
$this->add_hook('preferences_list', array($this, 'preferences_list'));
$this->add_hook('preferences_save', array($this, 'preferences_save'));
// register handler for keys/certs management
$this->register_action('plugin.enigma', array($this, 'preferences_ui'));
// grab keys/certs management iframe requests
if ($this->rc->action == 'edit-prefs' && preg_match('/^enigma(certs|keys)/', $section)) {
$this->load_ui();
$this->ui->init($section);
}
}
}
}
示例13: _edit_headers
private function _edit_headers(&$uids, $spam)
{
$rcmail = rcube::get_instance();
$args = $spam ? $rcmail->config->get('markasjunk2_spam_patterns') : $rcmail->config->get('markasjunk2_ham_patterns');
if (sizeof($args['patterns']) == 0) {
return;
}
$mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST);
$new_uids = array();
foreach (explode(",", $uids) as $uid) {
$raw_message = $rcmail->storage->get_raw_body($uid);
$raw_headers = $rcmail->storage->get_raw_headers($uid);
$updated_headers = preg_replace($args['patterns'], $args['replacements'], $raw_headers);
$raw_message = str_replace($raw_headers, $updated_headers, $raw_message);
$saved = $rcmail->storage->save_message($mbox, $raw_message);
if ($saved !== false) {
$rcmail->output->command('rcmail_markasjunk2_move', null, $uid);
array_push($new_uids, $saved);
}
}
if (sizeof($new_uids) > 0) {
$uids = implode(',', $new_uids);
}
}
示例14: login_form
/**
* GUI object 'loginform'
* Returns code for the webmail login form
*
* @param array Named parameters
* @return string HTML code for the gui object
*/
protected function login_form($attrib)
{
$default_host = $this->config->get('default_host');
$autocomplete = (int) $this->config->get('login_autocomplete');
$_SESSION['temp'] = true;
// save original url
$url = rcube_utils::get_input_value('_url', rcube_utils::INPUT_POST);
if (empty($url) && !preg_match('/_(task|action)=logout/', $_SERVER['QUERY_STRING'])) {
$url = $_SERVER['QUERY_STRING'];
}
// Disable autocapitalization on iPad/iPhone (#1488609)
$attrib['autocapitalize'] = 'off';
// set atocomplete attribute
$user_attrib = $autocomplete > 0 ? array() : array('autocomplete' => 'off');
$host_attrib = $autocomplete > 0 ? array() : array('autocomplete' => 'off');
$pass_attrib = $autocomplete > 1 ? array() : array('autocomplete' => 'off');
$input_task = new html_hiddenfield(array('name' => '_task', 'value' => 'login'));
$input_action = new html_hiddenfield(array('name' => '_action', 'value' => 'login'));
$input_tzone = new html_hiddenfield(array('name' => '_timezone', 'id' => 'rcmlogintz', 'value' => '_default_'));
$input_url = new html_hiddenfield(array('name' => '_url', 'id' => 'rcmloginurl', 'value' => $url));
$input_user = new html_inputfield(array('name' => '_user', 'id' => 'rcmloginuser', 'required' => 'required') + $attrib + $user_attrib);
$input_pass = new html_passwordfield(array('name' => '_pass', 'id' => 'rcmloginpwd', 'required' => 'required') + $attrib + $pass_attrib);
$input_host = null;
if (is_array($default_host) && count($default_host) > 1) {
$input_host = new html_select(array('name' => '_host', 'id' => 'rcmloginhost'));
foreach ($default_host as $key => $value) {
if (!is_array($value)) {
$input_host->add($value, is_numeric($key) ? $value : $key);
} else {
$input_host = null;
break;
}
}
} else {
if (is_array($default_host) && ($host = key($default_host)) !== null) {
$hide_host = true;
$input_host = new html_hiddenfield(array('name' => '_host', 'id' => 'rcmloginhost', 'value' => is_numeric($host) ? $default_host[$host] : $host) + $attrib);
} else {
if (empty($default_host)) {
$input_host = new html_inputfield(array('name' => '_host', 'id' => 'rcmloginhost') + $attrib + $host_attrib);
}
}
}
$form_name = !empty($attrib['form']) ? $attrib['form'] : 'form';
$this->add_gui_object('loginform', $form_name);
// create HTML table with two cols
$table = new html_table(array('cols' => 2));
$table->add('title', html::label('rcmloginuser', html::quote($this->app->gettext('username'))));
$table->add('input', $input_user->show('mail@box'));
$table->add('title', html::label('rcmloginpwd', html::quote($this->app->gettext('password'))));
$table->add('input', $input_pass->show());
// add host selection row
if (is_object($input_host) && !$hide_host) {
$table->add('title', html::label('rcmloginhost', html::quote($this->app->gettext('server'))));
$table->add('input', $input_host->show(rcube_utils::get_input_value('_host', rcube_utils::INPUT_GPC)));
}
$out = $input_task->show();
$out .= $input_action->show();
$out .= $input_tzone->show();
$out .= $input_url->show();
$out .= $table->show();
if ($hide_host) {
$out .= $input_host->show();
}
if (rcube_utils::get_boolean($attrib['submit'])) {
$submit = new html_inputfield(array('type' => 'submit', 'id' => 'rcmloginsubmit', 'class' => 'button mainaction', 'value' => $this->app->gettext('login')));
$out .= html::p('formbuttons', $submit->show());
}
// surround html output with a form tag
if (empty($attrib['form'])) {
$out = $this->form_tag(array('name' => $form_name, 'method' => 'post'), $out);
}
// include script for timezone detection
$this->include_script('jstz.min.js');
return $out;
}
示例15: password_handler
/**
* Registers password for specified key/cert sent by the password prompt.
*/
function password_handler()
{
$keyid = rcube_utils::get_input_value('_keyid', rcube_utils::INPUT_POST);
$passwd = rcube_utils::get_input_value('_passwd', rcube_utils::INPUT_POST, true);
if ($keyid && $passwd !== null && strlen($passwd)) {
$this->save_password($keyid, $passwd);
}
}