Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST['pinSubmit'])) { // Form sent
- if(empty($_POST['pinValue'])) { // Checks if empty
- $error = 'You must input your pin!';
- }
- elseif($u['staff_pin_tries'] >= 3) { // Have they tried 3 times or more?
- if($u['staff_pin_banned'] != date("Y-m-d", time())) { // Have they been pin banned today?
- mysql_query("UPDATE `users` SET `staff_pin_tries` = '0' WHERE `id` = '" . $_SESSION['user']['id'] . "'");
- } else {
- $bantime = date("Y-m-d", time()); // Pin banned for today
- $error = 'Your account has been banned from the client for 24 hours';
- mysql_query("UPDATE `users` SET `staff_pin_banned` = '".$bantime."' WHERE `id` = '" . $_SESSION['user']['id'] . "'");
- }
- }
- elseif($_POST['pinValue'] != $u['staff_pin']) { // Incorrect pin set tries +1
- $error = 'Your pin is incorrect!';
- mysql_query("UPDATE `users` SET `staff_pin_tries` = `staff_pin_tries` + '1' WHERE `id` = '" . $_SESSION['user']['id'] . "'");
- }
- else {
- $pinSuccess = true; // Woo you know your pin!
- mysql_query("UPDATE `users` SET `staff_pin_tries` = '0' WHERE `id` = '" . $_SESSION['user']['id'] . "'");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement