From a0e722be3ebca8f1f25ba76a7c93d8cae7155462 Mon Sep 17 00:00:00 2001 From: niekt0 Date: Wed, 28 Sep 2011 23:54:00 +0200 Subject: [PATCH] cleaning warnings --- wwwroot/backend/mysql/permissions.inc | 2 +- .../smarty/node_methodz/function.get_nodes_by_type.php | 8 +++++--- wwwroot/nodes.php | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/wwwroot/backend/mysql/permissions.inc b/wwwroot/backend/mysql/permissions.inc index 234221c..da78555 100644 --- a/wwwroot/backend/mysql/permissions.inc +++ b/wwwroot/backend/mysql/permissions.inc @@ -79,7 +79,7 @@ public static function checkPerms($node) { } if ($perms['node_system_access'] != 'private' - && !$_SESSION['user_id'] + && (empty($_SESSION['user_id'])) && $perms['node_external_access'] == 'yes') { $perms['r'] = 1; $perms['w'] = 0; diff --git a/wwwroot/inc/smarty/node_methodz/function.get_nodes_by_type.php b/wwwroot/inc/smarty/node_methodz/function.get_nodes_by_type.php index 136500c..fe45e7c 100644 --- a/wwwroot/inc/smarty/node_methodz/function.get_nodes_by_type.php +++ b/wwwroot/inc/smarty/node_methodz/function.get_nodes_by_type.php @@ -3,21 +3,23 @@ function smarty_function_get_nodes_by_type($params,&$smarty) { global $node; + $vector=""; + $orderby=""; $type=$params['type']; if ($params['listing_amount']=='all') $listing_amount=DEF_MAX_LISTING_AMMOUNT; else $listing_amount=$params['listing_amount']; if (empty($params['offset'])) $offset=0; else $offset=$params['offset']; - if ($params['vector']) { + if (isset($params['vector']) && $params['vector']) { $vector=$params['vector']; } - if ($params['orderby']) { + if (isset($params['orderby']) && $params['orderby']) { $orderby=$params['orderby']; } $node_id=$node['node_id']; $user_id=$_SESSION['user_id']; - $result=nodes::getNodesByType(isset($vector)?$vector:"",$user_id,$type,isset($orderby)?$orderby:"",$offset,$listing_amount); + $result=nodes::getNodesByType($vector,$user_id,$type,$orderby,$offset,$listing_amount); $smarty->assign('get_nodes_by_type',$result); diff --git a/wwwroot/nodes.php b/wwwroot/nodes.php index 063f4e6..7bb46ae 100644 --- a/wwwroot/nodes.php +++ b/wwwroot/nodes.php @@ -119,7 +119,7 @@ $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 ($_SESSION['debugging']) $smarty->debugging=true; +if (isset($_SESSION['debugging']) && $_SESSION['debugging']) $smarty->debugging=true; // initializing variables // preg_replace prevents LFI @@ -127,7 +127,7 @@ if (empty($_POST['event'])) $event='display'; else $event= preg_replace( "![^a-zA-Z0-9_]+!", "", $_POST['event']); -if ($_SESSION['debugging']) { +if (isset($_SESSION['debugging']) && $_SESSION['debugging']) { echo "
NODE::";
 	print_r($node);
 	echo "
"; -- 2.30.2