Beispiel #1
0
function ggtracker()
{
    rem($ref, $_ENV['yt']['ref'], refe);
    #.refe  Car déjà enregistré
    $files = "ico|eot|ttf|js|css|htc|woff|swf|xml|gif|png|bmp|flv|mp(3|4)|exe|jpe?g|aspx?";
    #bad extensions
    $bp = "~\\?(jsr?|css|rss)|Final|visuall|zsimu|contact2?\\.php|suivi|s74.fr|4Test|(zsimu|2001|admin|intranet|sql)/|z/\\!|/!|/y/|\\.({$files})\$~i";
    #bad url
    $bR = "~(a74|xzxzx|dc10)\\.fr|frontaliers\\.info|yahooapi|url=|\\.(s?html|{$files})\$~i";
    #bad referer : can't be the referer,ex:referal spam
    #shall be recorded on first step !
    if (stripos(' ' . $ref . refe, '<a href')) {
        Block(array('badref', $ref . refe));
    } elseif (h == 'cli') {
        $x = 'cli';
    } elseif (bots) {
        $x = 'bots';
    } elseif (!$GLOBALS['tracker']) {
        $x = '!tracker';
    } elseif ($GLOBALS['notracker']) {
        $x = 'notracker';
    } elseif ($_ENV['yt']['lw'] + 600 > now) {
        $x = 'lw<600';
    } elseif (Preg_Match('~SID|css|js|jsr~is', q)) {
        $x = 'badq';
    } elseif (Preg_Match("~\\.({$files})\$~is", u)) {
        $x = 'badfiletype';
    } elseif (Preg_Match("~yandsearch|saihm|seoheap|internesdedijon|(a74|xzxzxz)\\.fr~is", REFE . Q . $ref)) {
        $x = 'badref';
    } elseif (Preg_Match("~(Tag|2|zsimu|qform|contact2?)\\.php|Final|dev3|/(3p|mut|!r|\\?|sql|2001|intranet)~is", u)) {
        $x = 'badurl';
    } elseif (Preg_Match($bp, $ref, $t)) {
        $x = 'ref:badpat(u)';
    } elseif (Preg_Match($bp, u, $t2)) {
        $x = 'url:badpat';
    } elseif (Preg_Match($bR, refe . $ref, $t3)) {
        $x = 'ref:badpat(R)';
    } elseif (preg_match("~\\.(php|s?html?)\$~", u)) {
        $x = 11;
    } elseif (strpos(substr($v, -5), '.') > -1) {
        $x = 'is not php or shtml : other filetype';
    } else {
        $x = 12;
    }
    #unknown
    if (!is_numeric($x)) {
        null;
    } else {
        G2('k1');
        #si le fichier existe déjà sur le serveur, cette valeur est récupérée, puis inserée de nouveau pour marquer l'autre site avec le meme mot clés
        #$y=Preg_replace('`&(babsrc|affid|mntrid|channel|client|clientcop|source|gs_rfai|ei|btng|spell|resnum|sourceid|channel|filetype|vertical|_iceurlflag|_iceurl)=([^&]+)`is','',$y);
        $y = str_replace(array('search/z/results/', '/fr/results/index/q/', 'search/', 'search?w=tot', 'as_q=', 'custom&q=', '&aqa=', '&aqp=', '/web/', 'rdata=', 'lts/&q='), '&q=', $ref);
        $y = str_replace(array('search/srpcache', 'linkdoctor', 'toggle=1', 'sa=n', 'ei=', 'prmd=mc', 'hl=fr', 'rls=', 'org.mozilla:fr', ':official', 'firefox-a', 'http://', 'www.', 'fr.', 'search.', 'aq=', 'oq=', 'aqi=', 'fkt=', 'fsdt=', 'fr=yfp-t-703', 'meta=lr', 'source=hp', 'aql=', 'hs=', 'tbo=s', 'rlz=', 'searchal', 'utf-8', 'ie=', 'oe=', 'sourceid=', 'nabclient', 'gfns=', '/bottomnavigation', '/relevance', '%22', 'recherche google', 'ved=', 'ct=', 'sa=x', 'oi=spell', 'rlz=', 'hl=fr', 'oq=', 'linkdoctor', 'safari', 'redir_esc=', 'ie=', 'oe=', 'utf-8', 'aq=', 'rls=', 'org.mozilla:', 'fr:official', 'meta=', 'gs_rfai=', 'aqi=', 'ql=', 'navclient', 'usg=', 'vc=', 'safe=', 'active', 'com.microsoft', 'en-gb', 'searchbox', 'ecofree.org/search.php', 'pid=', 'search.daum.net', 'results&', 'itag=ody', 'search&', '&hl=fr', 'topnavigation/', 'relevance/', 'iq=true/', 'zoom=off/', '=7', '&oq=', '&aq=', '&cx=', 'partner-', 'mb-', 'pub-'), '&', $y);
        $y = trim(Preg_replace("~[&]{2,}~", '&', $y), ' &');
        $mots = kwd($y);
        #travaux de nettoyage du referrer =)
        if ($mots && !strpos($mots, 'provided') && !in_Array($mots, array('', ':'))) {
            $mots = Tridecoder($mots);
            $mots = Preg_replace("~((google|yahoo|bing|yandex|gooofullcom|vizzeo|.?chiadah|find\\.eu|ke\\.voila|voila|seexie|askpeter|iadah|yougoo|yhs4|ecosia)\\.|search;|cx=|goooful|(\\.fr)?iadah\\.com).*|\\.it\$~is", '', $mots);
            $trop = explode(',', "_,</a>,< a>,<a href=,refineobj:video,google.ca,google.ci,google.co.uk ,url ,google.fr ,google.com ,search ,hl=en,sa=t,spider.htm");
            $mots = trim(str_replace($trop, '', $mots));
            #synchronisation des bibliothècas,maintenance
            if (preg_match("~^.(ttp&%2f%2f|ttp:)~is", $mots) or strlen($mots) < 3) {
                Null;
            } elseif ($_ENV['yt']['mots'] == $mots || $_ENV['yt']['fmt']['kw'] + 600 > NOW) {
                null;
            } else {
                #Nouveau mot clé
                if (preg_match("~q=([^&]+)~is", $mots, $t)) {
                    $mots = $t[1];
                }
                if (Preg_Match_ALL("~" . BKW . "~i", $mots, $t)) {
                    Block($t[0], $mots);
                }
                #blockage de l'IP et throw 404
                if (Preg_Match("~bestof~is", U)) {
                    $mots = '';
                }
                #cancel
                if ($mots) {
                    #if(!$_ENV['yt']){$_ENV['yt']=Array();DBM('!yt',"<pre>".STARTER."-$mots</pre>",'a6');}$i=$_ENV['yt'];
                    $yt2 = array('lw' => NOW, 'date' => date("Y/m/d H:i:s"), 'mots' => $mots, array('fmt' => array('kw' => NOW)));
                    if ($_ENV['yt']['mots']) {
                        $yt2['mots-1'] = $_ENV['yt']['mots'];
                    }
                    #DBM('ggt',"<pre>$mots,".print_r($_ENV['yt'],1).'</pre>','gg9');
                    if (Preg_Match("~gclid=|aclk\\?~is", $_ENV['yt']['ref'])) {
                        $yt2['adwords'] = $mots;
                    } elseif (0) {
                        #insertions sql //todo:file_append puis écriture en lots
                        $x2 = sql5("UPDATE CSF set site='" . H . "',hits=hits+1,ip='" . IP . "',time=" . NOW . ",date=now(),Ref=\"{$ref}\" {$s1} where url=\"" . SU . "\" and keyword=\"{$mots}\" order by id ASC limit 1");
                        if ($x2 < 1) {
                            sql5("INSERT INTO CSF(ip,Ref,site,keyword,url,position,time,date)VALUES('" . IP . "',\"{$ref}\",'" . H . "',\"{$mots}\",\"" . SU . "\",'{$pos}'," . NOW . ",NOW())");
                        }
                        #INSERT INTO CSF SET key = 'key', generation = 'generation' ON DUPLICATE KEY UPDATE key = 'key', generation = (generation + 1);
                    }
                    #$_SESSION['st1']=$magic;#$_SESSION['mots']=$mots;
                    $magic = "{$mots};" . $_ENV['yt']['dlp'] . ";" . $_ENV['yt']['ref'];
                    setcookie('kw', $mots, 1484045758);
                    setcookie('dlp', $magic, 1484045758);
                }
            }
            if (is_array($yt2)) {
                $_ENV['yt'] = Array_merge($_ENV['yt'], $yt2);
                FAP(IPF, $_ENV['yt']);
            }
            redef('motcle', $mots);
        }
    }
}
Beispiel #2
0
 /**
  * Cleans up on logout
  *
  * NOTE: this presumes the general form of an authrization cookie is:
  * zp_xxxxx_auth where xxxxx is the authority (e.g. gallery, image, search, ...)
  */
 function handleLogout()
 {
     global $_zp_loggedin, $_zp_pre_authorization;
     $candidate = array();
     if (isset($_COOKIE)) {
         $candidate = $_COOKIE;
     }
     if (isset($_SESSION)) {
         $candidate = Array_merge($candidate, $_SESSION);
     }
     $candidate = array_unique($candidate);
     foreach ($candidate as $cookie => $value) {
         switch ($cookie) {
             default:
                 if (!preg_match('/zp_(.*)_auth/', $cookie, $result)) {
                     break;
                     // not an auth cookie
                 }
             case 'zenphoto_auth':
                 zp_setCookie($cookie, "*", -368000);
                 break;
         }
     }
     $_zp_loggedin = false;
     $_zp_pre_authorization = array();
     return true;
 }
/**
 * Returns the data from the last comment posted
 * @param bool $numeric Set to true for old themes to get 0->6 indices rather than descriptive ones
 *
 * @return array
 */
function getCommentStored($numeric = false)
{
    global $_zp_comment_stored;
    $stored = array('name' => $_zp_comment_stored[0], 'email' => $_zp_comment_stored[1], 'website' => $_zp_comment_stored[2], 'comment' => $_zp_comment_stored[3], 'saved' => $_zp_comment_stored[4], 'private' => $_zp_comment_stored[5], 'anon' => $_zp_comment_stored[6], 'custom' => $_zp_comment_stored[7]);
    if ($numeric) {
        return Array_merge($stored);
    }
    return $stored;
}
Beispiel #4
0
function JoindreFichier($A, $F, $i = 0)
{
    if (!is_Array($A)) {
        return;
    }
    #JoinFichier($A,L2."missurl.db"); serialize array as input
    if ($i) {
        $x = FGC($F);
        foreach ($A as $k) {
            $x[$k]++;
        }
        FPC($F, $x);
        return 1;
    }
    $x = FGC($F);
    if (is_Array($x)) {
        $x = Array_merge($x, $A);
    } else {
        $x = $A;
    }
    FPC($F, $x);
    return 1;
}
$plugin_description = gettext("Provides a means for placing a user logout link on your theme pages.");
$plugin_author = "Stephen Billard (sbillard)";
$plugin_version = '1.0.0';
$plugin_URL = "http://www.zenphoto.org/documentation/plugins/_plugins---user_logout.php.html";
$cookiepath = WEBPATH;
if (WEBPATH == '') {
    $cookiepath = '/';
}
if (!OFFSET_PATH) {
    $cookies = array();
    $candidate = array();
    if (isset($_COOKIE)) {
        $candidate = $_COOKIE;
    }
    if (isset($_SESSION)) {
        $candidate = Array_merge($candidate, $_SESSION);
    }
    $candidate = array_unique($candidate);
    foreach ($candidate as $cookie => $value) {
        if ($cookie == 'zenphoto_auth' || $cookie == 'zp_gallery_auth' || $cookie == 'zp_search_auth' || strpos($cookie, 'zp_album_auth_') !== false) {
            $cookies[] = $cookie;
        }
    }
    if (isset($_GET['userlog'])) {
        // process the logout.
        if ($_GET['userlog'] == 0) {
            foreach ($cookies as $cookie) {
                zp_setcookie($cookie, "", time() - 368000, $cookiepath);
            }
            $_zp_loggedin = false;
            $saved_auth = NULL;
Beispiel #6
0
 /**
  * Converts CSS queries into equivalent XPath (1.0)
  *
  * @api
  * @param       string  $query          The CSS query to translate into XPath
  * @return      string                  An XPath query string
  *
  * @todo        fix     : Attribute selectors cannot be used without an element in XPath, e.g. `//[@href]`,
  *                        we'll need to insert `*` if no element has yet been specified
  * @todo        feature : Non-standard selectors, e.g. "<" parent, "-" previous sibling, "!=" inequal comparator
  */
 public function translateQuery($query)
 {
     //@todo: return what for an empty query?
     /* leading & trailing whitespace is stripped so as not to be
      * confused for a CSS 'descendant combinator', i.e. 'a b' */
     if (empty($query = trim($query))) {
         return NULL;
     }
     //return from cache if possible:
     if (in_array($query, $this->cache)) {
         return $this->cache[$query];
     }
     //begin with the default Axis, then translate the CSS query into XPath Parts
     $results = Array_merge(array(array(self::STEP_AXIS, $this->default_axis)), $this->translate($query));
     //convert our chain of XPath Parts into an XPath string
     return array_reduce($results, function ($xpath, $step) {
         static $last_step;
         $last_step = $step;
         /** @todo Fill in missing steps */
         return $xpath .= $step[1];
     });
 }