Example #1
0
 /**
  * @param array(string) addresses to send message to
  * @param message string
  * @param messageParam array(string)
  * @param message subject
  * @param message subjParam
  * @return void
  * @access public
  */
 function CMS_setMessages($addresses, $message, $subject, $withApplicationLabel = true)
 {
     // loop through addresses and create email message
     foreach ($addresses as $address) {
         $email = new CMS_email();
         if ($email->setEmailTo($address)) {
             $email->setSubject($subject, $withApplicationLabel);
             $email->setBody($message);
             $this->_messages[] = $email;
         } else {
             $this->raiseError("Email Catalog: mail not registered:" . $address);
         }
     }
 }
Example #2
0
    $body .= 'The requested file : ' . CMS_websitesCatalog::getMainURL() . $_SERVER['REQUEST_URI'] . ' was not found.' . "\n\n";
    $body .= 'From (Referer) : ' . (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '') . "\n\n";
    $body .= 'Date : ' . date('r') . "\n\n";
    if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
        $body .= 'User : '******'REMOTE_ADDR'] . ' (' . $_SERVER['HTTP_ACCEPT_LANGUAGE'] . ')' . "\n\n";
    } else {
        $body .= 'User : '******'REMOTE_ADDR'] . "\n\n";
    }
    if (isset($_SERVER['HTTP_USER_AGENT'])) {
        $body .= 'Browser : ' . $_SERVER['HTTP_USER_AGENT'] . "\n\n";
    }
    $body .= 'Host : ' . $_SERVER['HTTP_HOST'] . ' (' . $_SERVER['SERVER_ADDR'] . ")\n\n";
    $body .= 'This email is automaticaly sent from your website. You can stop this sending with the parameter ERROR404 EMAIL ALERT.';
    $mail = new CMS_email();
    $mail->setSubject("404 Error in " . APPLICATION_LABEL);
    $mail->setBody($body);
    $mail->setEmailFrom(APPLICATION_POSTMASTER_EMAIL . "<" . APPLICATION_POSTMASTER_EMAIL . ">");
    $mail->setEmailTo(APPLICATION_MAINTAINER_EMAIL);
    $mainURL = CMS_websitesCatalog::getMainURL();
    $cms_language = CMS_languagesCatalog::getByCode('en');
    $mail->setFooter($cms_language->getMessage(CMS_emailsCatalog::MESSAGE_EMAIL_BODY_URLS, array(APPLICATION_LABEL, $mainURL . "/", $mainURL . PATH_ADMIN_WR . "/")));
    $mail->setTemplate(PATH_MAIL_TEMPLATES_FS);
    $mail->sendEmail();
}
//try to get website by path to serve specific 404 page
$path = pathinfo(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), PATHINFO_DIRNAME);
$website = null;
if ($path && $path != '/') {
    $websites = CMS_websitesCatalog::getAll('order');
    foreach ($websites as $website) {
        if ($website->getPagesPath(PATH_RELATIVETO_WEBROOT)) {