TASK-229 Validate all Endpoints for delete Old Ajax files
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
require_once 'classes/AuthSources.php';
|
||||
|
||||
try {
|
||||
if (isset($_REQUEST['action']) === false) {
|
||||
throw new Exception('No action was sent');
|
||||
@@ -18,7 +16,7 @@ try {
|
||||
switch ($action) {
|
||||
case 'authSourcesList':
|
||||
$start = $_REQUEST['start'] ?? 0;
|
||||
$limit = $_REQUEST['limit'] ?? $limit_size;
|
||||
$limit = $_REQUEST['limit'] ?? 25;
|
||||
$filter = $_REQUEST['textFilter'] ?? '';
|
||||
$orderBy = $_REQUEST['orderBy'] ?? '';
|
||||
$ascending = $_REQUEST['ascending'] ?? 'asc';
|
||||
@@ -112,7 +110,7 @@ try {
|
||||
$authSourceUid = $_POST['sUID'];
|
||||
$filters = [
|
||||
'start'=> $_POST['start'] ?? 0,
|
||||
'limit'=> $_POST['limit'] ?? ($_POST["pageSize"] ?? 10),
|
||||
'limit'=> $_POST['limit'] ?? ($_POST['pageSize'] ?? 10),
|
||||
'text'=> $_POST['sKeyword'] ?? ''
|
||||
];
|
||||
|
||||
@@ -136,16 +134,34 @@ try {
|
||||
$responseProxy = $authSources->importUsers($authSourceUid, $usersImport);
|
||||
break;
|
||||
case 'authSourcesImportLoadDepartment':
|
||||
$responseProxy['success'] = true;
|
||||
if (!isset($_REQUEST['authUid'])) {
|
||||
throw new Exception('No auth source UID was sent');
|
||||
}
|
||||
|
||||
$authSourceUid = $_REQUEST['authUid'];
|
||||
$authSources = new AuthSources();
|
||||
$responseProxy = $authSources->searchDepartaments($authSourceUid);
|
||||
break;
|
||||
case 'authSourcesImportSaveDepartment':
|
||||
$responseProxy['success'] = true;
|
||||
$authSources = new AuthSources();
|
||||
$departmentsDN = $_REQUEST['departmentsDN'];
|
||||
$authSourceUid = $_REQUEST['authUid'];
|
||||
$responseProxy = $authSources->saveDepartments($departmentsDN, $authSourceUid);
|
||||
break;
|
||||
case 'authSourcesImportLoadGroup':
|
||||
$responseProxy['success'] = true;
|
||||
if (!isset($_REQUEST['authUid'])) {
|
||||
throw new Exception('No auth source UID was sent');
|
||||
}
|
||||
|
||||
$authSourceUid = $_REQUEST['authUid'];
|
||||
$authSources = new AuthSources();
|
||||
$responseProxy = $authSources->searchGroups($authSourceUid);
|
||||
break;
|
||||
case 'authSourcesImportSaveGroup':
|
||||
$responseProxy['success'] = true;
|
||||
$authSources = new AuthSources();
|
||||
$groupsDN = $_REQUEST['groupsDN'];
|
||||
$authSourceUid = $_REQUEST['authUid'];
|
||||
$responseProxy = $authSources->saveGroups($groupsDN, $authSourceUid);
|
||||
break;
|
||||
default:
|
||||
throw new Exception('The action "' . $action . '" is not allowed');
|
||||
@@ -156,7 +172,7 @@ try {
|
||||
echo json_encode($responseProxy, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
||||
} catch (Exception $exception) {
|
||||
$responseProxy['success'] = false;
|
||||
$responseProxy['message'] = $exception->getMessage();
|
||||
$responseProxy['message'] = htmlentities($exception->getMessage(), ENT_QUOTES, 'UTF-8');
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($responseProxy, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
||||
|
||||
Reference in New Issue
Block a user