Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($Config["Logopen"] != 0) {
- if (isset($_POST['sendLogin'])) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $encryptPassword = sha1($password);
- if (!empty($username) && (!empty($password))) {
- $fetchData = "SELECT * FROM useraccounts WHERE username = '$username' AND password = '$encryptPassword'";
- if ($stmt = $conn->prepare($fetchData)) {
- $stmt->execute();
- $stmt->store_result();
- if ($stmt->num_rows > 0) {
- $stmt->close();
- $getMoreInfo = "SELECT username, active FROM useraccounts WHERE username = '$username'";
- if ($stmt = $conn->prepare($getMoreInfo)) {
- $stmt->execute();
- $stmt->bind_result($username, $active);
- while ($stmt->fetch()) {
- if ($active > 0) {
- $_SESSION["Login"] = $username;
- echo '<div class="alert alert-success"><i class="fa fa-spin fa-spinner"></i> Succesfully logged in, redirecting...</div>';
- echo '<script>
- $(window).load(function () {
- window.setTimeout(function () {
- window.location.href = "managetickets.php";
- }, 2000)
- });
- </script>';
- } else {
- echo '<div class="alert alert-warning"><i class="fa fa-user-times"></i> This account has been set to disabled.</div>';
- }
- }
- $stmt->close();
- }
- } else {
- $stmt->close();
- echo 'Wrong';
- }
- }
- } else {
- echo '<div class="alert alert-danger"><i class="fa fa-times"></i> Please fill in a username and password.</div>';
- }
- $conn->close();
- }
- } else {
- echo '<div class="alert alert-warning"><i class="fa fa-times"></i> Sorry, but logging in has been disabled.</div>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement