X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=wwwroot%2Fnodes.php;h=29b6478b5c04359149d70c7c5b7824607914d5a5;hb=7a5cc9b5e221e87dd7933370e10c758ff356068d;hp=cffb9d09e9e9bafceaeb3387729a9d0b349f8bc3;hpb=08f5f7a7e240eac52c284b57561a9d45f313b45e;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/nodes.php b/wwwroot/nodes.php index cffb9d0..29b6478 100644 --- a/wwwroot/nodes.php +++ b/wwwroot/nodes.php @@ -42,13 +42,20 @@ $db = new CLASS_DATABASE(); if (preg_match('/id\/([0-9]+)(?:\/([0-9]+)\/?)?/',$_SERVER['PATH_INFO'],$match)) { // print_r($match); $_GET['node_id']=$match[1]; - if ($match[2]) { + if (!empty($match[2])) { $_GET['template_id']=$match[2]; } -} elseif (preg_match('/k\/([a-z0-9]+)(?:\/([0-9]+))?/',$_SERVER['PATH_INFO'],$match)) { + //Base36 fascism redirect + if(!count($_POST) && !(isset($_GET['template_id']) && $_GET['template_id'] == 'download')) { //Fix ugly download hack... + header('Location: /k/'.base_convert($_GET['node_id'], 10, 36). + (isset($_GET['template_id'])?'/'.base_convert($_GET['template_id'], 10, 36):'') + ); + die("Die!!! All Fascists Are Bastards...\n"); + } +} elseif (preg_match('/k\/([a-z0-9]{1,7})(?:\/([a-z0-9]{1,7}))?/',$_SERVER['PATH_INFO'],$match)) { $_GET['node_id']=base_convert($match[1], 36, 10); - if ($match[2]) { - $_GET['template_id']=$match[2]; + if (!empty($match[2])) { + $_GET['template_id']=base_convert($match[2],36,10); } } elseif (preg_match('/name\/(.*?)\/?$/',$_SERVER['PATH_INFO'],$match)) { $_GET['node_id'] = nodes::getNodeIdByName($match[1]); @@ -61,7 +68,7 @@ if (!empty($_GET['template_id'])) { } error_reporting(1); -$_SESSION['debugging']=0; +//$_SESSION['debugging']=0; //unset($_SESSION['debugging']); //Well... we should make some event //or JavaScript page to turning this on/off... @@ -130,14 +137,12 @@ if (isset($_SESSION['cube_vector']) && ($_SESSION['cube_vector'])) { @include_once(INCLUDE_DIR.'mail_rss.inc'); //haluz... //checking permissions -function _checkPermissions() -{ - global $permissions, $node; - require(INCLUDE_DIR.'permissions.inc'); - $permissions=permissions::checkPermissions($node); - $permissions['h']=permissions::isHierarch($node); +include_once(BACKEND_DIR.'/'.DB_TYPE.'/permissions.inc'); +$permissions=permissions::checkPerms($node); +if ($_SESSION['debugging']) { + print_r($permissions); } -_checkPermissions(); + // DO NOT MESS WITH THIS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!