Kyberia v2.3 - 1st revision from SVN (Without patches of kyberia.sk team)
[mirrors/Kyberia-bloodline.git] / inc / eventz / verify.inc
1 <?
2 function verify() {
3
4 global $db;
5 $uvercode=mysql_real_escape_string($_POST['vc']);
6 $login=mysql_real_escape_string($_POST['login']);
7
8 $kset=$db->query("select user_id from users where login='$login'");
9 $kset->next();$userid=$kset->getString('user_id');
10
11 $set=$db->query("select * from nodes where node_id='$userid' and node_parent=1836516");
12 if($set->getNumRows()!=1) {
13 global $error;
14 $error="User already verificated or invalid.";
15 return false;
16 }
17
18
19 $kset=$db->query("select hash from users where login='$login'");
20 $kset->next();$vercode=$kset->getString('hash');
21
22 if($uvercode!=$vercode) {
23 global $error;
24 $error="Wrong verification code or username";
25 return false;
26 }
27
28 else {
29 // ouch!! this is gonna be dirty!!!!! will be revised later:-)
30 $q="update nodes set node_parent=2091448, node_vector='00876611020914480$userid' where node_id='$userid'";
31 $db->update($q);
32 $q="update nodes set node_children_count=node_children_count+1 where node_id=2091448";
33 $db->update($q);
34 $q="update nodes set node_created=NOW() where node_id='$userid'";
35 $db->update($q);
36 $q="update nodes set node_system_access='public' where node_id='$userid'";
37 $db->update($q);
38 $q="update node_access set node_user_subchild_count=node_user_subchild_count+1 where node_id=2091448";
39 $db->update($q);
40
41
42 // and now the happy news:-))
43
44
45 echo "<center>Verification successfull.<br><h3>from now on your registration is in the hands of kyberians</h3></center>";
46
47 die();
48 }
49 }
50 ?>
This page took 0.335795 seconds and 4 git commands to generate.