| 1 | <?php |
| 2 | switch ($_POST['event']) { |
| 3 | case 'register' : |
| 4 | eventz::userRegister(); |
| 5 | break; |
| 6 | |
| 7 | case 'veto' : |
| 8 | eventz::veto(); |
| 9 | break; |
| 10 | |
| 11 | case 'update forum' : |
| 12 | $status=eventz::updateForum(); |
| 13 | if ($status) Header("Location: ".SCRIPT."?action=admin&subaction=forums&nocache=".time()); |
| 14 | break; |
| 15 | |
| 16 | } |
| 17 | |
| 18 | class eventz { |
| 19 | |
| 20 | function userRegister() { |
| 21 | global $user_id; |
| 22 | global $kyberia; |
| 23 | global $user_name; |
| 24 | $result=$_POST['result']; |
| 25 | $message=$_POST['message']; |
| 26 | $action_parameter=$_POST['action_parameter']; |
| 27 | $action_result=$_POST['action_result']; |
| 28 | $user_info=$_POST['user_info']; |
| 29 | $login=$_POST['login']; |
| 30 | $email=$_POST['email']; |
| 31 | $data_1="$login<br>$email<br>$user_info"; |
| 32 | $data_2="komentar od registratora $user_name :: $message"; |
| 33 | $q="insert into admin set action_timestamp=NOW(),action_name='register',action_parameter='$action_parameter',action_result='$action_result',action_data_2='$data_2',action_data_1='$data_1',admin_id='$user_id'"; |
| 34 | $kyberia->executeQuery($q); |
| 35 | $kyberia->query("update user set user_active='waiting' where id='$action_parameter'"); |
| 36 | |
| 37 | } |
| 38 | |
| 39 | |
| 40 | function veto() { |
| 41 | global $kyberia; |
| 42 | global $user_id; |
| 43 | $action_id=$_GET['action_id']; |
| 44 | |
| 45 | } |
| 46 | |
| 47 | function updateForum() { |
| 48 | global $user_id; |
| 49 | global $kyberia; |
| 50 | $forum_id=$_POST['forum_id']; |
| 51 | $forum_name=$_POST['forum_name']; |
| 52 | $forum_category=$_POST['forum_category']; |
| 53 | $forum_owner=$_POST['forum_owner']; |
| 54 | $set=$kyberia->query("select id from user where login='$forum_owner'"); |
| 55 | if (!$set->getNumRows()) { |
| 56 | $error="uzivatel s danym menom neexistuje"; |
| 57 | return false; |
| 58 | } |
| 59 | $set->next(); |
| 60 | $forum_owner=$set->getString('id'); |
| 61 | $q="insert into forum set forum_name='$forum_name',forum_owner='$forum_owner',forum_category='$forum_category',forum_id='$forum_id'"; |
| 62 | // echo $q; |
| 63 | $kyberia->query($q); |
| 64 | return true; |
| 65 | } |
| 66 | |
| 67 | |
| 68 | } |