TASK-229 Validate all Endpoints for delete Old Ajax files

This commit is contained in:
Brayan Pereyra
2025-09-18 03:47:29 +00:00
parent 9ea66b21a1
commit a7fe9048bf
15 changed files with 937 additions and 45 deletions

View File

@@ -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);

View File

@@ -306,7 +306,7 @@
gridText: "[]",
signInPolicyForLDAP: "1",
inactiveUsers: "",
role: "PROCESSMAKER_OPERATOR",
role: "LURANA_OPERATOR",
groupIdentifier: "member",
userClassIdentifier: "",
groupClassIdentifier: "(objectclass=posixgroup)(objectclass=group)(objectclass=groupofuniquenames)",
@@ -356,7 +356,7 @@
gridText: "[]",
signInPolicyForLDAP: "1",
inactiveUsers: "",
role: "PROCESSMAKER_OPERATOR",
role: "LURANA_OPERATOR",
groupIdentifier: "member",
userClassIdentifier: "",
groupClassIdentifier: "(objectclass=posixgroup)(objectclass=group)(objectclass=groupofuniquenames)",
@@ -381,7 +381,7 @@
let formDataForName = new FormData();
formDataForName.append("AUTH_SOURCE_NAME", form.name);
//axios.post(this.$root.baseUrl() + "authSources/ldapAdvancedProxy.php?functionAccion=ldapVerifyName", formDataForName)
axios.post(this.$root.baseUrl() + "authSources/authSourcesProxy.php?action=authSourcesVerifyName", formDataForName)
axios.post(this.$root.baseUrl() + "authSources/authSourcesProxy?action=authSourcesVerifyName", formDataForName)
.then(response => {
//the name is valid
if (response.data.row === false || (this.form.uid !== "" && typeof this.form.uid === "string")) {

View File

@@ -142,7 +142,7 @@
let formData = new FormData();
formData.append("AUTH_SOURCE_NAME", this.fileContent.AUTH_SOURCE_NAME);
//axios.post(this.$root.baseUrl() + "authSources/ldapAdvancedProxy.php?functionAccion=ldapVerifyName", formData)
axios.post(this.$root.baseUrl() + "authSources/authSourcesProxy.php?action=authSourcesVerifyName", formData)
axios.post(this.$root.baseUrl() + "authSources/authSourcesProxy?action=authSourcesVerifyName", formData)
.then(response => {
this.newName = response.data.row === false;
this.validationResult = response.data;