Location: PHPKode > projects > Pindorama > pindorama/index.php
<?php
/************************************************************
 *                                                          *
 *      Pindorama Core Configuration v. 0.11                *
 *      Guilherme Capilé <hide@address.com>           *
 *                                                          *
 ************************************************************/

error_reporting (E_ALL ^ E_NOTICE);
function getmicrotime()
{
    list($usec, $sec) = explode(" ",microtime()); 
    return ((float)$usec + (float)$sec); 
}
$log_start = getmicrotime();

$_SERVER["PATH_TRANSLATED"] = ($_SERVER["pindorama_base"] != "")?($_SERVER["pindorama_base"]."/active/index.php"):(str_replace(array("\\", "//", "/index.php"), array("/", "/", "/active/index.php"), $_SERVER["PATH_TRANSLATED"]));
$_SERVER["SCRIPT_FILENAME"] = $_SERVER["PATH_TRANSLATED"];
$url = $_GET["url"];
$ourl = $_SERVER["SCRIPT_NAME"];
$oqs = $_SERVER["QUERY_STRING"];
$url = (substr($url, 0, 1) == '"' && substr($url, -1) == '"')?(substr($url, 1, strlen($url) -2)):($url);
$ref = $_SERVER["HTTP_REFERER"];
if (preg_match("/^https?\:\/\//", $url)) {
    $urli = parse_url($url);
} else {
    if (strpos($url, "?") !== false) {
        $urli["query"] = substr($url, strpos($url, "?") +1); 
        $urli["path"] = substr($url, 0, strpos($url, "?"));
    } else {
        $urli["query"] = ""; 
        $urli["path"] = $url;
    }
}
if (strpos($ref, "?") !== false) {
    $refi["query"] = substr($ref, strpos($ref, "?") +1); 
    $refi["path"] = substr($ref, 0, strpos($ref, "?"));
} else {
    $refi["query"] = ""; 
    $refi["path"] = $ref;
}
//$refi = parse_url($ref);
$refqs = $refi["query"];
$refqsi = array();
parse_str($refqs, $refqsi);
$qs = $urli["query"];
$qsi = array();
parse_str($qs, $qsi);
$c["redirect_base"] = ($_SERVER["pindorama_url"] != "")?($_SERVER["pindorama_url"]."?url="):("{$ourl}?url=");
$_SERVER["SCRIPT_NAME"] = ($urli["path"] != "")?($urli["path"]):("/");
$_SERVER["PHP_SELF"]    = $_SERVER["SCRIPT_NAME"];
$_SERVER["REQUEST_URI"] = ($url != "")?($url):("/");
$_SERVER["QUERY_STRING"] = $qs;
$_SERVER["HTTP_REFERER"] = $refqsi["url"];
$_SERVER["redirect_base"] = $c["redirect_base"];
$_GET = $qsi;
chdir(dirname($_SERVER["PATH_TRANSLATED"]));
require_once("config/core.php");
require_once("config/error.php");
require_once("components/core.php");
require_once("components/login.php");

if ($urli["host"] != "" && substr($url, 0, strlen($c["host"])) != $c["host"]) {
    $c["host"] = "";
    $c["redirect_base"] = "";
    pin_redirect($url);
    exit();
} else if (substr($_SERVER["REQUEST_URI"], 0, strlen($c["redirect_base"])) == $c["redirect_base"]) {
    $c["host"] = "";
    $c["redirect_base"] = "";
    pin_redirect($_SERVER["REQUEST_URI"]);
    exit();
} else if ($url == "" && $ref != "" && $oqs != "") {
    $redirect = preg_replace('/\%3F.*/', "", $ref).urlencode("?".$oqs);
    $c["host"] = "";
    $c["redirect_base"] = "";
    pin_redirect($redirect);
    exit();
}
/*
header("Content-type: text/plain");
print_r($_SERVER);
exit();
*/
ob_start("pin_url2query");
pin_xml_request();
pin_login();
pin_process_request();
pin_log_xpml($param["host"]." ".$param["auth-user"]." ".$_SERVER["PHP_SELF"]." duration: ".(getmicrotime() - $log_start));
$str = ob_get_contents();
ob_end_clean();
$str = pin_url2query($str, $c["redirect_base"]);
@header("Content-length: ".strlen($str));
exit($str);

?>
Return current item: Pindorama