本文整理汇总了PHP中rcube_utils类的典型用法代码示例。如果您正苦于以下问题:PHP rcube_utils类的具体用法?PHP rcube_utils怎么用?PHP rcube_utils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了rcube_utils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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);
}
}
开发者ID:svenjantzen,项目名称:plugins,代码行数:26,代码来源:sa_detach.php
示例2: lookup_user_name
function lookup_user_name($args)
{
if ($this->init_ldap($args['host'])) {
$results = $this->ldap->search('*', $args['user'], true);
if (count($results->records) == 1) {
$user_name = is_array($results->records[0]['name']) ? $results->records[0]['name'][0] : $results->records[0]['name'];
$user_email = is_array($results->records[0]['email']) ? $results->records[0]['email'][0] : $results->records[0]['email'];
$args['user_name'] = $user_name;
$args['email_list'] = array();
if (!$args['user_email'] && strpos($user_email, '@')) {
$args['user_email'] = rcube_utils::idn_to_ascii($user_email);
}
foreach (array_keys($results[0]) as $key) {
if (!preg_match('/^email($|:)/', $key)) {
continue;
}
foreach ((array) $results->records[0][$key] as $alias) {
if (strpos($alias, '@')) {
$args['email_list'][] = rcube_utils::idn_to_ascii($alias);
}
}
}
}
}
return $args;
}
开发者ID:jimjag,项目名称:roundcubemail,代码行数:26,代码来源:new_user_identity.php
示例3: 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;
}
开发者ID:rickygestalt,项目名称:ispconfig3_roundcube,代码行数:7,代码来源:ispconfig3_autoselect.php
示例4: 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;
}
开发者ID:jimjag,项目名称:roundcubemail,代码行数:7,代码来源:hide_blockquote.php
示例5: import
/**
*
*/
public function import($csv)
{
// convert to UTF-8
$head = substr($csv, 0, 4096);
$fallback = rcube::get_instance()->config->get('default_charset', 'ISO-8859-1');
// fallback to Latin-1?
$charset = rcube_charset::detect($head, RCMAIL_CHARSET);
$csv = rcube_charset::convert($csv, $charset);
$head = '';
$this->map = array();
// Parse file
foreach (preg_split("/[\r\n]+/", $csv) as $i => $line) {
$line = trim($line);
if (empty($line)) {
continue;
}
$elements = rcube_utils::explode_quoted_string(',', $line);
if (empty($elements)) {
continue;
}
// Parse header
if (empty($this->map)) {
$this->parse_header($elements);
if (empty($this->map)) {
break;
}
} else {
$this->csv_to_vcard($elements);
}
}
}
开发者ID:netcon-source,项目名称:roundcubemail,代码行数:34,代码来源:rcube_csv2vcard.php
示例6: connect
/**
* Establish a connection to the LDAP server
*/
public function connect($host = null)
{
// Net_LDAP3 does not support IDNA yet
// also parse_host() here is very Roundcube specific
$host = rcube_utils::idn_to_ascii(rcube_utils::parse_host($host));
return parent::connect($host);
}
开发者ID:StudsPro,项目名称:islandpeeps.com,代码行数:10,代码来源:rcube_ldap_generic.php
示例7: 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));
$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));
// don't let the user alter the e-mail address if disabled by config
if (in_array($ident_level, array(1, 3, 4))) {
$save_data['email'] = $identity['email'];
}
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();
}
开发者ID:BIGGANI,项目名称:zpanelx,代码行数:32,代码来源:new_user_dialog.php
示例8: 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;
}
开发者ID:EstudioNexos,项目名称:threecol,代码行数:8,代码来源:threecol.php
示例9: create_identity
public function create_identity($p)
{
$rcmail = rcmail::get_instance();
// prefs are set in create_user()
if ($this->prefs) {
if ($this->prefs['full_name']) {
$p['record']['name'] = $this->prefs['full_name'];
}
if (($this->identities_level == 0 || $this->identities_level == 2) && $this->prefs['email_address']) {
$p['record']['email'] = $this->prefs['email_address'];
}
if ($this->prefs['___signature___']) {
$p['record']['signature'] = $this->prefs['___signature___'];
}
if ($this->prefs['reply_to']) {
$p['record']['reply-to'] = $this->prefs['reply_to'];
}
if (($this->identities_level == 0 || $this->identities_level == 1) && isset($this->prefs['identities']) && $this->prefs['identities'] > 1) {
for ($i = 1; $i < $this->prefs['identities']; $i++) {
unset($ident_data);
$ident_data = array('name' => '', 'email' => '');
// required data
if ($this->prefs['full_name' . $i]) {
$ident_data['name'] = $this->prefs['full_name' . $i];
}
if ($this->identities_level == 0 && $this->prefs['email_address' . $i]) {
$ident_data['email'] = $this->prefs['email_address' . $i];
} else {
$ident_data['email'] = $p['record']['email'];
}
if ($this->prefs['reply_to' . $i]) {
$ident_data['reply-to'] = $this->prefs['reply_to' . $i];
}
if ($this->prefs['___sig' . $i . '___']) {
$ident_data['signature'] = $this->prefs['___sig' . $i . '___'];
}
// insert identity
$rcmail->user->insert_identity($ident_data);
}
}
// copy address book
$contacts = $rcmail->get_address_book(null, true);
if ($contacts && count($this->abook)) {
foreach ($this->abook as $rec) {
// #1487096 handle multi-address and/or too long items
$rec['email'] = array_shift(explode(';', $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);
}
}
}
// mark identity as complete for following hooks
$p['complete'] = true;
}
return $p;
}
开发者ID:bbspike,项目名称:sentora-core,代码行数:57,代码来源:squirrelmail_usercopy.php
示例10: 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;
}
开发者ID:JohnDoh,项目名称:Roundcube-Plugin-Context-Menu,代码行数:9,代码来源:contextmenu.php
示例11: 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();
}
开发者ID:elurofilico,项目名称:i-MSCP-plugins,代码行数:11,代码来源:markasjunk2.php
示例12: lookup_user_name
function lookup_user_name($args)
{
if ($this->init_ldap($args['host'])) {
$results = $this->ldap->search('*', $args['user'], true);
if (count($results->records) == 1) {
$user_name = is_array($results->records[0]['name']) ? $results->records[0]['name'][0] : $results->records[0]['name'];
$user_email = is_array($results->records[0]['email']) ? $results->records[0]['email'][0] : $results->records[0]['email'];
$args['user_name'] = $user_name;
if (!$args['user_email'] && strpos($user_email, '@')) {
$args['user_email'] = rcube_utils::idn_to_ascii($user_email);
}
}
}
return $args;
}
开发者ID:bbspike,项目名称:sentora-core,代码行数:15,代码来源:new_user_identity.php
示例13: mailto_callback
/**
* Callback function used to build mailto: links around e-mail strings
*
* This also adds an onclick-handler to open the Rouncube compose message screen on such links
*
* @param array Matches result from preg_replace_callback
* @return int Index of saved string value
* @see rcube_string_replacer::mailto_callback()
*/
public function mailto_callback($matches)
{
$href = $matches[1];
$suffix = $this->parse_url_brackets($href);
$email = $href;
if (strpos($email, '?')) {
list($email, ) = explode('?', $email);
}
// skip invalid emails
if (!rcube_utils::check_email($email, false)) {
return $matches[1];
}
$i = $this->add(html::a(array('href' => 'mailto:' . $href, 'onclick' => "return " . rcmail_output::JS_OBJECT_NAME . ".command('compose','" . rcube::JQ($href) . "',this)"), rcube::Q($href)) . $suffix);
return $i >= 0 ? $this->get_replacement($i) : '';
}
开发者ID:JotapePinheiro,项目名称:roundcubemail,代码行数:24,代码来源:rcmail_string_replacer.php
示例14: 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();
}
开发者ID:bbspike,项目名称:sentora-core,代码行数:15,代码来源:markasjunk.php
示例15: user2email
/**
* User > Email
*/
function user2email($p)
{
$r = $this->findinvirtual('/\\s' . preg_quote($p['user'], '/') . '\\s*$/');
$result = array();
for ($i = 0; $i < count($r); $i++) {
$arr = preg_split('/\\s+/', $r[$i]);
if (count($arr) > 0 && strpos($arr[0], '@')) {
$result[] = rcube_utils::idn_to_ascii(trim(str_replace('\\@', '@', $arr[0])));
if ($p['first']) {
$p['email'] = $result[0];
break;
}
}
}
$p['email'] = empty($result) ? NULL : $result;
return $p;
}
开发者ID:rcg2015,项目名称:roundcubemail,代码行数:20,代码来源:virtuser_file.php
示例16: 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();
}
开发者ID:nciftci,项目名称:plugins,代码行数:17,代码来源:contextmenu.php
示例17: user2email
/**
* User > Email
*/
function user2email($p)
{
$dbh = $this->get_dbh();
$sql_result = $dbh->query(preg_replace('/%u/', $dbh->escape($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' => (string) $sql_arr[1], 'organization' => (string) $sql_arr[2], 'reply-to' => (string) rcube_utils::idn_to_ascii($sql_arr[3]), 'bcc' => (string) rcube_utils::idn_to_ascii($sql_arr[4]), 'signature' => (string) $sql_arr[5], 'html_signature' => (int) $sql_arr[6]);
} else {
$result[] = $sql_arr[0];
}
if ($p['first']) {
break;
}
}
}
$p['email'] = $result;
return $p;
}
开发者ID:jimjag,项目名称:roundcubemail,代码行数:22,代码来源:virtuser_query.php
示例18: authenticate
/**
* Authenticate hook handler
*/
function authenticate($args)
{
if (!empty($_SERVER['REMOTE_USER']) && !empty($_SERVER['KRB5CCNAME'])) {
// Load plugin's config file
$this->load_config();
$rcmail = rcmail::get_instance();
$host = $rcmail->config->get('krb_authentication_host');
if (is_string($host) && trim($host) !== '' && empty($args['host'])) {
$args['host'] = rcube_utils::idn_to_ascii(rcube_utils::parse_host($host));
}
if (!empty($_SERVER['REMOTE_USER'])) {
$args['user'] = $_SERVER['REMOTE_USER'];
$args['pass'] = null;
}
$args['cookiecheck'] = false;
$args['valid'] = true;
}
return $args;
}
开发者ID:jimjag,项目名称:roundcubemail,代码行数:22,代码来源:krb_authentication.php
示例19: 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();
}
开发者ID:nciftci,项目名称:plugins,代码行数:19,代码来源:markasjunk2.php
示例20: 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);
}
}
}
}
开发者ID:rasky,项目名称:roundcubemail,代码行数:44,代码来源:enigma.php
注:本文中的rcube_utils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论