mirror of
https://github.com/tursom/typecho-plugin-Access.git
synced 2024-12-28 05:40:40 +08:00
修复Action 500错误
This commit is contained in:
parent
e06456b29d
commit
49078288de
10
Action.php
10
Action.php
@ -4,14 +4,14 @@ class Access_Action implements Widget_Interface_Do
|
||||
|
||||
private $response;
|
||||
private $request;
|
||||
private $extend;
|
||||
private $access;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->response = Typecho_Response::getInstance();
|
||||
$this->request = Typecho_Request::getInstance();
|
||||
require_once __DIR__ . '/Access.php';
|
||||
$this->extend = new Access_Extend();
|
||||
require_once __DIR__ . '/Access_Bootstrap.php';
|
||||
$this->access = new Access_Core();
|
||||
}
|
||||
|
||||
public function execute()
|
||||
@ -51,7 +51,7 @@ class Access_Action implements Widget_Interface_Do
|
||||
if (!is_array($data)) {
|
||||
throw new Exception('params invalid');
|
||||
}
|
||||
$this->extend->deleteLogs($data);
|
||||
$this->access->deleteLogs($data);
|
||||
exit(Json::encode(array(
|
||||
'code' => 0,
|
||||
)));
|
||||
@ -66,7 +66,7 @@ class Access_Action implements Widget_Interface_Do
|
||||
|
||||
protected function checkAuth()
|
||||
{
|
||||
if (!$this->extend->isAdmin()) {
|
||||
if (!$this->access->isAdmin()) {
|
||||
throw new Exception('Access Denied');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user