get_image_link fix
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / eventz / set_time_lock.inc
1 <?php
2 function set_time_lock(){
3 global $db,$error;
4 $user_id = $_SESSION['user_id'];
5 $nick=mysql_real_escape_string($_SESSION['user_name']);
6 $nick=$nick . '[Locked_OUT]';
7 $hodina=mysql_real_escape_string($_POST['hodina']);
8 $minuta=mysql_real_escape_string($_POST['minuta']);
9 $den=mysql_real_escape_string($_POST['den']);
10 $mesiac=mysql_real_escape_string($_POST['mesiac']);
11 $rok=mysql_real_escape_string($_POST['rok']);
12
13 $now=date("Y-m-d H:i:s");
14 $til_lockout="$rok-$mesiac-$den $hodina:$minuta:00";
15 if ($til_lockout >= $now) {
16
17 $q="update users set acc_lockout='$til_lockout' where user_id=$user_id";
18 $db->query($q);
19
20 $q="update nodes set node_name='$nick' where node_id=$user_id";
21 $db->query($q);
22 $q="update users set login='$nick' where user_id=$user_id";
23 $db->query($q);
24
25 $ubik['mail_to']=$user_id;
26 $ubik['mail_text']="Prave si si uspesne nastavil account lockout do $til_lockout";
27 ubik::ubikMail($ubik);
28
29 return true;
30
31 // !!! upravit login aby odtrhaval [locked_out]
32 // !!! upravit register event aby nekradol nicky
33
34
35 }else
36 { $error="ten datum uz presiel. chces sa uzamknut v minulosti? len pre informaciu: momentalne je: $now";return false;}
37
38 }
This page took 0.473797 seconds and 4 git commands to generate.