$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=".UNVERIFIED_REGISTRATIONS_NODE);
+$set=$db->query("select node_id from nodes where node_id='$userid' and node_parent=".UNVERIFIED_REGISTRATIONS_NODE);
if($set->getNumRows()!=1) {
global $error;
$error="User already verificated or invalid.";
return $access_data;
}
+
+
+// Simple internal function to set node parrent
+
+function setParrent() {
+ global $db,$node,$error,$error_messages;
+ $parent_id=$params['node_parent'];
+ $node_id=$params['node_id'];
+
+ if (!is_numeric($parent_id)) {
+ return false;
+ }
+ $q="select node_vector from nodes where node_id='$parent_id'";
+ $parent_vector=$db->query($q);
+
+ $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'";
+ $db->query($q);
+}
}
?>