4 $user_info=AddSlashes($_POST['user_info']);
5 $email=AddSlashes($_POST['email']);
6 $password1=$_POST['password1'];
7 $password2=$_POST['password2'];
8 $login=AddSlashes($_POST['login']);
9 $node_content=AddSlashes($_POST['user_info']);
11 $set=$db->query("select * from users where login='$login'");
12 if($set->getNumRows()>0) {
14 $error="user with $login already registered";
17 elseif($password1!=$password2) {
19 $error="passwords do not match";
22 elseif(strlen($password1)<6) {
24 $error="password too short";
27 elseif(empty($user_info)) {
29 $error="please write something about Thee";
32 elseif(empty($email)) {
34 $error="please enter your email address";
37 elseif((strpos($email, '@') === false) || (strpos($email, '@') == '0') || (strpos($email, '@') >= (strlen($email) - 4))) {
40 $error="please enter correct mail";
44 if (!empty($_POST['cube_vector'])) {
45 $q = "insert into nodes set external_link='db://user',node_creator='$id',node_name='$login',node_external_access='yes',node_system_access='public',node_parent='$parent',node_vector='$vector', template_id='7'";
46 $db->query("insert into nodes set external_link='db://user',node_creator='$id',node_name='$login',node_external_access='yes',node_system_access='public',node_parent='$parent',node_vector='$vector', template_id='7'");
47 $last_id=$db->getLastInsertId();
48 $db->query("insert into node_content set node_content='$node_content',node_id='$last_id'");
50 $q="INSERT INTO users set user_status='waiting',user_id='$last_id',login='$login'";
51 $node_content=nodes::processContent($user_info);
52 if (!empty($email)) $q.=", email='$email'";
53 $q.=",password='".md5($password1)."'";
54 if (!empty($user_icq)) $q.=", icq='$user_icq' ";
55 if (!empty($user_www)) $q.=", www='$user_www' ";
56 if (!empty($user_ad)) $q.=", user_ad='$user_ad' ";
57 $q.=",cube_vector='".$_POST['cube_vector']."'";
62 $id=ubik::ubikRegister();
63 $db->query("insert into nodes set external_link='db://user',node_name='$login',
64 node_external_access='yes',node_system_access='public',
65 node_parent='$parent',node_vector='$vector', template_id='7'");
66 $last_id=$db->getLastInsertId();
67 $db->query("insert into node_content set node_content='$node_content',node_id='$last_id'");
68 $db->query("update nodes set node_creator='$last_id' where node_id='$last_id'");
69 $q="INSERT INTO users set user_id='$last_id',login='$login'";
70 $node_content=nodes::processContent($user_info);
71 if (!empty($email)) $q.=", email='$email'";
72 $q.=",password='".md5($password1)."'";
78 echo "<p>Access granted.</p>";