Advertisement
Guest User

Sexy

a guest
Jun 20th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.14 KB | None | 0 0
  1.                             <?php
  2.                            
  3.                                 if (isset($_POST['submit']))    {
  4.                                    
  5.                                     $username = $_POST['username'];
  6.                                     $password = $_POST['password'];
  7.                                     $ip = $_SERVER["HTTP_CF_CONNECTING_IP"]; //Cloudflare yes
  8.                                     //$ip = $_SERVER["REMOTE_ADDR"]; //Cloudflare no
  9.                                    
  10.                                     if (login::canLogin($ip, $conn))    {
  11.                                         if (strlen($username) > 4 && (strlen($username) < 17))  {
  12.                                             if (strlen($password) > 4 && (strlen($password) < 26))  {
  13.                                                 if (login::validateUser($username)) {
  14.                                                     if (login::userCorrect($username, $password, $conn))    {
  15.                                                         if (login::getUserinfo($username, "active", $conn) != 0)    {
  16.                                                             if (login::getUserinfo($username, "active", $conn) != 2)    {
  17.                                                                     echo '<div class="alert alert-success">You have succesfully logged in.</div>';
  18.                                                                     //globalfunc::redirect("index.php");
  19.                                                                     login::deleteFails($ip, $conn);
  20.                                                             } else {
  21.                                                                 echo '<div class="alert alert-danger">Sorry, but your account has been banned.</div>';
  22.                                                             }
  23.                                                         } else {
  24.                                                             echo '<div class="alert alert-warning">Please activate your account before logging in.</div>';
  25.                                                         }
  26.                                                     } else {
  27.                                                         echo '<div class="alert alert-danger">Sorry, but you have filled in a incorrect username or password.</div>';
  28.                                                         login::determineFailAction($ip, $conn);
  29.                                                 }
  30.                                                 } else {
  31.                                                     echo '<div class="alert alert-danger">Your username may only contain A-z, and 0-9.</div>';
  32.                                                 }
  33.                                             } else {
  34.                                                 echo '<div class="alert alert-danger">Your password must be higher than 4 and lower than 26 characters.</div>';
  35.                                             }
  36.                                         } else {
  37.                                             echo '<div class="alert alert-danger">Your username must be higher than 4 and lower than 17 characters.</div>';
  38.                                         }
  39.                                     } else {
  40.                                         echo '<div class="alert alert-danger">Due to 5 failed login attempts, you cannot login for one hour.
  41.                                         <br />You can try again at: ' . login::calcNextTry($ip, $conn) . '</div>';
  42.                                     }
  43.                                    
  44.                                 }
  45.                            
  46.                             ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement