| | |
| | | public $mime_parts = array(); |
| | | public $attachments = array(); |
| | | public $subject = ''; |
| | | public $sender = null; |
| | | public $is_safe = false; |
| | | |
| | | |
| | |
| | | $this->uid = $uid; |
| | | $this->headers = $this->imap->get_headers($uid); |
| | | $this->subject = rcube_imap::decode_mime_string($this->headers->subject, $this->headers->charset); |
| | | list(, $this->sender) = each($this->imap->decode_address_list($this->headers->from)); |
| | | |
| | | $this->is_safe = (intval($_GET['_safe']) || $_SESSION['safe_messages'][$uid]) ? true : false; |
| | | $_SESSION['safe_messages'][$uid] = $this->is_safe; |
| | | $this->set_safe((intval($_GET['_safe']) || $_SESSION['safe_messages'][$uid])); |
| | | |
| | | $this->opt = array( |
| | | 'safe' => $this->is_safe, |
| | |
| | | */ |
| | | public function get_header($name, $raw = false) |
| | | { |
| | | $value = $this->header->$name; |
| | | $value = $this->headers->$name; |
| | | return $raw ? $value : $this->imap->decode_header($value); |
| | | } |
| | | |
| | | /** |
| | | * Set is_safe var and session data |
| | | * |
| | | * @param bool enable/disable |
| | | */ |
| | | public function set_safe($safe = true) |
| | | { |
| | | $this->is_safe = $safe; |
| | | $_SESSION['safe_messages'][$this->uid] = $this->is_safe; |
| | | } |
| | | |
| | | /** |
| | | * Compose a valid URL for getting a message part |
| | |
| | | $this->parts[] = $print_part; |
| | | } |
| | | // show plaintext warning |
| | | else if ($html_part !== nullL && empty($this->parts)) { |
| | | else if ($html_part !== null && empty($this->parts)) { |
| | | $c = new stdClass; |
| | | $c->type = 'content'; |
| | | $c->body = rcube_label('htmlmessage'); |