Changeset 5563 in subversion


Ignore:
Timestamp:
Dec 7, 2011 5:41:15 AM (18 months ago)
Author:
alec
Message:
  • Remove deprecated global $IMAP variable usage (#1488148)
Location:
trunk/roundcubemail
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/index.php

    r5480 r5563  
    130130  } 
    131131  else { 
    132     $error_code = is_object($IMAP) ? $IMAP->get_error_code() : -1; 
     132    $error_code = (isset($RCMAIL->imap) && is_object($RCMAIL->imap)) ? $RCMAIL->imap->get_error_code() : 1; 
    133133 
    134134    $OUTPUT->show_message($error_code < -1 ? 'imaperror' : (!$auth['valid'] ? 'invalidrequest' : 'loginfailed'), 'warning'); 
  • trunk/roundcubemail/program/include/rcmail.php

    r5555 r5563  
    585585   * 
    586586   * @param boolean True if connection should be established 
    587    * @todo Remove global $IMAP 
    588587   */ 
    589588  public function imap_init($connect = false) 
  • trunk/roundcubemail/program/steps/mail/addcontact.inc

    r5406 r5563  
    3838if (!empty($_POST['_address']) && is_object($CONTACTS)) 
    3939{ 
    40   $contact_arr = $IMAP->decode_address_list(get_input_value('_address', RCUBE_INPUT_POST, true), 1, false); 
     40  $contact_arr = $RCMAIL->imap->decode_address_list(get_input_value('_address', RCUBE_INPUT_POST, true), 1, false); 
    4141 
    4242  if (!empty($contact_arr[1]['mailto'])) { 
  • trunk/roundcubemail/program/steps/mail/check_recent.inc

    r5483 r5563  
    2020*/ 
    2121 
    22 $current = $IMAP->get_mailbox_name(); 
     22$current = $RCMAIL->imap->get_mailbox_name(); 
    2323$check_all = !empty($_GET['_refresh']) || (bool)$RCMAIL->config->get('check_all_folders'); 
    2424 
    2525// list of folders to check 
    2626if ($check_all) { 
    27     $a_mailboxes = $IMAP->list_mailboxes('', '*', 'mail'); 
     27    $a_mailboxes = $RCMAIL->imap->list_mailboxes('', '*', 'mail'); 
    2828} 
    2929else { 
     
    3838    if ($is_current) { 
    3939        // Synchronize mailbox cache, handle flag changes 
    40         $IMAP->mailbox_sync($mbox_name); 
     40        $RCMAIL->imap->mailbox_sync($mbox_name); 
    4141    } 
    4242 
    4343    // Get mailbox status 
    44     $status = $IMAP->mailbox_status($mbox_name); 
     44    $status = $RCMAIL->imap->mailbox_status($mbox_name); 
    4545 
    4646    if ($status & 1) { 
     
    5959            && $_SESSION['search_request'] == $search_request 
    6060        ) { 
    61             $_SESSION['search'] = $IMAP->refresh_search(); 
     61            $_SESSION['search'] = $RCMAIL->imap->refresh_search(); 
    6262        } 
    6363 
     
    7070 
    7171        // get overall message count; allow caching because rcube_imap::mailbox_status() did a refresh 
    72         $all_count = $IMAP->messagecount(null, $IMAP->threading ? 'THREADS' : 'ALL'); 
     72        $all_count = $RCMAIL->imap->messagecount(null, $RCMAIL->imap->threading ? 'THREADS' : 'ALL'); 
    7373 
    7474        // check current page if we're not on the first page 
    75         if ($all_count && $IMAP->list_page > 1) { 
    76             $remaining = $all_count - $IMAP->page_size * ($IMAP->list_page - 1); 
     75        if ($all_count && $RCMAIL->imap->list_page > 1) { 
     76            $remaining = $all_count - $RCMAIL->imap->page_size * ($RCMAIL->imap->list_page - 1); 
    7777            if ($remaining <= 0) { 
    78                 $IMAP->set_page($IMAP->list_page-1); 
    79                 $_SESSION['page'] = $IMAP->list_page; 
     78                $RCMAIL->imap->set_page($RCMAIL->imap->list_page-1); 
     79                $_SESSION['page'] = $RCMAIL->imap->list_page; 
    8080            } 
    8181        } 
    8282 
    8383        $OUTPUT->set_env('messagecount', $all_count); 
    84         $OUTPUT->set_env('pagecount', ceil($all_count/$IMAP->page_size)); 
     84        $OUTPUT->set_env('pagecount', ceil($all_count/$RCMAIL->imap->page_size)); 
    8585        $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($all_count), $mbox_name); 
    86         $OUTPUT->set_env('current_page', $all_count ? $IMAP->list_page : 1); 
     86        $OUTPUT->set_env('current_page', $all_count ? $RCMAIL->imap->list_page : 1); 
    8787 
    8888        // remove old rows (and clear selection if new list is empty) 
     
    9090 
    9191        if ($all_count) { 
    92             $a_headers = $IMAP->list_headers($mbox_name, null, $_SESSION['sort_col'], $_SESSION['sort_order']); 
     92            $a_headers = $RCMAIL->imap->list_headers($mbox_name, null, $_SESSION['sort_col'], $_SESSION['sort_order']); 
    9393            // add message rows 
    9494            rcmail_js_message_list($a_headers, false); 
  • trunk/roundcubemail/program/steps/mail/compose.inc

    r5562 r5563  
    5757    'id'      => $COMPOSE_ID, 
    5858    'param'   => request2param(RCUBE_INPUT_GET), 
    59     'mailbox' => $IMAP->get_mailbox_name(), 
     59    'mailbox' => $RCMAIL->imap->get_mailbox_name(), 
    6060  ); 
    6161  $COMPOSE =& $_SESSION['compose_data_'.$COMPOSE_ID]; 
     
    135135} 
    136136// set current mailbox in client environment 
    137 $OUTPUT->set_env('mailbox', $IMAP->get_mailbox_name()); 
     137$OUTPUT->set_env('mailbox', $RCMAIL->imap->get_mailbox_name()); 
    138138$OUTPUT->set_env('sig_above', $RCMAIL->config->get('sig_above', false)); 
    139139$OUTPUT->set_env('top_posting', $RCMAIL->config->get('top_posting', false)); 
     
    183183  // make sure message is marked as read 
    184184  if ($MESSAGE && $MESSAGE->headers && empty($MESSAGE->headers->flags['SEEN'])) 
    185     $IMAP->set_flag($msg_uid, 'SEEN'); 
     185    $RCMAIL->imap->set_flag($msg_uid, 'SEEN'); 
    186186 
    187187  if (!empty($MESSAGE->headers->charset)) 
    188     $IMAP->set_charset($MESSAGE->headers->charset); 
     188    $RCMAIL->imap->set_charset($MESSAGE->headers->charset); 
    189189 
    190190  if ($compose_mode == RCUBE_COMPOSE_REPLY) 
     
    272272  if (is_object($MESSAGE->headers) && in_array($compose_mode, array(RCUBE_COMPOSE_REPLY, RCUBE_COMPOSE_FORWARD))) 
    273273  { 
    274     $a_to = $IMAP->decode_address_list($MESSAGE->headers->to); 
     274    $a_to = $RCMAIL->imap->decode_address_list($MESSAGE->headers->to); 
    275275    foreach ($a_to as $addr) { 
    276276      if (!empty($addr['mailto'])) { 
     
    281281 
    282282    if (!empty($MESSAGE->headers->cc)) { 
    283       $a_cc = $IMAP->decode_address_list($MESSAGE->headers->cc); 
     283      $a_cc = $RCMAIL->imap->decode_address_list($MESSAGE->headers->cc); 
    284284      foreach ($a_cc as $addr) { 
    285285        if (!empty($addr['mailto'])) { 
     
    424424  // split recipients and put them back together in a unique way 
    425425  if (!empty($fvalue) && in_array($header, array('to', 'cc', 'bcc'))) { 
    426     $to_addresses = $IMAP->decode_address_list($fvalue, null, $decode_header); 
     426    $to_addresses = $RCMAIL->imap->decode_address_list($fvalue, null, $decode_header); 
    427427    $fvalue = array(); 
    428428 
     
    14331433function rcmail_check_sent_folder($folder, $create=false) 
    14341434{ 
    1435   global $IMAP; 
    1436  
    1437   if ($IMAP->mailbox_exists($folder, true)) { 
     1435  global $RCMAIL; 
     1436 
     1437  if ($RCMAIL->imap->mailbox_exists($folder, true)) { 
    14381438    return true; 
    14391439  } 
     
    14411441  // folder may exist but isn't subscribed (#1485241) 
    14421442  if ($create) { 
    1443     if (!$IMAP->mailbox_exists($folder)) 
    1444       return $IMAP->create_mailbox($folder, true); 
     1443    if (!$RCMAIL->imap->mailbox_exists($folder)) 
     1444      return $RCMAIL->imap->create_mailbox($folder, true); 
    14451445    else 
    1446       return $IMAP->subscribe($folder); 
     1446      return $RCMAIL->imap->subscribe($folder); 
    14471447  } 
    14481448 
  • trunk/roundcubemail/program/steps/mail/copy.inc

    r4410 r5563  
    3030    $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true); 
    3131 
    32     $copied = $IMAP->copy_message($uids, $target, $mbox); 
     32    $copied = $RCMAIL->imap->copy_message($uids, $target, $mbox); 
    3333 
    3434    if (!$copied) { 
  • trunk/roundcubemail/program/steps/mail/folders.inc

    r5266 r5563  
    2828if ($RCMAIL->action == 'expunge') { 
    2929 
    30     $success = $IMAP->expunge($mbox); 
     30    $success = $RCMAIL->imap->expunge($mbox); 
    3131 
    3232    // reload message list if current mailbox 
     
    4949else if ($RCMAIL->action == 'purge') 
    5050{ 
    51     $delimiter = $IMAP->get_hierarchy_delimiter(); 
     51    $delimiter = $RCMAIL->imap->get_hierarchy_delimiter(); 
    5252    $trash_regexp = '/^' . preg_quote($CONFIG['trash_mbox'] . $delimiter, '/') . '/'; 
    5353    $junk_regexp  = '/^' . preg_quote($CONFIG['junk_mbox'] . $delimiter, '/') . '/'; 
     
    5757        || preg_match($trash_regexp, $mbox) || preg_match($junk_regexp, $mbox) 
    5858    ) { 
    59         $success = $IMAP->clear_mailbox($mbox); 
     59        $success = $RCMAIL->imap->clear_mailbox($mbox); 
    6060 
    6161        if ($success) { 
  • trunk/roundcubemail/program/steps/mail/func.inc

    r5557 r5563  
    4848// set imap properties and session vars 
    4949if (strlen(trim($mbox = get_input_value('_mbox', RCUBE_INPUT_GPC, true)))) 
    50   $IMAP->set_mailbox(($_SESSION['mbox'] = $mbox)); 
    51 else if ($IMAP) 
    52   $_SESSION['mbox'] = $IMAP->get_mailbox_name(); 
     50  $RCMAIL->imap->set_mailbox(($_SESSION['mbox'] = $mbox)); 
     51else if ($RCMAIL->imap) 
     52  $_SESSION['mbox'] = $RCMAIL->imap->get_mailbox_name(); 
    5353 
    5454if (!empty($_GET['_page'])) 
    55   $IMAP->set_page(($_SESSION['page'] = intval($_GET['_page']))); 
     55  $RCMAIL->imap->set_page(($_SESSION['page'] = intval($_GET['_page']))); 
    5656 
    5757// set default sort col/order to session 
     
    7070  $RCMAIL->user->save_prefs(array('message_threading' => $a_threading)); 
    7171} 
    72 $IMAP->set_threading($a_threading[$_SESSION['mbox']]); 
     72$RCMAIL->imap->set_threading($a_threading[$_SESSION['mbox']]); 
    7373 
    7474// set message set for search result 
     
    7676    && $_SESSION['search_request'] == $_REQUEST['_search'] 
    7777) { 
    78   $IMAP->set_search_set($_SESSION['search']); 
     78  $RCMAIL->imap->set_search_set($_SESSION['search']); 
    7979  $OUTPUT->set_env('search_request', $_REQUEST['_search']); 
    8080  $OUTPUT->set_env('search_text', $_SESSION['last_text_search']); 
     
    8383// set main env variables, labels and page title 
    8484if (empty($RCMAIL->action) || $RCMAIL->action == 'list') { 
    85   $mbox_name = $IMAP->get_mailbox_name(); 
     85  $mbox_name = $RCMAIL->imap->get_mailbox_name(); 
    8686 
    8787  if (empty($RCMAIL->action)) { 
     
    9090      $search_request = md5($mbox_name.$_SESSION['search_filter']); 
    9191 
    92       $IMAP->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET, $_SESSION['sort_col']); 
    93       $_SESSION['search'] = $IMAP->get_search_set(); 
     92      $RCMAIL->imap->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET, $_SESSION['sort_col']); 
     93      $_SESSION['search'] = $RCMAIL->imap->get_search_set(); 
    9494      $_SESSION['search_request'] = $search_request; 
    9595      $OUTPUT->set_env('search_request', $search_request); 
     
    102102  // set current mailbox and some other vars in client environment 
    103103  $OUTPUT->set_env('mailbox', $mbox_name); 
    104   $OUTPUT->set_env('pagesize', $IMAP->page_size); 
    105   $OUTPUT->set_env('quota', $IMAP->get_capability('QUOTA')); 
    106   $OUTPUT->set_env('delimiter', $IMAP->get_hierarchy_delimiter()); 
    107   $OUTPUT->set_env('threading', (bool) $IMAP->threading); 
    108   $OUTPUT->set_env('threads', $IMAP->threading || $IMAP->get_capability('THREAD')); 
     104  $OUTPUT->set_env('pagesize', $RCMAIL->imap->page_size); 
     105  $OUTPUT->set_env('quota', $RCMAIL->imap->get_capability('QUOTA')); 
     106  $OUTPUT->set_env('delimiter', $RCMAIL->imap->get_hierarchy_delimiter()); 
     107  $OUTPUT->set_env('threading', (bool) $RCMAIL->imap->threading); 
     108  $OUTPUT->set_env('threads', $RCMAIL->imap->threading || $RCMAIL->imap->get_capability('THREAD')); 
    109109  $OUTPUT->set_env('preview_pane_mark_read', $RCMAIL->config->get('preview_pane_mark_read', 0)); 
    110110 
     
    131131      'copy', 'move', 'quota'); 
    132132 
    133   $OUTPUT->set_pagetitle(rcmail_localize_foldername($IMAP->mod_mailbox($mbox_name))); 
     133  $OUTPUT->set_pagetitle(rcmail_localize_foldername($RCMAIL->imap->mod_mailbox($mbox_name))); 
    134134} 
    135135 
     
    140140function rcmail_message_list($attrib) 
    141141{ 
    142   global $IMAP, $CONFIG, $OUTPUT; 
     142  global $RCMAIL, $CONFIG, $OUTPUT; 
    143143 
    144144  // add some labels to client 
     
    162162  $_SESSION['list_attrib'] = $attrib; 
    163163 
    164   $mbox = $IMAP->get_mailbox_name(); 
    165   $delim = $IMAP->get_hierarchy_delimiter(); 
     164  $mbox = $RCMAIL->imap->get_mailbox_name(); 
     165  $delim = $RCMAIL->imap->get_hierarchy_delimiter(); 
    166166 
    167167  // show 'to' instead of 'from' in sent/draft messages 
     
    205205function rcmail_js_message_list($a_headers, $insert_top=FALSE, $a_show_cols=null) 
    206206{ 
    207   global $CONFIG, $IMAP, $RCMAIL, $OUTPUT; 
     207  global $CONFIG, $RCMAIL, $OUTPUT; 
    208208 
    209209  if (empty($a_show_cols)) { 
     
    219219  } 
    220220 
    221   $mbox = $IMAP->get_mailbox_name(); 
    222   $delim = $IMAP->get_hierarchy_delimiter(); 
     221  $mbox = $RCMAIL->imap->get_mailbox_name(); 
     222  $delim = $RCMAIL->imap->get_hierarchy_delimiter(); 
    223223 
    224224  // make sure 'threads' and 'subject' columns are present 
     
    267267    $a_msg_flags = array(); 
    268268 
    269     $IMAP->set_charset(!empty($header->charset) ? $header->charset : $CONFIG['default_charset']); 
     269    $RCMAIL->imap->set_charset(!empty($header->charset) ? $header->charset : $CONFIG['default_charset']); 
    270270 
    271271    // format each col; similar as in rcmail_message_list() 
     
    274274        $cont = Q(rcmail_address_string($header->$col, 3), 'show'); 
    275275      else if ($col=='subject') { 
    276         $cont = trim($IMAP->decode_header($header->$col)); 
     276        $cont = trim($RCMAIL->imap->decode_header($header->$col)); 
    277277        if (!$cont) $cont = rcube_label('nosubject'); 
    278278        $cont = Q($cont); 
     
    320320  } 
    321321 
    322   if ($IMAP->threading) { 
     322  if ($RCMAIL->imap->threading) { 
    323323    $OUTPUT->command('init_threads', (array) $roots, $mbox); 
    324324  } 
     
    396396 */ 
    397397function rcmail_messagecontent_frame($attrib) 
    398   { 
     398{ 
    399399  global $OUTPUT, $RCMAIL; 
    400400 
     
    409409 
    410410  return html::iframe($attrib); 
    411   } 
     411} 
    412412 
    413413 
    414414function rcmail_messagecount_display($attrib) 
    415   { 
     415{ 
    416416  global $RCMAIL; 
    417417 
     
    424424 
    425425  return html::span($attrib, $content); 
    426   } 
     426} 
    427427 
    428428 
    429429function rcmail_get_messagecount_text($count=NULL, $page=NULL) 
    430   { 
    431   global $RCMAIL, $IMAP; 
     430{ 
     431  global $RCMAIL; 
    432432 
    433433  if ($page===NULL) 
    434     $page = $IMAP->list_page; 
    435  
    436   $start_msg = ($page-1) * $IMAP->page_size + 1; 
     434    $page = $RCMAIL->imap->list_page; 
     435 
     436  $start_msg = ($page-1) * $RCMAIL->imap->page_size + 1; 
    437437 
    438438  if ($count!==NULL) 
    439439    $max = $count; 
    440440  else if ($RCMAIL->action) 
    441     $max = $IMAP->messagecount(NULL, $IMAP->threading ? 'THREADS' : 'ALL'); 
     441    $max = $RCMAIL->imap->messagecount(NULL, $RCMAIL->imap->threading ? 'THREADS' : 'ALL'); 
    442442 
    443443  if ($max==0) 
    444444    $out = rcube_label('mailboxempty'); 
    445445  else 
    446     $out = rcube_label(array('name' => $IMAP->threading ? 'threadsfromto' : 'messagesfromto', 
     446    $out = rcube_label(array('name' => $RCMAIL->imap->threading ? 'threadsfromto' : 'messagesfromto', 
    447447            'vars' => array('from'  => $start_msg, 
    448             'to'    => min($max, $start_msg + $IMAP->page_size - 1), 
     448            'to'    => min($max, $start_msg + $RCMAIL->imap->page_size - 1), 
    449449            'count' => $max))); 
    450450 
    451451  return Q($out); 
    452   } 
     452} 
    453453 
    454454 
     
    869869function rcmail_message_headers($attrib, $headers=NULL) 
    870870  { 
    871   global $IMAP, $OUTPUT, $MESSAGE, $PRINT_MODE, $RCMAIL; 
     871  global $OUTPUT, $MESSAGE, $PRINT_MODE, $RCMAIL; 
    872872  static $sa_attrib; 
    873873 
     
    926926      $header_value = rcube_label('nosubject'); 
    927927    else 
    928       $header_value = trim($IMAP->decode_header($value)); 
     928      $header_value = trim($RCMAIL->imap->decode_header($value)); 
    929929 
    930930    $output_headers[$hkey] = array( 
     
    974974function rcmail_message_body($attrib) 
    975975{ 
    976   global $CONFIG, $OUTPUT, $MESSAGE, $IMAP, $RCMAIL, $REMOTE_OBJECTS; 
     976  global $CONFIG, $OUTPUT, $MESSAGE, $RCMAIL, $REMOTE_OBJECTS; 
    977977 
    978978  if (!is_array($MESSAGE->parts) && empty($MESSAGE->body)) 
     
    10001000          $out .= html::span('part-notice', rcube_label('messagetoobig'). ' ' 
    10011001            . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part='.$part->mime_id 
    1002               .'&_mbox='. urlencode($IMAP->get_mailbox_name()), rcube_label('download'))); 
     1002              .'&_mbox='. urlencode($RCMAIL->imap->get_mailbox_name()), rcube_label('download'))); 
    10031003          continue; 
    10041004        } 
     
    10461046      $out .= html::span('part-notice', rcube_label('messagetoobig'). ' ' 
    10471047        . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part=0' 
    1048           .'&_mbox='. urlencode($IMAP->get_mailbox_name()), rcube_label('download'))); 
     1048          .'&_mbox='. urlencode($RCMAIL->imap->get_mailbox_name()), rcube_label('download'))); 
    10491049    } 
    10501050    else { 
     
    12421242function rcmail_address_string($input, $max=null, $linked=false, $addicon=null) 
    12431243{ 
    1244   global $IMAP, $RCMAIL, $PRINT_MODE, $CONFIG; 
    1245  
    1246   $a_parts = $IMAP->decode_address_list($input); 
     1244  global $RCMAIL, $PRINT_MODE, $CONFIG; 
     1245 
     1246  $a_parts = $RCMAIL->imap->decode_address_list($input); 
    12471247 
    12481248  if (!sizeof($a_parts)) 
     
    14521452function rcmail_send_mdn($message, &$smtp_error) 
    14531453{ 
    1454   global $RCMAIL, $IMAP; 
     1454  global $RCMAIL; 
    14551455 
    14561456  if (!is_object($message) || !is_a($message, 'rcube_message')) 
     
    14581458 
    14591459  if ($message->headers->mdn_to && empty($message->headers->flags['MDNSENT']) && 
    1460     ($IMAP->check_permflag('MDNSENT') || $IMAP->check_permflag('*'))) 
     1460    ($RCMAIL->imap->check_permflag('MDNSENT') || $RCMAIL->imap->check_permflag('*'))) 
    14611461  { 
    14621462    $identity = $RCMAIL->user->get_identity(); 
    14631463    $sender = format_email_recipient($identity['email'], $identity['name']); 
    1464     $recipient = array_shift($IMAP->decode_address_list($message->headers->mdn_to)); 
     1464    $recipient = array_shift($RCMAIL->imap->decode_address_list($message->headers->mdn_to)); 
    14651465    $mailto = $recipient['mailto']; 
    14661466 
     
    15131513    if ($sent) 
    15141514    { 
    1515       $IMAP->set_flag($message->uid, 'MDNSENT'); 
     1515      $RCMAIL->imap->set_flag($message->uid, 'MDNSENT'); 
    15161516      return true; 
    15171517    } 
  • trunk/roundcubemail/program/steps/mail/get.inc

    r5547 r5563  
    6969  if (($part_id = get_input_value('_part', RCUBE_INPUT_GPC)) && ($part = $MESSAGE->mime_parts[$part_id]) && $part->filename) 
    7070    $OUTPUT->set_pagetitle($part->filename); 
    71    
     71 
    7272  $OUTPUT->send('messagepart'); 
    7373  exit; 
     
    118118        $out = '<body>' . rcube_label('messagetoobig'). ' ' 
    119119          . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part='.$part->mime_id 
    120             .'&_mbox='. urlencode($IMAP->get_mailbox_name()), rcube_label('download')) . '</body></html>'; 
     120            .'&_mbox='. urlencode($RCMAIL->imap->get_mailbox_name()), rcube_label('download')) . '</body></html>'; 
    121121      } 
    122122      else { 
     
    158158          stream_filter_register('rcube_content', 'rcube_content_filter') or die('Failed to register content filter'); 
    159159          stream_filter_append($stdout, 'rcube_content'); 
    160           $IMAP->get_message_part($MESSAGE->uid, $part->mime_id, $part, false, $stdout); 
     160          $RCMAIL->imap->get_message_part($MESSAGE->uid, $part->mime_id, $part, false, $stdout); 
    161161        } 
    162162      } 
     
    166166          echo $part->body; 
    167167        else if ($part->size) 
    168           $IMAP->get_message_part($MESSAGE->uid, $part->mime_id, $part, true); 
     168          $RCMAIL->imap->get_message_part($MESSAGE->uid, $part->mime_id, $part, true); 
    169169      } 
    170170    } 
  • trunk/roundcubemail/program/steps/mail/getunread.inc

    r4735 r5563  
    2020*/ 
    2121 
    22 $a_folders = $IMAP->list_mailboxes('', '*', 'mail'); 
     22$a_folders = $RCMAIL->imap->list_mailboxes('', '*', 'mail'); 
    2323 
    2424if (!empty($a_folders)) 
    2525{ 
    26   $current = $IMAP->get_mailbox_name(); 
     26  $current = $RCMAIL->imap->get_mailbox_name(); 
    2727  $inbox = ($current == 'INBOX'); 
    2828  $check_all = (bool)$RCMAIL->config->get('check_all_folders'); 
     
    3434      $unseen = $unseen_old; 
    3535    else 
    36       $unseen = $IMAP->messagecount($mbox_row, 'UNSEEN', $unseen_old === null); 
     36      $unseen = $RCMAIL->imap->messagecount($mbox_row, 'UNSEEN', $unseen_old === null); 
    3737 
    3838    if ($unseen || $unseen_old === null) { 
  • trunk/roundcubemail/program/steps/mail/headers.inc

    r4410 r5563  
    2121if ($uid = get_input_value('_uid', RCUBE_INPUT_POST)) 
    2222{ 
    23     $source = $IMAP->get_raw_headers($uid); 
     23    $source = $RCMAIL->imap->get_raw_headers($uid); 
    2424 
    2525    if ($source !== false) { 
  • trunk/roundcubemail/program/steps/mail/list.inc

    r5266 r5563  
    5252  $RCMAIL->user->save_prefs($save_arr); 
    5353 
    54 $mbox_name = $IMAP->get_mailbox_name(); 
     54$mbox_name = $RCMAIL->imap->get_mailbox_name(); 
    5555 
    5656// Synchronize mailbox cache, handle flag changes 
    57 $IMAP->mailbox_sync($mbox_name); 
     57$RCMAIL->imap->mailbox_sync($mbox_name); 
    5858 
    5959// initialize searching result if search_filter is used 
     
    6161{ 
    6262  $search_request = md5($mbox_name.$_SESSION['search_filter']); 
    63   $IMAP->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET, $sort_col); 
    64   $_SESSION['search'] = $IMAP->get_search_set(); 
     63  $RCMAIL->imap->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET, $sort_col); 
     64  $_SESSION['search'] = $RCMAIL->imap->get_search_set(); 
    6565  $_SESSION['search_request'] = $search_request; 
    6666  $OUTPUT->set_env('search_request', $search_request); 
     
    6868 
    6969// fetch message headers 
    70 if ($count = $IMAP->messagecount($mbox_name, $IMAP->threading ? 'THREADS' : 'ALL', !empty($_REQUEST['_refresh']))) 
    71   $a_headers = $IMAP->list_headers($mbox_name, NULL, $sort_col, $sort_order); 
     70if ($count = $RCMAIL->imap->messagecount($mbox_name, $RCMAIL->imap->threading ? 'THREADS' : 'ALL', !empty($_REQUEST['_refresh']))) 
     71  $a_headers = $RCMAIL->imap->list_headers($mbox_name, NULL, $sort_col, $sort_order); 
    7272 
    7373// update search set (possible change of threading mode) 
     
    7575    && $_SESSION['search_request'] == $_REQUEST['_search'] 
    7676) { 
    77   $_SESSION['search'] = $IMAP->get_search_set(); 
     77  $_SESSION['search'] = $RCMAIL->imap->get_search_set(); 
    7878} 
    7979// remove old search data 
     
    9292 
    9393// update message count display 
    94 $pages = ceil($count/$IMAP->page_size); 
     94$pages = ceil($count/$RCMAIL->imap->page_size); 
    9595$OUTPUT->set_env('messagecount', $count); 
    9696$OUTPUT->set_env('pagecount', $pages); 
    97 $OUTPUT->set_env('threading', (bool) $IMAP->threading); 
    98 $OUTPUT->set_env('current_page', $count ? $IMAP->list_page : 1); 
     97$OUTPUT->set_env('threading', (bool) $RCMAIL->imap->threading); 
     98$OUTPUT->set_env('current_page', $count ? $RCMAIL->imap->list_page : 1); 
    9999$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($count), $mbox_name); 
    100100$OUTPUT->command('set_mailboxname', rcmail_get_mailbox_name_text()); 
     
    109109else { 
    110110  // handle IMAP errors (e.g. #1486905) 
    111   if ($err_code = $IMAP->get_error_code()) { 
     111  if ($err_code = $RCMAIL->imap->get_error_code()) { 
    112112    rcmail_display_server_error(); 
    113113  } 
  • trunk/roundcubemail/program/steps/mail/mark.inc

    r5266 r5563  
    3737  if ($flag == 'DELETED' && $CONFIG['skip_deleted'] && $_POST['_from'] != 'show') { 
    3838    // count messages before changing anything 
    39     $old_count = $IMAP->messagecount(NULL, $IMAP->threading ? 'THREADS' : 'ALL'); 
    40     $old_pages = ceil($old_count / $IMAP->page_size); 
     39    $old_count = $RCMAIL->imap->messagecount(NULL, $RCMAIL->imap->threading ? 'THREADS' : 'ALL'); 
     40    $old_pages = ceil($old_count / $RCMAIL->imap->page_size); 
    4141    $count = sizeof(explode(',', $uids)); 
    4242  } 
    4343 
    44   $marked = $IMAP->set_flag($uids, $flag); 
     44  $marked = $RCMAIL->imap->set_flag($uids, $flag); 
    4545 
    4646  if (!$marked) { 
     
    5858  if ($flag == 'DELETED' && $CONFIG['read_when_deleted'] && !empty($_POST['_ruid'])) { 
    5959    $ruids = get_input_value('_ruid', RCUBE_INPUT_POST); 
    60     $read = $IMAP->set_flag($ruids, 'SEEN'); 
     60    $read = $RCMAIL->imap->set_flag($ruids, 'SEEN'); 
    6161 
    6262    if ($read && !$CONFIG['skip_deleted']) 
     
    6565 
    6666  if ($flag == 'SEEN' || $flag == 'UNSEEN' || ($flag == 'DELETED' && !$CONFIG['skip_deleted'])) { 
    67     rcmail_send_unread_count($IMAP->get_mailbox_name()); 
     67    rcmail_send_unread_count($RCMAIL->imap->get_mailbox_name()); 
    6868  } 
    6969  else if ($flag == 'DELETED' && $CONFIG['skip_deleted']) { 
     
    7575    } else { 
    7676      // refresh saved search set after moving some messages 
    77       if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $IMAP->search_set) { 
    78         $_SESSION['search'] = $IMAP->refresh_search(); 
     77      if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $RCMAIL->imap->search_set) { 
     78        $_SESSION['search'] = $RCMAIL->imap->refresh_search(); 
    7979      } 
    8080 
    81       $msg_count      = $IMAP->messagecount(NULL, $IMAP->threading ? 'THREADS' : 'ALL'); 
    82       $pages          = ceil($msg_count / $IMAP->page_size); 
    83       $nextpage_count = $old_count - $IMAP->page_size * $IMAP->list_page; 
    84       $remaining      = $msg_count - $IMAP->page_size * ($IMAP->list_page - 1); 
     81      $msg_count      = $RCMAIL->imap->messagecount(NULL, $RCMAIL->imap->threading ? 'THREADS' : 'ALL'); 
     82      $pages          = ceil($msg_count / $RCMAIL->imap->page_size); 
     83      $nextpage_count = $old_count - $RCMAIL->imap->page_size * $RCMAIL->imap->list_page; 
     84      $remaining      = $msg_count - $RCMAIL->imap->page_size * ($RCMAIL->imap->list_page - 1); 
    8585 
    8686      // jump back one page (user removed the whole last page) 
    87       if ($IMAP->list_page > 1 && $remaining == 0) { 
    88         $IMAP->set_page($IMAP->list_page-1); 
    89         $_SESSION['page'] = $IMAP->list_page; 
     87      if ($RCMAIL->imap->list_page > 1 && $remaining == 0) { 
     88        $RCMAIL->imap->set_page($RCMAIL->imap->list_page-1); 
     89        $_SESSION['page'] = $RCMAIL->imap->list_page; 
    9090        $jump_back = true; 
    9191      } 
     
    9393      // update message count display 
    9494      $OUTPUT->set_env('messagecount', $msg_count); 
    95       $OUTPUT->set_env('current_page', $IMAP->list_page); 
     95      $OUTPUT->set_env('current_page', $RCMAIL->imap->list_page); 
    9696      $OUTPUT->set_env('pagecount', $pages); 
    9797 
    9898      // update mailboxlist 
    99       $mbox = $IMAP->get_mailbox_name(); 
    100       $unseen_count = $msg_count ? $IMAP->messagecount($mbox, 'UNSEEN') : 0; 
     99      $mbox = $RCMAIL->imap->get_mailbox_name(); 
     100      $unseen_count = $msg_count ? $RCMAIL->imap->messagecount($mbox, 'UNSEEN') : 0; 
    101101      $old_unseen = rcmail_get_unseen_count($mbox); 
    102102 
     
    107107      $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count), $mbox); 
    108108 
    109       if ($IMAP->threading) 
     109      if ($RCMAIL->imap->threading) 
    110110            $count = get_input_value('_count', RCUBE_INPUT_POST); 
    111111 
     
    115115        $sort_order = isset($_SESSION['sort_order']) ? $_SESSION['sort_order'] : $CONFIG['message_sort_order']; 
    116116 
    117         $a_headers = $IMAP->list_headers($mbox, NULL, $sort_col, $sort_order, 
     117        $a_headers = $RCMAIL->imap->list_headers($mbox, NULL, $sort_col, $sort_order, 
    118118            $jump_back ? NULL : $count); 
    119119 
  • trunk/roundcubemail/program/steps/mail/move_del.inc

    r5266 r5563  
    2525 
    2626// count messages before changing anything 
    27 $old_count = $IMAP->messagecount(NULL, $IMAP->threading ? 'THREADS' : 'ALL'); 
    28 $old_pages = ceil($old_count / $IMAP->page_size); 
     27$old_count = $RCMAIL->imap->messagecount(NULL, $RCMAIL->imap->threading ? 'THREADS' : 'ALL'); 
     28$old_pages = ceil($old_count / $RCMAIL->imap->page_size); 
    2929 
    3030// move messages 
     
    3434    $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true); 
    3535 
    36     $moved = $IMAP->move_message($uids, $target, $mbox); 
     36    $moved = $RCMAIL->imap->move_message($uids, $target, $mbox); 
    3737 
    3838    if (!$moved) { 
     
    5555    $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true); 
    5656 
    57     $del = $IMAP->delete_message($uids, $mbox); 
     57    $del = $RCMAIL->imap->delete_message($uids, $mbox); 
    5858 
    5959    if (!$del) { 
     
    7777 
    7878// refresh saved search set after moving some messages 
    79 if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $IMAP->search_set) { 
    80     $_SESSION['search'] = $IMAP->refresh_search(); 
     79if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $RCMAIL->imap->search_set) { 
     80    $_SESSION['search'] = $RCMAIL->imap->refresh_search(); 
    8181} 
    8282 
     
    9090else 
    9191{ 
    92   $msg_count      = $IMAP->messagecount(NULL, $IMAP->threading ? 'THREADS' : 'ALL'); 
    93   $pages          = ceil($msg_count / $IMAP->page_size); 
    94   $nextpage_count = $old_count - $IMAP->page_size * $IMAP->list_page; 
    95   $remaining      = $msg_count - $IMAP->page_size * ($IMAP->list_page - 1); 
     92  $msg_count      = $RCMAIL->imap->messagecount(NULL, $RCMAIL->imap->threading ? 'THREADS' : 'ALL'); 
     93  $pages          = ceil($msg_count / $RCMAIL->imap->page_size); 
     94  $nextpage_count = $old_count - $RCMAIL->imap->page_size * $RCMAIL->imap->list_page; 
     95  $remaining      = $msg_count - $RCMAIL->imap->page_size * ($RCMAIL->imap->list_page - 1); 
    9696 
    9797  // jump back one page (user removed the whole last page) 
    98   if ($IMAP->list_page > 1 && $remaining == 0) { 
    99     $IMAP->set_page($IMAP->list_page-1); 
    100     $_SESSION['page'] = $IMAP->list_page; 
     98  if ($RCMAIL->imap->list_page > 1 && $remaining == 0) { 
     99    $RCMAIL->imap->set_page($RCMAIL->imap->list_page-1); 
     100    $_SESSION['page'] = $RCMAIL->imap->list_page; 
    101101    $jump_back = true; 
    102102  } 
     
    104104  // update message count display 
    105105  $OUTPUT->set_env('messagecount', $msg_count); 
    106   $OUTPUT->set_env('current_page', $IMAP->list_page); 
     106  $OUTPUT->set_env('current_page', $RCMAIL->imap->list_page); 
    107107  $OUTPUT->set_env('pagecount', $pages); 
    108108 
    109109  // update mailboxlist 
    110   $mbox = $IMAP->get_mailbox_name(); 
    111   $unseen_count = $msg_count ? $IMAP->messagecount($mbox, 'UNSEEN') : 0; 
     110  $mbox = $RCMAIL->imap->get_mailbox_name(); 
     111  $unseen_count = $msg_count ? $RCMAIL->imap->messagecount($mbox, 'UNSEEN') : 0; 
    112112  $old_unseen = rcmail_get_unseen_count($mbox); 
    113113 
     
    124124  $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count), $mbox); 
    125125 
    126   if ($IMAP->threading) 
     126  if ($RCMAIL->imap->threading) 
    127127    $count = get_input_value('_count', RCUBE_INPUT_POST); 
    128128 
     
    132132    $sort_order = isset($_SESSION['sort_order']) ? $_SESSION['sort_order'] : $CONFIG['message_sort_order']; 
    133133 
    134     $a_headers = $IMAP->list_headers($mbox, NULL, $sort_col, $sort_order, 
     134    $a_headers = $RCMAIL->imap->list_headers($mbox, NULL, $sort_col, $sort_order, 
    135135      $jump_back ? NULL : $count); 
    136136 
  • trunk/roundcubemail/program/steps/mail/pagenav.inc

    r5557 r5563  
    2121 
    2222$uid   = get_input_value('_uid', RCUBE_INPUT_GET); 
    23 $index = $IMAP->message_index(null, $_SESSION['sort_col'], $_SESSION['sort_order']); 
     23$index = $RCMAIL->imap->message_index(null, $_SESSION['sort_col'], $_SESSION['sort_order']); 
    2424$cnt   = $index->countMessages(); 
    2525 
  • trunk/roundcubemail/program/steps/mail/search.inc

    r5557 r5563  
    1919 
    2020// reset list_page and old search results 
    21 $IMAP->set_page(1); 
    22 $IMAP->set_search_set(NULL); 
     21$RCMAIL->imap->set_page(1); 
     22$RCMAIL->imap->set_search_set(NULL); 
    2323$_SESSION['page'] = 1; 
    2424 
     
    108108// execute IMAP search 
    109109if ($search_str) 
    110   $IMAP->search($mbox, $search_str, $imap_charset, $_SESSION['sort_col']); 
     110  $RCMAIL->imap->search($mbox, $search_str, $imap_charset, $_SESSION['sort_col']); 
    111111 
    112112// save search results in session 
     
    115115 
    116116if ($search_str) { 
    117   $_SESSION['search'] = $IMAP->get_search_set(); 
     117  $_SESSION['search'] = $RCMAIL->imap->get_search_set(); 
    118118  $_SESSION['last_text_search'] = $str; 
    119119} 
     
    122122 
    123123// Get the headers 
    124 $result_h = $IMAP->list_headers($mbox, 1, $_SESSION['sort_col'], $_SESSION['sort_order']); 
    125 $count = $IMAP->messagecount($mbox, $IMAP->threading ? 'THREADS' : 'ALL'); 
     124$result_h = $RCMAIL->imap->list_headers($mbox, 1, $_SESSION['sort_col'], $_SESSION['sort_order']); 
     125$count = $RCMAIL->imap->messagecount($mbox, $RCMAIL->imap->threading ? 'THREADS' : 'ALL'); 
    126126 
    127127 
     
    130130  rcmail_js_message_list($result_h); 
    131131  if ($search_str) 
    132     $OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $IMAP->messagecount(NULL, 'ALL'))); 
     132    $OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $RCMAIL->imap->messagecount(NULL, 'ALL'))); 
    133133} 
    134134// handle IMAP errors (e.g. #1486905) 
    135 else  if ($err_code = $IMAP->get_error_code()) { 
     135else  if ($err_code = $RCMAIL->imap->get_error_code()) { 
    136136  rcmail_display_server_error(); 
    137137} 
     
    143143$OUTPUT->set_env('search_request', $search_str ? $search_request : ''); 
    144144$OUTPUT->set_env('messagecount', $count); 
    145 $OUTPUT->set_env('pagecount', ceil($count/$IMAP->page_size)); 
     145$OUTPUT->set_env('pagecount', ceil($count/$RCMAIL->imap->page_size)); 
    146146$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($count, 1), $mbox); 
    147147$OUTPUT->send(); 
  • trunk/roundcubemail/program/steps/mail/sendmail.inc

    r5562 r5563  
    635635  // set replied/forwarded flag 
    636636  if ($COMPOSE['reply_uid']) 
    637     $IMAP->set_flag($COMPOSE['reply_uid'], 'ANSWERED', $COMPOSE['mailbox']); 
     637    $RCMAIL->imap->set_flag($COMPOSE['reply_uid'], 'ANSWERED', $COMPOSE['mailbox']); 
    638638  else if ($COMPOSE['forward_uid']) 
    639     $IMAP->set_flag($COMPOSE['forward_uid'], 'FORWARDED', $COMPOSE['mailbox']); 
     639    $RCMAIL->imap->set_flag($COMPOSE['forward_uid'], 'FORWARDED', $COMPOSE['mailbox']); 
    640640 
    641641} // End of SMTP Delivery Block 
     
    650650if ($store_target) { 
    651651  // check if folder is subscribed 
    652   if ($IMAP->mailbox_exists($store_target, true)) 
     652  if ($RCMAIL->imap->mailbox_exists($store_target, true)) 
    653653    $store_folder = true; 
    654654  // folder may be existing but not subscribed (#1485241) 
    655   else if (!$IMAP->mailbox_exists($store_target)) 
    656     $store_folder = $IMAP->create_mailbox($store_target, true); 
    657   else if ($IMAP->subscribe($store_target)) 
     655  else if (!$RCMAIL->imap->mailbox_exists($store_target)) 
     656    $store_folder = $RCMAIL->imap->create_mailbox($store_target, true); 
     657  else if ($RCMAIL->imap->subscribe($store_target)) 
    658658    $store_folder = true; 
    659659 
     
    685685            TRUE, FALSE); 
    686686    else { 
    687       $saved = $IMAP->save_message($store_target, $msg, $headers, $mailbody_file ? true : false); 
     687      $saved = $RCMAIL->imap->save_message($store_target, $msg, $headers, $mailbody_file ? true : false); 
    688688    } 
    689689 
     
    709709    // delete previous saved draft 
    710710    // @TODO: use message UID (remember to check UIDVALIDITY) to skip this SEARCH 
    711     $delete_idx = $IMAP->search_once($CONFIG['drafts_mbox'], 
     711    $delete_idx = $RCMAIL->imap->search_once($CONFIG['drafts_mbox'], 
    712712        'HEADER Message-ID '.$olddraftmessageid); 
    713713 
    714714    if ($del_uid = $delete_idx->getElement('FIRST')) { 
    715       $deleted = $IMAP->delete_message($del_uid, $CONFIG['drafts_mbox']); 
     715      $deleted = $RCMAIL->imap->delete_message($del_uid, $CONFIG['drafts_mbox']); 
    716716 
    717717      // raise error if deletion of old draft failed 
     
    734734  // remember new draft-uid ($saved could be an UID or TRUE here) 
    735735  if (is_bool($saved)) { 
    736     $draft_idx = $IMAP->search_once($CONFIG['drafts_mbox'], 'HEADER Message-ID '.$msgid); 
     736    $draft_idx = $RCMAIL->imap->search_once($CONFIG['drafts_mbox'], 'HEADER Message-ID '.$msgid); 
    737737    $saved     = $draft_idx->getElement('FIRST'); 
    738738  } 
  • trunk/roundcubemail/program/steps/mail/show.inc

    r5509 r5563  
    3131  } 
    3232 
    33   $mbox_name = $IMAP->get_mailbox_name(); 
     33  $mbox_name = $RCMAIL->imap->get_mailbox_name(); 
    3434 
    3535  // show images? 
     
    3838  // set message charset as default 
    3939  if (!empty($MESSAGE->headers->charset)) 
    40     $IMAP->set_charset($MESSAGE->headers->charset); 
     40    $RCMAIL->imap->set_charset($MESSAGE->headers->charset); 
    4141 
    4242  $OUTPUT->set_pagetitle(abbreviate_string($MESSAGE->subject, 128, '...', true)); 
     
    4848  $OUTPUT->set_env('sender', $MESSAGE->sender['string']); 
    4949  $OUTPUT->set_env('permaurl', rcmail_url('show', array('_uid' => $MESSAGE->uid, '_mbox' => $mbox_name))); 
    50   $OUTPUT->set_env('delimiter', $IMAP->get_hierarchy_delimiter()); 
     50  $OUTPUT->set_env('delimiter', $RCMAIL->imap->get_hierarchy_delimiter()); 
    5151  $OUTPUT->set_env('mailbox', $mbox_name); 
    5252 
     
    7878      && empty($MESSAGE->headers->flags['MDNSENT']) 
    7979      && empty($MESSAGE->headers->flags['SEEN']) 
    80       && ($IMAP->check_permflag('MDNSENT') || $IMAP->check_permflag('*')) 
     80      && ($RCMAIL->imap->check_permflag('MDNSENT') || $RCMAIL->imap->check_permflag('*')) 
    8181      && $mbox_name != $CONFIG['drafts_mbox'] 
    8282      && $mbox_name != $CONFIG['sent_mbox'] 
     
    249249  ($RCMAIL->action == 'show' || ($RCMAIL->action == 'preview' && intval($CONFIG['preview_pane_mark_read']) == 0))) 
    250250{ 
    251   if ($IMAP->set_flag($MESSAGE->uid, 'SEEN')) { 
     251  if ($RCMAIL->imap->set_flag($MESSAGE->uid, 'SEEN')) { 
    252252    if ($count = rcmail_get_unseen_count($mbox_name)) { 
    253253      rcmail_set_unseen_count($mbox_name, $count - 1); 
  • trunk/roundcubemail/program/steps/mail/viewsource.inc

    r4410 r5563  
    2525if ($uid = get_input_value('_uid', RCUBE_INPUT_GET)) 
    2626{ 
    27   $headers = $IMAP->get_headers($uid); 
     27  $headers = $RCMAIL->imap->get_headers($uid); 
    2828  $charset = $headers->charset ? $headers->charset : $CONFIG['default_charset']; 
    2929  header("Content-Type: text/plain; charset={$charset}"); 
    3030 
    3131  if (!empty($_GET['_save'])) { 
    32     $filename = ($headers->subject ? $IMAP->decode_header($headers->subject) : 'roundcube') . '.eml'; 
     32    $filename = ($headers->subject ? $RCMAIL->imap->decode_header($headers->subject) : 'roundcube') . '.eml'; 
    3333    $browser = $RCMAIL->output->browser; 
    3434 
     
    4444  } 
    4545 
    46   $IMAP->print_raw_body($uid); 
     46  $RCMAIL->imap->print_raw_body($uid); 
    4747} 
    4848else 
  • trunk/roundcubemail/program/steps/settings/folders.inc

    r5398 r5563  
    3131    $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP'); 
    3232    if (strlen($mbox)) { 
    33         $result = $IMAP->subscribe(array($mbox)); 
     33        $result = $RCMAIL->imap->subscribe(array($mbox)); 
    3434 
    3535        // Handle virtual (non-existing) folders 
    36         if (!$result && $IMAP->get_error_code() == -1 && 
    37             $IMAP->get_response_code() == rcube_imap::TRYCREATE 
     36        if (!$result && $RCMAIL->imap->get_error_code() == -1 && 
     37            $RCMAIL->imap->get_response_code() == rcube_imap::TRYCREATE 
    3838        ) { 
    39             $result = $IMAP->create_mailbox($mbox, true); 
     39            $result = $RCMAIL->imap->create_mailbox($mbox, true); 
    4040            if ($result) { 
    4141                // @TODO: remove 'virtual' class of folder's row 
     
    6363    $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP'); 
    6464    if (strlen($mbox)) { 
    65         $result = $IMAP->unsubscribe(array($mbox)); 
     65        $result = $RCMAIL->imap->unsubscribe(array($mbox)); 
    6666        if ($result) 
    6767            $OUTPUT->show_message('folderunsubscribed', 'confirmation'); 
     
    8181 
    8282        if (!$plugin['abort']) { 
    83             $deleted = $IMAP->delete_mailbox($plugin['name']); 
     83            $deleted = $RCMAIL->imap->delete_mailbox($plugin['name']); 
    8484        } 
    8585        else { 
     
    127127    $mbox_utf8 = get_input_value('_mbox', RCUBE_INPUT_POST, true); 
    128128    $mbox      = rcube_charset_convert($mbox_utf8, RCMAIL_CHARSET, 'UTF7-IMAP'); 
    129     $delimiter = $IMAP->get_hierarchy_delimiter(); 
     129    $delimiter = $RCMAIL->imap->get_hierarchy_delimiter(); 
    130130    $trash_regexp = '/^' . preg_quote($CONFIG['trash_mbox'] . $delimiter, '/') . '/'; 
    131131 
     
    134134        || preg_match($trash_regexp, $mbox) 
    135135    ) { 
    136         $success = $IMAP->clear_mailbox($mbox); 
     136        $success = $RCMAIL->imap->clear_mailbox($mbox); 
    137137        $delete = true; 
    138138    } 
    139139    // copy to Trash 
    140140    else { 
    141         $success = $IMAP->move_message('1:*', $CONFIG['trash_mbox'], $mbox); 
     141        $success = $RCMAIL->imap->move_message('1:*', $CONFIG['trash_mbox'], $mbox); 
    142142        $delete = false; 
    143143    } 
     
    165165    $name = trim(get_input_value('_mbox', RCUBE_INPUT_POST, true)); 
    166166 
    167     $size = $IMAP->get_mailbox_size($name); 
     167    $size = $RCMAIL->imap->get_mailbox_size($name); 
    168168 
    169169    // @TODO: check quota and show percentage usage of specified mailbox? 
     
    184184function rcube_subscription_form($attrib) 
    185185{ 
    186     global $RCMAIL, $IMAP, $CONFIG, $OUTPUT; 
     186    global $RCMAIL, $CONFIG, $OUTPUT; 
    187187 
    188188    list($form_start, $form_end) = get_form_tags($attrib, 'folders'); 
     
    201201 
    202202    // get folders from server 
    203     $IMAP->clear_cache('mailboxes', true); 
    204  
    205     $a_unsubscribed = $IMAP->list_unsubscribed(); 
    206     $a_subscribed   = $IMAP->list_mailboxes('', '*', null, null, true); // unsorted 
    207     $delimiter      = $IMAP->get_hierarchy_delimiter(); 
    208     $namespace      = $IMAP->get_namespace(); 
     203    $RCMAIL->imap->clear_cache('mailboxes', true); 
     204 
     205    $a_unsubscribed = $RCMAIL->imap->list_unsubscribed(); 
     206    $a_subscribed   = $RCMAIL->imap->list_mailboxes('', '*', null, null, true); // unsorted 
     207    $delimiter      = $RCMAIL->imap->get_hierarchy_delimiter(); 
     208    $namespace      = $RCMAIL->imap->get_namespace(); 
    209209    $a_js_folders   = array(); 
    210210    $seen           = array(); 
     
    214214    foreach ($a_unsubscribed as $i => $folder) { 
    215215        $folder_id     = $folder; 
    216         $folder        = $IMAP->mod_mailbox($folder); 
     216        $folder        = $RCMAIL->imap->mod_mailbox($folder); 
    217217        $foldersplit   = explode($delimiter, $folder); 
    218218        $name          = rcube_charset_convert(array_pop($foldersplit), 'UTF7-IMAP'); 
     
    284284 
    285285        if (!$protected) { 
    286             $attrs = $IMAP->mailbox_attributes($folder['id']); 
     286            $attrs = $RCMAIL->imap->mailbox_attributes($folder['id']); 
    287287            $noselect = in_array('\\Noselect', $attrs); 
    288288        } 
     
    404404$OUTPUT->set_pagetitle(rcube_label('folders')); 
    405405$OUTPUT->include_script('list.js'); 
    406 $OUTPUT->set_env('quota', $IMAP->get_capability('QUOTA')); 
     406$OUTPUT->set_env('quota', $RCMAIL->imap->get_capability('QUOTA')); 
    407407 
    408408// add some labels to client 
  • trunk/roundcubemail/program/steps/settings/func.inc

    r5562 r5563  
    876876function rcmail_update_folder_row($name, $oldname=null, $subscribe=false, $class_name=null) 
    877877{ 
    878     global $IMAP, $CONFIG, $OUTPUT; 
    879  
    880     $delimiter    = $IMAP->get_hierarchy_delimiter(); 
     878    global $RCMAIL, $CONFIG, $OUTPUT; 
     879 
     880    $delimiter    = $RCMAIL->imap->get_hierarchy_delimiter(); 
    881881    $name_utf8    = rcube_charset_convert($name, 'UTF7-IMAP'); 
    882882    $protected    = ($CONFIG['protect_default_folders'] == true && in_array($name, $CONFIG['default_imap_folders'])); 
    883883 
    884     $foldersplit  = explode($delimiter, $IMAP->mod_mailbox($name)); 
     884    $foldersplit  = explode($delimiter, $RCMAIL->imap->mod_mailbox($name)); 
    885885    $level        = count($foldersplit) - 1; 
    886886    $display_name = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $level) 
  • trunk/roundcubemail/program/steps/settings/save_folder.inc

    r5096 r5563  
    3434// $path is in UTF7-IMAP already 
    3535 
    36 $delimiter = $IMAP->get_hierarchy_delimiter(); 
     36$delimiter = $RCMAIL->imap->get_hierarchy_delimiter(); 
    3737$options = strlen($old_imap) ? rcmail_folder_options($old_imap) : array(); 
    3838 
     
    104104 
    105105    if (!$plugin['abort']) { 
    106         $created = $IMAP->create_mailbox($folder['name'], $folder['subscribe']); 
     106        $created = $RCMAIL->imap->create_mailbox($folder['name'], $folder['subscribe']); 
    107107    } 
    108108    else { 
Note: See TracChangeset for help on using the changeset viewer.