- Deprecate $DB, $USER, $IMAP global variables, Use $RCMAIL instead
| | |
| | | CHANGELOG Roundcube Webmail |
| | | =========================== |
| | | |
| | | - Deprecate $DB, $USER, $IMAP global variables, Use $RCMAIL instead |
| | | - Add option to set default font for HTML message (#1484137) |
| | | - Fix issues with big memory allocation of IMAP results |
| | | - Replace prompt() with jQuery UI dialog (#1485135) |
| | |
| | | function export_mailbox($mbox, $filename) |
| | | { |
| | | global $IMAP; |
| | | |
| | | |
| | | $IMAP->set_mailbox($mbox); |
| | | |
| | | |
| | | vputs("Getting message list of {$mbox}..."); |
| | | vputs($IMAP->messagecount()." messages\n"); |
| | | |
| | | |
| | | if ($filename) |
| | | { |
| | | if (!($out = fopen($filename, 'w'))) |
| | |
| | | } |
| | | else |
| | | $out = STDOUT; |
| | | |
| | | |
| | | for ($count = $IMAP->messagecount(), $i=1; $i <= $count; $i++) |
| | | { |
| | | $headers = $IMAP->get_headers($i, null, false); |
| | |
| | | /** |
| | | * Initial startup function |
| | | * to register session, create database and imap connections |
| | | * |
| | | * @todo Remove global vars $DB, $USER |
| | | */ |
| | | private function startup() |
| | | { |
| | |
| | | } |
| | | |
| | | // connect to database |
| | | $GLOBALS['DB'] = $this->get_dbh(); |
| | | $this->get_dbh(); |
| | | |
| | | // set global object for backward compatibility |
| | | $GLOBALS['DB'] = $this->db; |
| | | |
| | | // start session |
| | | $this->session_init(); |
| | |
| | | { |
| | | if (is_object($user)) { |
| | | $this->user = $user; |
| | | |
| | | // set global object for backward compatibility |
| | | $GLOBALS['USER'] = $this->user; |
| | | |
| | | // overwrite config with user preferences |
| | |
| | | |
| | | return $this->db; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Get global handle for memcache access |
| | | * |
| | |
| | | $MESSAGE->compose = array(); |
| | | |
| | | // get user's identities |
| | | $MESSAGE->identities = $USER->list_identities(); |
| | | $MESSAGE->identities = $RCMAIL->user->list_identities(); |
| | | if (count($MESSAGE->identities)) |
| | | { |
| | | foreach ($MESSAGE->identities as $idx => $ident) { |
| | |
| | | // get identity record |
| | | function rcmail_get_identity($id) |
| | | { |
| | | global $USER, $OUTPUT; |
| | | global $RCMAIL, $OUTPUT; |
| | | |
| | | if ($sql_arr = $USER->get_identity($id)) { |
| | | if ($sql_arr = $RCMAIL->user->get_identity($id)) { |
| | | $out = $sql_arr; |
| | | $out['mailto'] = $sql_arr['email']; |
| | | $out['string'] = format_email_recipient($sql_arr['email'], |
| | |
| | | { |
| | | $plugin = $RCMAIL->plugins->exec_hook('identity_delete', array('id' => $iid)); |
| | | |
| | | $deleted = !$plugin['abort'] ? $USER->delete_identity($iid) : $plugin['result']; |
| | | $deleted = !$plugin['abort'] ? $RCMAIL->user->delete_identity($iid) : $plugin['result']; |
| | | |
| | | if ($deleted > 0 && $deleted !== false) |
| | | $OUTPUT->show_message('deletedsuccessfully', 'confirmation', null, false); |
| | |
| | | |
| | | // edit-identity |
| | | if (($_GET['_iid'] || $_POST['_iid']) && $RCMAIL->action=='edit-identity') { |
| | | $IDENTITY_RECORD = $USER->get_identity(get_input_value('_iid', RCUBE_INPUT_GPC)); |
| | | $IDENTITY_RECORD = $RCMAIL->user->get_identity(get_input_value('_iid', RCUBE_INPUT_GPC)); |
| | | |
| | | if (is_array($IDENTITY_RECORD)) |
| | | $OUTPUT->set_env('iid', $IDENTITY_RECORD['identity_id']); |
| | |
| | | |
| | | function rcmail_identities_list($attrib) |
| | | { |
| | | global $OUTPUT, $USER, $RCMAIL; |
| | | global $OUTPUT, $RCMAIL; |
| | | |
| | | // add id to message list table if not specified |
| | | if (!strlen($attrib['id'])) |
| | | $attrib['id'] = 'rcmIdentitiesList'; |
| | | |
| | | // get identities list and define 'mail' column |
| | | $list = $USER->list_identities(); |
| | | $list = $RCMAIL->user->list_identities(); |
| | | foreach ($list as $idx => $row) |
| | | $list[$idx]['mail'] = trim($row['name'] . ' <' . rcube_idn_to_utf8($row['email']) .'>'); |
| | | |
| | |
| | | $save_data['reply-to'] = rcube_idn_to_ascii($save_data['reply-to']); |
| | | |
| | | if (!$plugin['abort']) |
| | | $updated = $USER->update_identity($iid, $save_data); |
| | | $updated = $RCMAIL->user->update_identity($iid, $save_data); |
| | | else |
| | | $updated = $plugin['result']; |
| | | |
| | |
| | | $save_data['reply-to'] = rcube_idn_to_ascii($save_data['reply-to']); |
| | | |
| | | if (!$plugin['abort']) |
| | | $insert_id = $save_data['email'] ? $USER->insert_identity($save_data) : null; |
| | | $insert_id = $save_data['email'] ? $RCMAIL->user->insert_identity($save_data) : null; |
| | | else |
| | | $insert_id = $plugin['result']; |
| | | |
| | |
| | | |
| | | // mark all other identities as 'not-default' |
| | | if ($default_id) |
| | | $USER->set_default($default_id); |
| | | $RCMAIL->user->set_default($default_id); |
| | | |
| | | // go to next step |
| | | rcmail_overwrite_action('identities'); |
| | |
| | | |
| | | // Save preferences |
| | | if (!$plugin['abort']) |
| | | $saved = $USER->save_prefs($a_user_prefs); |
| | | $saved = $RCMAIL->user->save_prefs($a_user_prefs); |
| | | else |
| | | $saved = $plugin['result']; |
| | | |