Ejemplo n.º 1
0
 /**
  * Controller Redirect
  * @param string $controller
  * @param array $params
  */
 protected function redirect($controller = '', array $params = array())
 {
     $redirectString = empty($controller) ? "Location: index.php" : "Location: index.php?module={$controller}";
     if (count($params)) {
         $redirectString .= '&' . http_build_query($params);
     }
     if (is_object($this->events)) {
         $this->events->runEvent('controllerRedirect', $redirectString);
     }
     header($redirectString);
 }
Ejemplo n.º 2
0
 /**
  * Versendet E-Mail
  * @return boolean
  */
 public function submit()
 {
     $headers = array();
     $headers[] = 'FROM: ' . $this->from;
     $headers[] = 'X-Mailer: FanPressCM3/PHP' . PHP_VERSION;
     if ($this->html) {
         $headers[] = 'MIME-Version: 1.0';
         $headers[] = 'Content-type: text/html; charset=utf-8';
     }
     $eventData = $this->events->runEvent('emailSubmit', array('headers' => $headers, 'maildata' => array('to' => $this->to, 'from' => $this->from, 'subject' => utf8_decode($this->subject), 'text' => $this->html ? $this->text : utf8_decode($this->text))));
     $headers = $eventData['headers'];
     foreach ($eventData['maildata'] as $key => $value) {
         $this->{$key} = $value;
     }
     if (!mail($this->to, $this->subject, $this->text, implode(PHP_EOL, $headers))) {
         trigger_error("Unable to send e-mail \"{$this->subject}\" to \"{$this->to}\".\n----------\n{$this->text}");
         return false;
     }
     return true;
 }