From 0c936d6edb24eec08fecae02285a2ff99c17c5e2 Mon Sep 17 00:00:00 2001 From: niekt0 Date: Wed, 2 Mar 2011 13:41:58 +0100 Subject: [PATCH] setParent fix --- .../inc/eventz => trash}/uprav_zaregistrovanych.inc | 4 +++- wwwroot/backend/mysql/backend.inc | 3 +-- wwwroot/inc/eventz/remove_users.inc | 11 ++--------- 3 files changed, 6 insertions(+), 12 deletions(-) rename {wwwroot/inc/eventz => trash}/uprav_zaregistrovanych.inc (91%) diff --git a/wwwroot/inc/eventz/uprav_zaregistrovanych.inc b/trash/uprav_zaregistrovanych.inc similarity index 91% rename from wwwroot/inc/eventz/uprav_zaregistrovanych.inc rename to trash/uprav_zaregistrovanych.inc index f3217fa..5b8cecf 100644 --- a/wwwroot/inc/eventz/uprav_zaregistrovanych.inc +++ b/trash/uprav_zaregistrovanych.inc @@ -3,6 +3,8 @@ function uprav_zaregistrovanych() { global $db,$error; // 2110364 >> debug user +// XXX remove ? + // 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=".REGISTRATION_REQUEST_NODE." and @@ -31,7 +33,7 @@ $q="update nodes set node_parent=0 where node_id=$noda"; echo $q; $db->update($q); echo "
"; -$q="update nodes set node_vector='0$noda' where node_id=$noda"; +$q="update nodes set node_vector='0$noda' where node_id=$noda"; // XXX setParent echo $q; $db->update($q); diff --git a/wwwroot/backend/mysql/backend.inc b/wwwroot/backend/mysql/backend.inc index b3b8770..7b65372 100644 --- a/wwwroot/backend/mysql/backend.inc +++ b/wwwroot/backend/mysql/backend.inc @@ -320,8 +320,7 @@ function setParent($node_id,$parent_id) { $parent_vector=$set->getString('node_vector'); $new_vector=$parent_vector.str_pad($node_id,VECTOR_CHARS,"0",STR_PAD_LEFT); - $q="update nodes set node_parent='$parent_id',node_vector='".$new_vector." - ' where node_id='$node_id'"; + $q="update nodes set node_parent='$parent_id',node_vector='$new_vector' where node_id='$node_id'"; $db->query($q); } diff --git a/wwwroot/inc/eventz/remove_users.inc b/wwwroot/inc/eventz/remove_users.inc index cbc5dc2..1c74587 100644 --- a/wwwroot/inc/eventz/remove_users.inc +++ b/wwwroot/inc/eventz/remove_users.inc @@ -5,6 +5,8 @@ function remove_users() { $user_id=$_SESSION['user_id']; $user_name=$_SESSION['user_name']; +// XXX rewrite + require(INCLUDE_DIR."phpmailer.inc"); $mail = new PHPMailer(); $mail->IsSMTP(); // send via SMTP @@ -28,15 +30,6 @@ $mail->Subject = "kyberia.cz neuspesna registracia"; $login=$set->getString('login'); $application_id=$set->getString('node_creator'); -/* - $application=$db->query("select * from nodes where node_id='$application_id'"); - $application->next(); - $application_vector=$application->getString('node_vector').";".$application_id; - $application_parent=$application->getString('node_parent'); - $db->query("insert into nodes set node_created=NOW(),node_name='$login refused',node_vector='$application_vector',node_creator='$user_id',node_type='4',node_parent='$application_parent'"); - $id=$db->getLastInsertId(); - $db->query("insert into node_content set node_id='$id',node_content='user $login was refused by by $user_name'"); -*/ $params['node_creator']=$user_id; $params['node_parent']=$application_id; -- 2.30.2