Example #1
0
        unset($time);
        #die('-'.$max.'/'.($max-time()));
        require_once 'lib/r304.php';
        r304($max);
    }
}
$shutdown = [];
register_shutdown_function(function () {
    global $noshutdown, $anotations;
    if ($noshutdown or args(',nofun', 1)) {
        return;
    }
    #for media thumbnails dynamic generation
    if (args(',headerssentcheck', 1)) {
        if (headers_sent($file, $line)) {
            wmail('*****@*****.**', 'headers sent', SU . "\n" . $file . ':' . $line);
        } else {
            if (J8 || J9) {
                header("Cache-Control: private", 1);
            }
            #cumulé depuis J9 à J11
            if (function_exists('GT') && defined('J9') && J9) {
                gt('die');
            }
            header('A: shutdowns: ' . $_ENV['lasttime'], 1);
        }
    }
    if ($anotations && filemtime(SFN) > filemtime(PATHANOT)) {
        #si fichier changé depuis dernier cache anotations
        file_put_contents(PATHANOT, igbinary_serialize($anotations));
    }
Example #2
0
    Adds($email);
    Adds($ms);
    Adds($k);
    #if(ereg("seflow.it",HOST)or(ereg("email@",$email))or
    if (Preg_Match("#(\\[url|href)=#i", $message)) {
        r404();
    }
    $ms = "Nom: {$nom} ({$tel}) <br>email : {$email}<br>{$city}<br>{$message}<br><br>--- {$k} {$t}" . IP;
    $ms = str_replace('"', '', $ms);
    #if(admin)die($ms);
    #SQL5("insert into ben.contact(`nom`,`tel`,`email`,`message`,`key`,`date`)values(\"$nom\",\"$tel\",\"$email\",\"$ms\",\"$k\",NOW())");
    $as = $de = $email;
    /*email renseigné dans form*/
    $headers = "MIME-Version: 1.0{$s}Content-type: text/html; charset=iso-8859-1{$s}From:{$as}{$s}Return-Path:{$as}{$s}Reply-To:{$as}{$s}";
    $msg = $ms;
    $x = wmail($mail, $subject, $msg, $headers);
    if (!$x) {
        $subject .= ' (try#2 -> bmail)';
        $x = Bmail(compact('subject', 'msg', 'mail', 'de', 'as'));
    }
    if (!$x) {
        $subject .= ' (try#3 ->  swap the sender with admin)';
        $de = $as = ADMINEMAIL;
        $x = Bmail(compact('subject', 'msg', 'mail', 'de', 'as'));
    }
    #die('<pre>'.print_r(compact('_POST','umail','email','as','de','mail','subject','msg','headers'),1));
    die("<script>location.href='?ok=1';</script><a href='?ok=1'>Thanks for your message</a>");
}
if ($ok == 1) {
    $t2 = "Thanks for your message";
}
Example #3
0
function SmtpMail($SmtpServer, $portsmtp = 25, $SmtpUser = '', $SmtpPass = '', $from = '', $to = '', $sub = '', $body = '', $host = H, $html = 0)
{
    if ($SmtpServer == 'a74') {
        $SmtpServer = 'a74.fr';
    }
    #correction
    if (is_array($SmtpServer)) {
        extract($SmtpServer);
    }
    $lf = "\r\n";
    if (!$from) {
        $from = $SmtpUser;
    }
    #tout d'un block
    if (strpos($from, '@gmail.com')) {
        return Gmail($SmtpServer, $portsmtp = 25, $SmtpUser, $SmtpPass, $from, $to, $sub, $body, $host = h);
    }
    $body = str_replace("\n", "<br>", $body);
    #$body=str_replace("\n","\r\n",$body);
    if ($html) {
        $body = $lf . 'MIME-Version: 1.0' . $lf . 'Content-type: text/html; charset=iso-8859-1' . $lf . $lf . $body;
    } else {
        $body = $lf . $lf . $body;
    }
    try {
        if ($x = fsockopen($SmtpServer, $portsmtp)) {
            $data = ["EHLO " . $host, 'auth login', base64_encode($SmtpUser), base64_encode($SmtpPass), "MAIL FROM: <{$SmtpUser}>", "RCPT TO: {$to}", "DATA"];
            foreach ($data as $z) {
                fputs($x, $z . $lf);
                $talk[trim(fgets($x, 1024))] = $z . '_' . time();
            }
            fputs($x, "To: " . $to . $lf . "From: " . $from . $lf . "Subject:" . $sub . $body . $lf . '.' . $lf);
            $talk[trim(fgets($x, 256))] = 'send';
            fputs($x, "QUIT" . $lf);
            $talk[trim(fgets($x, 256))] = 'quit';
            fclose($x);
            return $talk;
        }
    } catch (Exception $e) {
        return wmail($to, Accents($sub), $e->getMessage() . $body);
        #Date: 19/12/2009 23:59:59\n
    }
    #
}