本文整理汇总了PHP中admin::isSession方法的典型用法代码示例。如果您正苦于以下问题:PHP admin::isSession方法的具体用法?PHP admin::isSession怎么用?PHP admin::isSession使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin
的用法示例。
在下文中一共展示了admin::isSession方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
<?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);
}
}
示例2: header
<?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) {
示例3: getCurrentAdminId
static function getCurrentAdminId()
{
if (admin::isSession()) {
return $_SESSION['admin_id'];
} else {
return 0;
}
}