add userinfo to ajax calls; combine settings and global-search to one

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-03-08 16:57:55 +01:00
parent f758d0d943
commit 218028de2b
4 changed files with 201 additions and 113 deletions

View File

@@ -1,11 +1,9 @@
<?php
namespace Froxlor;
use Exception;
use Froxlor\Ajax\Ajax;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Error\SyntaxError;
/**
* This file is part of the Froxlor project.
@@ -27,14 +25,14 @@ require_once dirname(__DIR__) . '/vendor/autoload.php';
// Load the user settings
if (!file_exists('./userdata.inc.php')) {
die();
die();
}
require './userdata.inc.php';
require './tables.inc.php';
// Return response
try {
echo (new Ajax)->handle();
echo (new Ajax)->handle();
} catch (Exception $e) {
echo \Froxlor\Api\Response::jsonErrorResponse($e->getMessage(), 500);
echo \Froxlor\Api\Response::jsonErrorResponse($e->getMessage(), 500);
}