Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.12 KB | None | 0 0
  1. if(isset($_POST['pinSubmit'])) { // Form sent
  2.         if(empty($_POST['pinValue'])) { // Checks if empty
  3.             $error = 'You must input your pin!';
  4.         }
  5.         elseif($u['staff_pin_tries'] >= 3) { // Have they tried 3 times or more?
  6.             if($u['staff_pin_banned'] != date("Y-m-d", time())) { // Have they been pin banned today?
  7.                 mysql_query("UPDATE `users` SET `staff_pin_tries` = '0' WHERE `id` = '" . $_SESSION['user']['id'] . "'");
  8.             } else {
  9.             $bantime = date("Y-m-d", time()); // Pin banned for today
  10.             $error = 'Your account has been banned from the client for 24 hours';
  11.             mysql_query("UPDATE `users` SET `staff_pin_banned` = '".$bantime."' WHERE `id` = '" . $_SESSION['user']['id'] . "'");
  12.             }
  13.         }
  14.         elseif($_POST['pinValue'] != $u['staff_pin']) { // Incorrect pin set tries +1
  15.             $error = 'Your pin is incorrect!';
  16.             mysql_query("UPDATE `users` SET `staff_pin_tries` = `staff_pin_tries` + '1' WHERE `id` = '" . $_SESSION['user']['id'] . "'");
  17.         }
  18.         else {
  19.             $pinSuccess = true; // Woo you know your pin!
  20.             mysql_query("UPDATE `users` SET `staff_pin_tries` = '0' WHERE `id` = '" . $_SESSION['user']['id'] . "'");
  21.         }
  22.        
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement