/* Decoded by unphp.net */ echo ' '; include '../settings/config.php'; include '../settings/head_admin.php'; session_start(); require '../db_connection.php'; if (isset($_SESSION['user_id'])) { header("Location: ".($phpenable === 'true'?$siteurl .$admin_directory .'.php': $siteurl .$admin_directory)); exit; } if ($_SERVER['REQUEST_METHOD'] == 'POST') { $login = $_POST['login']; $password = $_POST['password']; $sql = "SELECT * FROM benutzer WHERE name = ?"; $stmt = $conn->prepare($sql); $stmt->bind_param("s",$login); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows == 1) { $user = $result->fetch_assoc(); if ($user['admin'] == 1) { if (password_verify($password,$user['password'])) { if ($user['gesperrt'] == 1) { if (!empty($user['sperrgrund'])) { $error_message = "Dieses Konto wurde von einem Administrator gesperrt.
Grund: ".$user['sperrgrund']; }else { $error_message = "Dieses Konto wurde von einem Administrator gesperrt."; } }else { $error_message = "Erfolgreich angemeldet!"; echo '
'; $_SESSION['user_id'] = $user['id']; $ip_address = $_SERVER['REMOTE_ADDR']; $login_status = 'erfolgreich'; $sql = "INSERT INTO login_history (user_id, login_time, ip_address, login_status) VALUES (?, NOW(), ?, ?)"; $stmt = $conn->prepare($sql); $stmt->bind_param("iss",$user['id'],$ip_address,$login_status); $stmt->execute(); sleep(2); header("Location: ".($phpenable === 'true'?$siteurl .$admin_directory : $siteurl .$admin_directory)); exit; } }else { $error_message = "Ungültige Anmeldeinformationen"; $ip_address = $_SERVER['REMOTE_ADDR']; $login_status = 'abgelehnt'; $sql = "INSERT INTO login_history (user_id, login_time, ip_address, login_status) VALUES (?, NOW(), ?, ?)"; $stmt = $conn->prepare($sql); $stmt->bind_param("iss",$user['id'],$ip_address,$login_status); $stmt->execute(); } }else { $error_message = "Nur Administratoren können sich anmelden."; } }else { $error_message = "Dieses Konto existiert nicht."; } } ;echo ' Anmelden — Admin



Adminpanel

'; if ($error_message) { echo '
'.$error_message .'
'; } if (isset($_GET['reg'])) { $reg = "Dein Account wurde erfolgreich erstellt."; } if ($reg) { echo '
'.$reg .'
'; } ;echo '

'; include 'settings/footer.php'; ;