5 * Script that register new users who gaind enough K (votes)
6 * Called once a day at 0:42
8 * TODO: ? call only function from eventz ?
10 * update texts & send mail
14 // Use relative address of config file
15 // Change this, if you move you cron directory.
16 $dir=substr(__FILE__
, 0, strrpos(__FILE__
, '/'));
17 require($dir.'/../wwwroot/config/config.inc');
19 require(INCLUDE_DIR
.'/log.inc');
20 require(INCLUDE_DIR
.'/database.inc');
21 require(INCLUDE_DIR
.'/nodes.inc');
22 include_once(BACKEND_DIR
.'/'.DB_TYPE
.'/permissions.inc');
23 require(INCLUDE_DIR
.'/ubik.inc');
24 //require(INCLUDE_DIR.'/senate.inc');
26 //REGISTRATION_VOTES CONSTANT DEFINED IN INC/SENATE.INC
27 define('REGISTER_TEXT','request for access');
29 $_SESSION['user_id']=UBIK_ID
;
31 $db=new CLASS_DATABASE();
33 $q="select users.login as persona,users.email as email,
34 k,node_id,node_creator,login from nodes
35 left join users on nodes.node_creator=users.user_id
36 where node_name like '".REGISTER_TEXT
."%'
37 and node_parent=".REGISTRATION_REQUEST_NODE
."
38 and k >=".REGISTRATION_VOTES
;
42 while ($set->next()) {
43 $q="update users set header_id=0,hash='' where user_id=".$set->getString('node_id');
45 $login=$set->getString('login');
46 echo $login." registered\n";
47 $db->update("update nodes set
49 external_link='db://user',
51 where node_id=".$set->getString('node_id'));
52 $mail=$set->getString('email');
53 mail($mail,"kyberia gate is opened","Vitaj v kyberii");
55 //VHODNE POSLAT ZACIATOCNIKOVI POSTU
56 // XXX undefined params FIX
57 // ubik::ubikMail($params);