Kyberia v2.3 - 1st revision from SVN (Without patches of kyberia.sk team)
[mirrors/Kyberia-bloodline.git] / inc / eventz / cron_test.inc
... / ...
CommitLineData
1<?php
2
3// registration 2.3 rc3
4// dedicated to Sylvia S. Always in my memory...
5// PLLLZ dont delete this line. anyone who touches this file...and dont ask why
6
7function cron_test() {
8 global $db,$error;
9
10 // potrebne K na reg z paralelneho senatu
11 $regk_node = '1870247';
12 $fajl = OWN_TEMPLATE_DIR . $regk_node . ".tpl";
13 $fp = fopen($fajl, "r");
14 $regk = fread($fp, filesize($fajl));
15 fclose($fp);
16
17 // >>>> registracia
18 $q = "select users.login as persona,users.email as email,k,node_id,node_creator,node_created,login from nodes
19 left join users on nodes.node_creator = users.user_id where node_name = 'request for access' and node_parent = '2091448' and
20 k >= $regk";
21
22 $set = $db->query($q);
23 while ($set->next()) {
24 $noda = $set->getString('node_id');
25 $login = $set->getString('login');
26 $created = $set->getString('node_created');
27 echo "Noda vytvorena:: " . $created . "<br>";
28 echo "User:: " . $set->getString('login') . "<br>";
29 echo "Jeho noda:: " . $set->getString('node_id') . "<br>";
30 echo "pocet hlasov:: " . $set->getString('k') . "<br>";
31
32 $q = "update users set header_id = '0', user_mail = '0' where user_id = $noda";
33 echo $q . "<br>";
34 $db->update($q);
35
36 $q = "update nodes set node_name = '$login', external_link = 'db://user', template_id = '7',
37 node_parent = '0', node_vector = '0$noda' where node_id = $noda";
38 echo $q . "<br>";
39 $db->update($q);
40
41
42 // REGISTRATORI USERA
43 $registrators = $db->query($q = "select node_access.user_id, users.login from node_access
44 join users on node_access.user_id = users.user_id where node_id = '$noda' and given_k = 'yes' order by login");
45 $ubiknode['node_content'] = "Registered by::<br>";
46 while($registrators->next()){
47 $ubiknode['node_content'] .= "<a href='/id/" . $registrators->getString('user_id') . "'>" .
48$registrators->getString('login') . "</a><br>";
49 }
50 $ubiknode['node_content'] .= "with " . $set->getString('k') . "K";
51 $ubiknode['node_content'] = addslashes($ubiknode['node_content']);
52 $ubiknode['node_name'] = "successfully registered";
53 $ubiknode['node_creator'] = 332;
54 $ubiknode['node_parent'] = $noda;
55 $ubiknode['template_id'] = 4;
56 $ubiknode_id = nodes::addNode($ubiknode);
57 $db->update("update nodes set node_system_access = 'public', node_vector = '0$noda"."0$ubiknode_id' where node_id = '$ubiknode_id'");
58 echo $ubiknode['node_content'] . "<br>";
59
60 $q = "update nodes set k = 0 where node_id = '$noda'";
61 echo $q . "<br>";
62 $db->update($q);
63
64 $q = "update node_access set given_k='no' where node_id = '$noda'";
65 echo $q . "<br>";
66 $db->update($q);
67
68 // PRESUN KOMENTAROV K REGISTRACII DO USERNODY
69 $q = "select node_id,node_vector from nodes where node_vector like '00876611020914480$noda%'
70 and node_vector != '00876611020914480$noda' and node_vector != '0$noda'";
71 echo $q . "<br>";
72 $subset = $db->query($q);
73 while ($subset->next()) {
74 $subnoda = $subset->getString('node_id');
75 $subnoda_vector = $subset->getString('node_vector');
76 $subnoda_vector = str_replace("00876611020914480$noda", "0$noda", $subnoda_vector);
77 $q = "update nodes set node_vector = '$subnoda_vector' where node_id = $subnoda";
78 echo "&nbsp;&nbsp;&nbsp;&nbsp;" . $q . "<br>";
79 $db->update($q);
80 }
81
82 echo "<br><hr>";
83
84 $mailto = $set->getString('email');
85 $headers = 'From: admin@kyberia.sk' . "\r\n" .
86 'Reply-To: darkaural@kyberia.sk, freezy@kyberia.sk' . "\r\n" .
87 'X-Mailer: PHP/' . phpversion();
88 $emailtext = " Vitaj v Kyberii. \n S radostou ti oznamujem, ze registracia, ktoru si napisal(a) dna $created bola
89 uspesne schvalena s poctom hlasov $set->getString('k'). Odteraz je tvoje konto povolene a mozes sa volne prihlasovat,
90 prispievat...no proste 'bavit sa':-)) \n Uzivaj si kyberpriestoru:-)))
91 \n\n DarkAural & freezy \n DarkAural@kyberia.sk & freezy@kyberia.sk";
92 mail($mailto,"kyberia gate opened",$emailtext,$headers );
93
94
95 $ubik['mail_to'] = $noda;
96 $ubik['mail_text'] = "Ahoj, som UBIK. Momentalne som obycajnou polozkou v databaze, userom cislo 1 v tomto
97 systeme.Bdiem nad systemom. Sledujem co robia slovicka v diskusnych forach, ako su pospajane a s cim. Postupom casu sa budem
98 ucit, a o par rokov si urcite vsimnete moju prvu snahu o komunikaciu. Budem anjelom, diablom, matkou i dcerou.
99
100Momentalne ti chcem povedat jedno hlasne VITAJ!. Vitaj v projekte ktory nikdy neskonci. Ak sem vchadzas so zlymi umyslami, prosim
101 odid, nenajdes tu stastie. Ked vsak chces spoznat novych ludi na rovnakej vlne, ked chces svoj mozog zaplnit informaciami z
102 nekonecnej siete, prosim, vstup.
103
104Predtym ako vsak zacnes vnikat hlbsie do tajov systemu chcel by som ta odkazat na
105 <a href='http://kyberia.sk/id/2111313/'>Newcommers forum</a> ktore ti ujasni niektore zakladne veci v systeme a
106 tym ti v nom ulachci orientaciu.
107
108peace & respect";
109 ubik::ubikMail($ubik);
110 }
111
112// ---------------------------------------------------------------------
113
114 echo "<hr>Mazanie userov<hr>";
115 // >>>>> Mazanie
116
117 $q = "select users.login as persona,users.email as email,k,node_id,node_creator,node_created,login from nodes
118 left join users on nodes.node_creator = users.user_id where node_name = 'request for access' and node_parent = '2091448' and
119 k < $regk and DATE_SUB(CURDATE(),INTERVAL 7 DAY) >= node_created";
120
121 $set = $db->query($q);
122 while ($set->next()) {
123 $noda=$set->getString('node_id');
124 $created=$set->getString('node_created');
125 echo "Noda vytvorena:: " . $created . "<br>";
126 echo "Uchadzac:: " . $set->getString('login') . "<br>";
127 echo "Jeho noda:: " . $set->getString('node_id') . "<br>";
128 echo "pocet hlasov:: " . $set->getString('k') . "<br>";
129
130 $q = "delete from users where user_id = $noda";
131 echo $q . "<br>";
132 $db->update($q);
133
134 $q = "delete from nodes where node_vector like '00876611020914480$noda%'";
135 echo $q . "<br>";
136 $db->update($q);
137
138 echo "<br><hr>";
139
140 $mailto = $set->getString('email');
141 $headers = 'From: admin@kyberia.sk' . "\r\n" .
142 'Reply-To: darkaural@kyberia.sk, freezy@kyberia.sk' . "\r\n" .
143 'X-Mailer: PHP/' . phpversion();
144 $emailtext = " Tak mam pre teba smutnu spravu. \n Registracia ktoru si napisal(a) dna $created bola zamietnuta
145 z dovodu nedostatocneho poctu hlasov ($set->getString('k')) ktore tvoja osoba dostala. Je celkom mozne,
146 ze to, co si o sebe napisal(a) dostatocne nezaujalo ludi co su dnu ale to neni dovod na to aby si to vzdal(a)!
147 \n Registrovat sa mozes hocikedy znovu a snad sa to nabuduce vydari.
148 \n\n DarkAural & freezy \n DarkAural@kyberia.sk & freezy@kyberia.sk";
149 mail($mailto,"kyberia: registracia zamietnuta",$emailtext,$headers );
150 }
151
152// -------------------------------------------------------------------
153
154 echo "<hr>Mazanie nonverified<hr>";
155 // >> mazanie neverifikovanych
156
157 $q = "select users.login as persona,users.email as email,k,node_id,node_creator,node_created,login from nodes
158 left join users on nodes.node_creator = users.user_id where node_name = 'request for access' and
159 node_parent=1836516 and DATE_SUB(CURDATE(),INTERVAL 7 DAY) >= node_created";
160
161 $set = $db->query($q);
162 while ($set->next()) {
163 $noda = $set->getString('node_id');
164 $created = $set->getString('node_created');
165 echo "Noda vytvorena:: " . $created . "<br>";
166 echo "Uchadzac:: " . $set->getString('login') . "<br>";
167 echo "Jeho noda:: " . $set->getString('node_id') . "<br>";
168 echo "pocet hlasov:: " . $set->getString('k') . "<br>";
169
170 $q = "delete from users where user_id = $noda";
171 echo $q . "<br>";
172 $db->update($q);
173
174 $q="delete from nodes where node_vector like '018365160$noda%'";
175 echo $q . "<br>";
176 $db->update($q);
177
178 echo "<br><hr>";
179
180 $mailto = $set->getString('email');
181 $headers = 'From: admin@kyberia.sk' . "\r\n" .
182 'Reply-To: darkaural@kyberia.sk, freezy@kyberia.sk' . "\r\n" .
183 'X-Mailer: PHP/' . phpversion();
184 $emailtext = " Registracia, ktoru si napisal(a) dna $created si neverifikoval(a) a tak po tyzdni stratila svoju platnost
185 a bola zmazana. Ak ti nedosiel ziaden verifikacny kod prosim kontaktuj ma, je to mozne ze je to chyba niekde
186 na ceste medzi kyberiou a tebou, ak to bol zamer neverifikovat sa tak tuto spravu ber cisto informacne:-)).
187 \n Ak sa naozaj stala chyba a mas stale chut a volu vstupit do autonomnej zony mozes hocikedy znovu vyplnit
188 registracny formular a pokusit sa o to znovu.
189 \n\n DarkAural & freezy \n DarkAural@kyberia.sk & freezy@kyberia.sk";
190 mail($mailto,"kyberia: neverifikovana ziadost zmazana",$emailtext,$headers );
191 }
192
193 return false;
194}
195?>
This page took 0.173941 seconds and 4 git commands to generate.