From: Daniel Hromada Date: Wed, 16 Mar 2011 00:06:42 +0000 (+0100) Subject: wrapper (supporting numeric as well as hash input parameter) around a new permission... X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=8300ec1a1a56adf502e9a250b4c6233d3c7b024d;p=mirrors%2FKyberia-bloodline.git wrapper (supporting numeric as well as hash input parameter) around a new permission function --- diff --git a/wwwroot/backend/mysql/backend.inc b/wwwroot/backend/mysql/backend.inc index a3ee375..71c3936 100644 --- a/wwwroot/backend/mysql/backend.inc +++ b/wwwroot/backend/mysql/backend.inc @@ -68,14 +68,18 @@ function addNode($params) { global $db,$node,$error,$error_messages; $parent_id=$params['node_parent']; + if ($params['flag']=='registration') $params['node_creator']=UBIK_ID; + if (!is_numeric($parent_id)) { $parent_id=$node['node_id']; } $parent_permissions=permissions::checkPerms($parent_id); + print_r($parent_permissions); if (!$parent_permissions['w']) { $error=$error_messages['WRITE_PERMISSION_ERROR']; logger::log('add','error','WRITE_PERMISSION_ERROR'); + die("trralalala1"); return false; } @@ -84,11 +88,8 @@ function addNode($params) { $kset->next(); $user_k=$kset->getString('user_k'); - if ($params['flag']=='registration') $params['node_creator']=UBIK_ID; - if (!$user_k && $params['node_creator']!=UBIK_ID) { $error=$error_messages['K_SPENT']; - return false; }