mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'ent-5827-llamada-a-la-api-de-crear-agentes' into 'develop'
add return error if group = 0 on new agent api See merge request artica/pandorafms!3212
This commit is contained in:
commit
b3a588d283
@ -1506,6 +1506,12 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((int) $other['data'][3] == 0) {
|
||||||
|
$agent_creation_error = __('The agent could not be created, for security reasons use a group another than 0');
|
||||||
|
returnError('generic error', $agent_creation_error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$alias = io_safe_input(trim(preg_replace('/[\/\\\|%#&$]/', '', $other['data'][0])));
|
$alias = io_safe_input(trim(preg_replace('/[\/\\\|%#&$]/', '', $other['data'][0])));
|
||||||
$direccion_agente = io_safe_input($other['data'][1]);
|
$direccion_agente = io_safe_input($other['data'][1]);
|
||||||
$nombre_agente = hash('sha256', $direccion_agente.'|'.$direccion_agente.'|'.time().'|'.sprintf('%04d', rand(0, 10000)));
|
$nombre_agente = hash('sha256', $direccion_agente.'|'.$direccion_agente.'|'.time().'|'.sprintf('%04d', rand(0, 10000)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user