3 function remove_users() {
4 global $permissions,$node,$db,$error;
5 $user_id=$_SESSION['user_id'];
6 $user_name=$_SESSION['user_name'];
8 require(INCLUDE_DIR."phpmailer.inc");
9 $mail = new PHPMailer();
10 $mail->IsSMTP(); // send via SMTP
11 $mail->Host = "molly.kyberia.cz"; // SMTP servers
12 $mail->From = "root@kyberia.cz";
13 $mail->FromName = "kyberia.cz admin";
14 $mail->WordWrap = 50; // set word wrap
15 $mail->Subject = "kyberia.cz neuspesna registracia";
18 if (!$permissions['w']) {
19 $error="you don't have permissions for performing this event";
23 foreach ($_POST['waiting'] as $user =>$value) {
25 $set=$db->query("select email,login,node_creator from users left join nodes on nodes.node_id=users.user_id where user_id='$user'");
27 $email=$set->getString('email');
28 $login=$set->getString('login');
30 $application_id=$set->getString('node_creator');
32 $application=$db->query("select * from nodes where node_id='$application_id'");
34 $application_vector=$application->getString('node_vector').";".$application_id;
35 $application_parent=$application->getString('node_parent');
36 $db->query("insert into nodes set node_created=NOW(),node_name='$login refused',node_vector='$application_vector',node_creator='$user_id',node_type='4',node_parent='$application_parent'");
37 $id=$db->getLastInsertId();
38 $db->query("insert into node_content set node_id='$id',node_content='user $login was refused by by $user_name'");
41 $params['node_creator']=$user_id;
42 $params['node_parent']=$application_id;
43 $params['node_name']="$login refused";
44 $params['node_content']="user $login was refused by $user_name";
45 nodes::addNode($params);
47 $db->query("delete from users where user_id='$user' and user_status='waiting'");
48 $db->query("delete from nodes where node_id='$user' and node_type=7");
49 $db->query("delete from node_content where node_id='$user'");
53 $mail->ClearAddresses();
54 $mail->AddAddress($email);
55 $mail->AltBody = "bohuzial si nebol zaregistrovany na ".SYSTEM_URL.". ked chces skus znovu";
58 $error="could not sent mail";