forked from kevinowino869/mitrobill
Fix API request
This commit is contained in:
@ -22,8 +22,8 @@ class Csrf
|
||||
|
||||
public static function check($token)
|
||||
{
|
||||
global $config;
|
||||
if($config['csrf_enabled'] == 'yes') {
|
||||
global $config, $isApi;
|
||||
if($config['csrf_enabled'] == 'yes' && !$isApi) {
|
||||
if (isset($_SESSION['csrf_token'], $_SESSION['csrf_token_time'], $token)) {
|
||||
$storedToken = $_SESSION['csrf_token'];
|
||||
$tokenTime = $_SESSION['csrf_token_time'];
|
||||
|
@ -10,7 +10,7 @@ class Paginator
|
||||
{
|
||||
public static function findMany($query, $search = [], $per_page = '10', $append_url = "", $toArray = false)
|
||||
{
|
||||
global $routes, $ui;
|
||||
global $routes, $ui, $isApi;
|
||||
$adjacents = "2";
|
||||
$page = _get('p', 1);
|
||||
$page = (empty($page) ? 1 : $page);
|
||||
@ -72,7 +72,7 @@ class Paginator
|
||||
if ($ui) {
|
||||
$ui->assign('paginator', $result);
|
||||
}
|
||||
if($toArray){
|
||||
if($toArray || $isApi){
|
||||
return $query->offset($startpoint)->limit($per_page)->find_array();
|
||||
}else{
|
||||
return $query->offset($startpoint)->limit($per_page)->find_many();
|
||||
|
Reference in New Issue
Block a user