';
print_r($_GET);
echo 'POST VARIABLES::
';
print_r($_POST);
echo 'FILES VARIABLES::
';
print_r($_FILES);
echo 'SESSION VARIABLES::
';
print_r($_SESSION);
} else {
$_SESSION['debugging']=false;
set_error_handler('logger::error_handler');
}
require_once(INCLUDE_DIR.'logout_idle.inc'); //Logout when idle
//initializing node
$node = nodes::getNodeById($_GET['node_id'],(isset($_SESSION['user_id']))?$_SESSION['user_id']:'');
//XXX Paths are wrong (!)
//loading smarty template engine and setting main parameters
require(SMARTY_DIR.'Smarty.class.php');
$smarty = new Smarty;
require(INCLUDE_DIR.'smarty/resource.kyberia.php');
$smarty->default_resource_type=$smarty_resource;
//$smarty->php_handling = SMARTY_PHP_REMOVE; //XXX
$smarty->template_dir = TEMPLATE_DIR;
//echo TEMPLATE_DIR.TEMPLATE_SET;
//echo $smarty->template_dir;
$smarty->compile_dir = SYSTEM_DATA.'templates_c/';
$smarty->config_dir = SMARTY_DIR.'configs/'; //XXX neexistuje
$smarty->cache_dir = SMARTY_DIR.'cache/';
$smarty->plugins_dir = SMARTY_PLUGIN_DIR ;
if (isset($_SESSION['debugging']) && $_SESSION['debugging']) $smarty->debugging=true;
// initializing variables
// preg_replace prevents LFI
if (empty($_POST['event'])) $event='display';
else $event= preg_replace( "![^a-zA-Z0-9_]+!", "", $_POST['event']);
if (isset($_SESSION['debugging']) && $_SESSION['debugging']) {
echo "
NODE::"; print_r($node); echo ""; } if ((isset($_SESSION['user_id']) && ($node['node_creator']==$_SESSION['user_id']))) { $node['node_permission']='owner'; } if (isset($_SESSION['cube_vector']) && ($_SESSION['cube_vector'])) { if (strpos($node['node_vector'],$_SESSION['cube_vector'])===false) { echo "node::".$node['node_vector']; echo "cube_Vector::".$_SESSION['cube_vector']; echo "you are out of allowed cwbe. access forbidden"; die(); } } #@include_once(INCLUDE_DIR.'mail_rss.inc'); //haluz... //checking permissions include_once(BACKEND_DIR.'/'.DB_TYPE.'/permissions.inc'); $permissions=permissions::checkPerms($node); if (!empty($_SESSION['debugging']) && $_SESSION['debugging']) { print_r($permissions); } // DO NOT MESS WITH THIS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //creating neural network if (preg_match('/id\/(\d+)/',isset($_SERVER['HTTP_REFERER'])? $_SERVER['HTTP_REFERER'] : "",$match)) { $referer_id=$match[1]; } elseif (preg_match('/k\/([a-z0-9]{1,7})/',isset($_SERVER['HTTP_REFERER'])? $_SERVER['HTTP_REFERER'] : "",$match)) { $referer_id=base_convert($match[1], 36, 10); } elseif (preg_match('/name\/(.*?)\/?$/',isset($_SERVER['HTTP_REFERER'])? $_SERVER['HTTP_REFERER'] : "",$match)) { $referer_id = nodes::getNodeIdByName($match[1]); } $db->update("update nodes set node_views=node_views+1 where node_id='".$node['node_id']."'"); if (isset($referer_id) && is_numeric($referer_id)) { $q="update neurons set synapse=synapse+1 where dst='".$node['node_id']."' and src='$referer_id'"; $result=$db->update($q); if (!$result) { $q="insert into neurons set synapse_creator='".$_SESSION['user_id']."',dst='".$node['node_id']."',src='$referer_id',synapse=1"; $db->query($q); } } else { logger::log('enter',$node['node_id'],'failed'); } //entering the node (executing the eventz) if (($permissions['r']) || ($event != 'register')) { //performing node_events (based on update/insert/delete db queries) if ($event) { require(INCLUDE_DIR.'eventz.inc'); } } ?>