mcramer
2012-06-18 a932880cc9dcd6da7e42f5a69534322c79f75953
interface/lib/classes/functions.inc.php
@@ -34,7 +34,7 @@
class functions {
   
   public function mail($to, $subject, $text, $from, $filepath = '', $filetype = 'application/pdf', $filename = '') {
   public function mail($to, $subject, $text, $from, $filepath = '', $filetype = 'application/pdf', $filename = '', $cc = '', $bcc = '') {
      global $app,$conf;
      
      if($conf['demo_mode'] == true) $app->error("Mail sending disabled in demo mode.");
@@ -53,7 +53,9 @@
            unset($path_parts);
         }
         $header = "Return-Path: $form\nFrom: $from\nReply-To: $from\n";
         $header = "Return-Path: $from\nFrom: $from\nReply-To: $from\n";
         if($cc != '') $header .= "Cc: $cc\n";
         if($bcc != '') $header .= "Bcc: $bcc\n";
         $header .= "MIME-Version: 1.0\n";
         $header .= "Content-Type: multipart/mixed; boundary=$uid\n";
@@ -74,6 +76,8 @@
         mail($to, $subject, "", $header);
      } else {
         $header = "From: $from\nReply-To: $from\n";
         if($cc != '') $header .= "Cc: $cc\n";
         if($bcc != '') $header .= "Bcc: $bcc\n";
         $header .= "Content-Type: text/plain;\n\tcharset=\"UTF-8\"\n";
         $header .= "Content-Transfer-Encoding: 8bit\n\n";
         $subject      = "=?utf-8?B?".base64_encode($subject)."?=";
@@ -101,7 +105,7 @@
   }
   
   public function get_ispconfig_url() {
      $url = (stristr($_SERVER['SERVER_PROTOCOL'],'HTTPS'))?'https':'http';
      $url = (stristr($_SERVER['SERVER_PROTOCOL'],'HTTPS') || stristr($_SERVER['HTTPS'],'on'))?'https':'http';
      $url .= '://'.$_SERVER['SERVER_NAME'];
      if($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) {
         $url .= ':'.$_SERVER['SERVER_PORT'];