Example #1
0
<?php

session_start();
if (file_exists("install2") && file_exists("config.php")) {
    die("It seems the install folder deletion failed. You have to delete it manually before you can proceed.");
} else {
    if (!file_exists("config.php")) {
        die(header("Location: install/"));
    }
}
require 'functions.php';
cleaningLady();
if (isset($_SESSION['loggedin'])) {
    getUserStatus($_SESSION['uid']);
}
$error = false;
$_SESSION['panel'] = "";
panelNameToSession();
if (isset($_POST['username']) && isset($_POST['password'])) {
    $id = authenticate($_POST['username'], $_POST['password']);
    if ($id != null && sizeof($id) != 0) {
        $_SESSION['loggedin'] = true;
        $status = intval($id[0]);
        if ($status == 2) {
            $_SESSION['admin'] = true;
        } else {
            if ($status == 3) {
                $_SESSION['superadmin'] = true;
            }
        }
        $_SESSION['name'] = $id[1];
Example #2
0
function isKeyValid($key)
{
    $key = mysql_html($key);
    global $mysql;
    cleaningLady();
    $query = "SELECT reqkey FROM 1fx_forgottenpsw WHERE reqkey='{$key}'";
    $result = mysqli_query($mysql, $query);
    if (!$result) {
        return false;
    }
    return $key === mysqli_fetch_array($result)['reqkey'];
}