19 lines
511 B
PHP
19 lines
511 B
PHP
|
|
<?php
|
||
|
|
/**
|
||
|
|
* 日志 datatable 接口鉴权
|
||
|
|
*/
|
||
|
|
if (!function_exists('cloak_datatable_require_auth')) {
|
||
|
|
function cloak_datatable_require_auth()
|
||
|
|
{
|
||
|
|
if (session_status() !== PHP_SESSION_ACTIVE) {
|
||
|
|
session_start();
|
||
|
|
}
|
||
|
|
if (empty($_SESSION['password']) || $_SESSION['password'] != LOGIN_PASSWORD) {
|
||
|
|
unset($_SESSION['password']);
|
||
|
|
unset($_SESSION['check_result']);
|
||
|
|
http_response_code(404);
|
||
|
|
die('404 Not Found');
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|