fixing broken vectors
authorniekt0 <niekt0@kyberia.cz>
Tue, 1 Mar 2011 23:18:21 +0000 (00:18 +0100)
committerniekt0 <niekt0@kyberia.cz>
Tue, 1 Mar 2011 23:18:21 +0000 (00:18 +0100)
doc/TODO
wwwroot/backend/mysql/backend.inc
wwwroot/inc/eventz/verify.inc

index ddbef0f56af88ff1e47ded187048c794e1b55c97..65fa20a6e2e2408ae74115604dc390f80bf823b1 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -58,9 +58,6 @@
 - Make PATH_INFO not changing contents of $_GET[] (it should affect some other variable instead - requires complex rewrite)
 - Switch completely to Base36 (Templates, Links, don't change $_GET[], queries should convert between base10 in db and base36 in kyberia automatically, etc...)
 
 - Make PATH_INFO not changing contents of $_GET[] (it should affect some other variable instead - requires complex rewrite)
 - Switch completely to Base36 (Templates, Links, don't change $_GET[], queries should convert between base10 in db and base36 in kyberia automatically, etc...)
 
-- (IMHO we should use SHA1 or stronger algorithm instead of MD5 for storing passwords)
-  (I've implemented this partially. We can now login using various hash algorithms, it's backward compatible, but we still need to edit registration/password changing to use SHA1 when updating passwords in DB)
-
 - Rename all files&directories that should not be rewrited to PATH_INFO to start with "_" (and if they should be also ignored by git they should start with "-")
   (Rename images to _images - and fix hardcoded stuff...)
 
 - Rename all files&directories that should not be rewrited to PATH_INFO to start with "_" (and if they should be also ignored by git they should start with "-")
   (Rename images to _images - and fix hardcoded stuff...)
 
@@ -74,3 +71,7 @@
   (Mark all nodes that should become part of distribution of kyberia software)
   (Delete unused tables)
   (Replace duplicit tables with VIEWs)
   (Mark all nodes that should become part of distribution of kyberia software)
   (Delete unused tables)
   (Replace duplicit tables with VIEWs)
+
+- Image uploading not working (?)
+
+- put "setParent" everywhere
index f8cd6a3fec998f83318162a8ee967ecc58dc1e51..b3b8770d93b86a80d90146d774ae777fe0fd0023 100644 (file)
@@ -307,18 +307,19 @@ node_parent='$node_handle' order by node_created $orderby LIMIT $offset,$limit";
 
 // Simple internal function to set node parrent
 
 
 // Simple internal function to set node parrent
 
-function setParent($params) {
+function setParent($node_id,$parent_id) {
         global $db,$node,$error,$error_messages;
         global $db,$node,$error,$error_messages;
-        $parent_id=$params['node_parent'];
-        $node_id=$params['node_id'];
 
         if (!is_numeric($parent_id)) {
                 return false;
         }
 
         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="select node_vector from nodes where node_id='$parent_id'";
+        $set=$db->query($q);
+        $set->next();
+        $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'";
        $db->query($q);
        $q="update nodes set node_parent='$parent_id',node_vector='".$new_vector."
                ' where node_id='$node_id'";
        $db->query($q);
index 6abf4bcfbba14ffde54a1a4c3d9628a0bfe9d471..7593708735aaba14dc9ec502e78b6aee1d30b95b 100644 (file)
@@ -30,13 +30,10 @@ if($uvercode!=$vercode) {
 //  ouch!! this is gonna be dirty!!!!! will be revised later:-)
 // XXX hardcoded, rewrite
 
 //  ouch!! this is gonna be dirty!!!!! will be revised later:-)
 // XXX hardcoded, rewrite
 
-$q="update nodes set node_parent=".REGISTRATION_REQUEST_NODE.", node_vector='000001010473807402091448$userid' where node_id='$userid'";
-$db->update($q);
-
+//$q="update nodes set node_parent=".REGISTRATION_REQUEST_NODE.", node_vector='000001010473807402091448$userid' where node_id='$userid'";
+//$db->update($q);
 
 
-//     $params['node_parent']=REGISTRATION_REQUEST_NODE;
-//     $params['node_id']=$userid;
-//     nodes::setParent($params);
+nodes::setParent($userid,REGISTRATION_REQUEST_NODE);
 
 
 $q="update nodes set node_children_count=node_children_count+1 where node_id=".REGISTRATION_REQUEST_NODE;
 
 
 $q="update nodes set node_children_count=node_children_count+1 where node_id=".REGISTRATION_REQUEST_NODE;
This page took 0.16916 seconds and 4 git commands to generate.