public function get_permflags($folder)
    {
        if (!strlen($folder)) {
            return array();
        }

        if (!$this->check_connection()) {
            return array();
        }

        if ($this->conn->select($folder)) {
            $permflags = $this->conn->data['PERMANENTFLAGS'];
        }
        else {
            return array();
        }

        if (!is_array($permflags)) {
            $permflags = array();
        }

        return $permflags;
    }