<?php include "include/common.php"; include "config.php"; include "include/session.php"; include "include/dbconnect.php"; include "include/auth.php"; if (isset($_SESSION['account_id'])) { header("Location: panel/"); } else { if (isset($_POST['email']) && isset($_POST['password'])) { $result = authAccount($_POST['email'], $_POST['password']); if ($result === true) { header("Location: panel/"); } else { if ($result === -1) { header("Location: index.php?message=" . urlencode("Login failed: too many failed login attempts. Please wait a few seconds before trying again.")); } else { if ($result === -2) { header("Location: index.php?message=" . urlencode("Login failed: invalid email address or password.")); } else { header("Location: index.php?message=" . urlencode("Unknown error occurred.")); } } } } else { if ($config['slave_enabled']) { header("Location: " . $config['slave_master']); } else { $message = ""; if (isset($_REQUEST['message'])) {
include "../include/common.php"; include "../config.php"; include "../include/session.php"; include "../include/dbconnect.php"; include "../include/account.php"; include "../include/auth.php"; if (isset($_SESSION['admin'])) { if (isset($_POST['action'])) { if ($_POST['action'] == "delete" && isset($_POST['delete_id'])) { adminDeleteAccount($_POST['delete_id']); } else { if ($_POST['action'] == "register" && isset($_POST['email']) && isset($_POST['password']) && isset($_POST['name'])) { adminRegisterAccount($_POST['email'], $_POST['password'], $_REQUEST['name']); } else { if ($_POST['action'] == "morph" && isset($_POST['morph_email'])) { authAccount($_POST['morph_email'], "", true); header("Location: ../panel/"); return; } } } //don't want that post data remaining, instead redirect back if (!isset($_SESSION['noredirect'])) { header("Location: accounts.php"); } return; } //get accounts $accounts = adminGetAccounts(); //display get_page("accounts", "admin", array('accounts' => $accounts));