mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
Changed function that creates a new agent from metaconsole to set field name with a hash and fixed bug when setting alias in database
This commit is contained in:
parent
14419759b0
commit
3fd588353b
@ -94,7 +94,8 @@ function agents_create_agent ($name, $id_group, $interval, $ip_address, $values
|
|||||||
|
|
||||||
if (! is_array ($values))
|
if (! is_array ($values))
|
||||||
$values = array ();
|
$values = array ();
|
||||||
$values['nombre'] = $name;
|
$values['alias'] = $name;
|
||||||
|
$values['nombre'] = hash("sha256",$name . "|" .$ip_address ."|". time() ."|". sprintf("%04d", rand(0,10000)));
|
||||||
$values['id_grupo'] = $id_group;
|
$values['id_grupo'] = $id_group;
|
||||||
$values['intervalo'] = $interval;
|
$values['intervalo'] = $interval;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user