alecpl
2008-08-26 9e8e5fa634ace418e6b34280133685485b97a9c0
program/include/rcube_imap.php
@@ -81,17 +81,6 @@
  /**
   * PHP 4 object constructor
   *
   * @see  rcube_imap::__construct
   */
  function rcube_imap($db_conn)
    {
    $this->__construct($db_conn);
    }
  /**
   * Connect to an IMAP server
   *
   * @param  string   Host to connect
@@ -342,6 +331,21 @@
    {
    $cap = strtoupper($cap);
    return $this->capabilities[$cap];
    }
  /**
   * Checks the PERMANENTFLAGS capability of the current mailbox
   * and returns true if the given flag is supported by the IMAP server
   *
   * @param   string  Permanentflag name
   * @return  mixed   True if this flag is supported
   * @access  public
   */
  function check_permflag($flag)
    {
    $flagsmap = $GLOBALS['IMAP_FLAGS'];
    return (($imap_flag = $flagsmap[strtoupper($flag)]) && in_array_nocase($imap_flag, $this->conn->permanentflags));
    }
@@ -1315,6 +1319,8 @@
      $result = iil_C_Undelete($this->conn, $this->mailbox, join(',', array_values($msg_ids)));
    else if ($flag=='UNSEEN')
      $result = iil_C_Unseen($this->conn, $this->mailbox, join(',', array_values($msg_ids)));
    else if ($flag=='UNFLAGGED')
      $result = iil_C_UnFlag($this->conn, $this->mailbox, join(',', array_values($msg_ids)), 'FLAGGED');
    else
      $result = iil_C_Flag($this->conn, $this->mailbox, join(',', array_values($msg_ids)), $flag);
@@ -2522,19 +2528,19 @@
    $folders = array_merge($a_defaults, array_keys($folders));
    // finally we must rebuild the list to move 
    // subfolders of default folders to their place
    // subfolders of default folders to their place...
    // ...also do this for the rest of folders because
    // asort() is not properly sorting case sensitive names
    while (list($key, $folder) = each($folders)) {
      $a_out[] = $folder;
      unset($folders[$key]);
      if (in_array(strtolower($folder), $this->default_folders_lc)) {
   foreach ($folders as $idx => $f) {
     if (strpos($f, $folder.$delimiter) === 0) {
           $a_out[] = $f;
       unset($folders[$idx]);
       }
      foreach ($folders as $idx => $f) {
   if (strpos($f, $folder.$delimiter) === 0) {
         $a_out[] = $f;
     unset($folders[$idx]);
     }
   reset($folders);
   }
        }
      reset($folders);
      }
    return $a_out;