$admin->id, 'action' => $action, 'ip' => $_SERVER['REMOTE_ADDR'] ]); $log->save(); } if ($current_user === null || $current_user->role < User::ROLE_MODERATOR) { header('Location: ..'); die(); } if (isset($_SESSION['admin_login']) && $_SESSION['admin_login']) { header('Location: dashboard.php'); exit(); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (pp_password_verify($_POST['password'], $current_user->admin_password_hash)) { updateAdminHistory($current_user, AdminLog::ACTION_LOGIN); $_SESSION['admin_login'] = true; header("Location: dashboard.php"); exit(); } else { updateAdminHistory($current_user, AdminLog::ACTION_FAIL_LOGIN); $msg = '