Beispiel #1
0
<?php

/*!
 * ifsoft.co.uk engine v1.0
 *
 * http://ifsoft.com.ua, http://ifsoft.co.uk
 * qascript@ifsoft.co.uk
 *
 * Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
 */
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
if (!admin::isSession()) {
    header("Location: /admin/login.php");
}
$page_id = "search";
$error = false;
$error_message = '';
$query = '';
$result = array();
$result['users'] = array();
$stats = new stats($dbo);
$settings = new settings($dbo);
$admin = new admin($dbo);
if (isset($_GET['query'])) {
    $query = isset($_GET['query']) ? $_GET['query'] : '';
    $query = helper::clearText($query);
    $query = helper::escapeText($query);
    if (strlen($query) > 2) {
        $result = $stats->searchAccounts(0, $query);
    }
}
Beispiel #2
0
<?php

/*!
 * ifsoft.co.uk engine v1.0
 *
 * http://ifsoft.com.ua, http://ifsoft.co.uk
 * qascript@ifsoft.co.uk
 *
 * Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
 */
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
if (admin::isSession()) {
    header("Location: /admin/main.php");
}
$page_id = "login";
$user_username = '';
$error = false;
$error_message = '';
if (!empty($_POST)) {
    $user_username = isset($_POST['user_username']) ? $_POST['user_username'] : '';
    $user_password = isset($_POST['user_password']) ? $_POST['user_password'] : '';
    $token = isset($_POST['authenticity_token']) ? $_POST['authenticity_token'] : '';
    $user_username = helper::clearText($user_username);
    $user_password = helper::clearText($user_password);
    $user_username = helper::escapeText($user_username);
    $user_password = helper::escapeText($user_password);
    if (helper::getAuthenticityToken() !== $token) {
        $error = true;
        $error_message = 'Error!';
    }
    if (!$error) {
 static function getCurrentAdminId()
 {
     if (admin::isSession()) {
         return $_SESSION['admin_id'];
     } else {
         return 0;
     }
 }