}
if ($perms['node_system_access'] != 'private'
- && !$_SESSION['user_id']
+ && (empty($_SESSION['user_id']))
&& $perms['node_external_access'] == 'yes') {
$perms['r'] = 1;
$perms['w'] = 0;
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);
$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
else $event= preg_replace( "![^a-zA-Z0-9_]+!", "", $_POST['event']);
-if ($_SESSION['debugging']) {
+if (isset($_SESSION['debugging']) && $_SESSION['debugging']) {
echo "<pre><b>NODE::";
print_r($node);
echo "</pre>";