Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['submit'])) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $ip = $_SERVER["HTTP_CF_CONNECTING_IP"]; //Cloudflare yes
- //$ip = $_SERVER["REMOTE_ADDR"]; //Cloudflare no
- if (login::canLogin($ip, $conn)) {
- if (strlen($username) > 4 && (strlen($username) < 17)) {
- if (strlen($password) > 4 && (strlen($password) < 26)) {
- if (login::validateUser($username)) {
- if (login::userCorrect($username, $password, $conn)) {
- if (login::getUserinfo($username, "active", $conn) != 0) {
- if (login::getUserinfo($username, "active", $conn) != 2) {
- echo '<div class="alert alert-success">You have succesfully logged in.</div>';
- //globalfunc::redirect("index.php");
- login::deleteFails($ip, $conn);
- } else {
- echo '<div class="alert alert-danger">Sorry, but your account has been banned.</div>';
- }
- } else {
- echo '<div class="alert alert-warning">Please activate your account before logging in.</div>';
- }
- } else {
- echo '<div class="alert alert-danger">Sorry, but you have filled in a incorrect username or password.</div>';
- login::determineFailAction($ip, $conn);
- }
- } else {
- echo '<div class="alert alert-danger">Your username may only contain A-z, and 0-9.</div>';
- }
- } else {
- echo '<div class="alert alert-danger">Your password must be higher than 4 and lower than 26 characters.</div>';
- }
- } else {
- echo '<div class="alert alert-danger">Your username must be higher than 4 and lower than 17 characters.</div>';
- }
- } else {
- echo '<div class="alert alert-danger">Due to 5 failed login attempts, you cannot login for one hour.
- <br />You can try again at: ' . login::calcNextTry($ip, $conn) . '</div>';
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement