From 09f0f2fae8b01c46318cee6e9864b7b1847e9fd3 Mon Sep 17 00:00:00 2001 From: niekt0 Date: Sun, 19 Dec 2010 20:18:22 +0100 Subject: [PATCH] Anihilating constans --- cron/register.php | 1 - wwwroot/inc/eventz/uprav_zaregistrovanych.inc | 4 ++-- wwwroot/inc/eventz/verify.inc | 8 ++++---- wwwroot/inc/eventz/vycisti_registracky.inc | 2 +- wwwroot/inc/senate.inc | 6 ------ wwwroot/nodes.php | 9 +++++---- 6 files changed, 12 insertions(+), 18 deletions(-) diff --git a/cron/register.php b/cron/register.php index 939c9ff..588ffd6 100755 --- a/cron/register.php +++ b/cron/register.php @@ -23,7 +23,6 @@ require(INCLUDE_DIR.'/senate.inc'); //REGISTRATION_VOTES CONSTANT DEFINED IN INC/SENATE.INC define('REGISTER_TEXT','request for access'); -define('REGISTRATION_REQUEST_NODE',2091448); $_SESSION['user_id']=UBIK_ID; diff --git a/wwwroot/inc/eventz/uprav_zaregistrovanych.inc b/wwwroot/inc/eventz/uprav_zaregistrovanych.inc index fed3afa..f3217fa 100644 --- a/wwwroot/inc/eventz/uprav_zaregistrovanych.inc +++ b/wwwroot/inc/eventz/uprav_zaregistrovanych.inc @@ -5,8 +5,8 @@ global $db,$error; // XXX hardcoded, rewrite $q="select users.login as persona,users.email as email,k,node_id,node_creator,login from nodes -left join users on nodes.node_creator=users.user_id where node_name!='request for access' and node_parent=2091448 and -k>=3"; +left join users on nodes.node_creator=users.user_id where node_name!='request for access' and node_parent=".REGISTRATION_REQUEST_NODE." and +k>=".REGISTRATION_VOTES; $set=$db->query($q); while ($set->next()) { diff --git a/wwwroot/inc/eventz/verify.inc b/wwwroot/inc/eventz/verify.inc index 1d80ace..6b335eb 100644 --- a/wwwroot/inc/eventz/verify.inc +++ b/wwwroot/inc/eventz/verify.inc @@ -9,7 +9,7 @@ $kset=$db->query("select user_id from users where login='$login'"); $kset->next();$userid=$kset->getString('user_id'); // XXX HARD CODED -$set=$db->query("select * from nodes where node_id='$userid' and node_parent=1836516"); +$set=$db->query("select * from nodes where node_id='$userid' and node_parent=".UNVERIFIED_REGISTRATIONS_NODE); if($set->getNumRows()!=1) { global $error; $error="User already verificated or invalid."; @@ -27,15 +27,15 @@ if($uvercode!=$vercode) { } else { // ouch!! this is gonna be dirty!!!!! will be revised later:-) // XXX hardcoded, rewrite -$q="update nodes set node_parent=2091448, node_vector='0000010120914480$userid' where node_id='$userid'"; +$q="update nodes set node_parent=".REGISTRATION_REQUEST_NODE.", node_vector='0000010120914480$userid' where node_id='$userid'"; $db->update($q); -$q="update nodes set node_children_count=node_children_count+1 where node_id=2091448"; +$q="update nodes set node_children_count=node_children_count+1 where node_id=".REGISTRATION_REQUEST_NODE; $db->update($q); $q="update nodes set node_created=NOW() where node_id='$userid'"; $db->update($q); $q="update nodes set node_system_access='public' where node_id='$userid'"; $db->update($q); -$q="update node_access set node_user_subchild_count=node_user_subchild_count+1 where node_id=2091448"; +$q="update node_access set node_user_subchild_count=node_user_subchild_count+1 where node_id=".REGISTRATION_REQUEST_NODE; $db->update($q); diff --git a/wwwroot/inc/eventz/vycisti_registracky.inc b/wwwroot/inc/eventz/vycisti_registracky.inc index 553a1a8..8df8c0c 100644 --- a/wwwroot/inc/eventz/vycisti_registracky.inc +++ b/wwwroot/inc/eventz/vycisti_registracky.inc @@ -3,7 +3,7 @@ function vycisti_registracky() { global $db,$error; $q="select users.login as persona,users.email as email,k,node_id,node_creator,login from nodes -left join users on nodes.node_creator=users.user_id where node_name='request for access' and node_parent=2091448 and k<=4"; +left join users on nodes.node_creator=users.user_id where node_name='request for access' and node_parent=".REGISTRATION_REQUEST_NODE." and k<=".REGISTRATION_VOTES; $set=$db->query($q); while ($set->next()) { diff --git a/wwwroot/inc/senate.inc b/wwwroot/inc/senate.inc index 1182073..42638bd 100644 --- a/wwwroot/inc/senate.inc +++ b/wwwroot/inc/senate.inc @@ -47,16 +47,10 @@ define('UNVERIFIED_REGISTRATIONS_NODE',1836516); // unfriend.inc // $q = "update nodes set external_link='', node_parent=123456, node_vector='001234560$node_id' whe -// uprav_zaregistrovanych.inc -// node_parent=2091448 and k>=3 - // verify.inc -// node_parent=1836516") -// $q="update nodes set node_parent=2091448, // node_vector='0000010120914480$userid' where node_id='$user // vycisti_registracky.inc -// node_parent=2091448 and k<=4 // $q="delete from nodes where node_vector like '020914480$noda%'"; // resource.kyberia.php diff --git a/wwwroot/nodes.php b/wwwroot/nodes.php index 3687d08..f494ead 100644 --- a/wwwroot/nodes.php +++ b/wwwroot/nodes.php @@ -164,10 +164,11 @@ if (empty($node)) { } //modifying node glass pearl //XXX WTF -if (is_array($children_types[$node['node_type']])) { - $smarty->assign('children_types',$children_types[$node['node_type']]); -} -$smarty->assign('types',$types); +//if (is_array($children_types[$node['node_type']])) { +// $smarty->assign('children_types',$children_types[$node['node_type']]); +//} + +smarty->assign('types',$types); //$node['node_type']=$types[$node['node_type']]; -- 2.30.2