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