2011-09-16 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_api.php: added the "getgroups" call.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4963 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2011-09-16 11:08:08 +00:00
parent 863a8c3047
commit c50a846a87
2 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2011-09-16 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_api.php: added the "getgroups" call.
2011-09-16 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_agents.php: Avoid bad syntax sql query

View File

@ -153,6 +153,32 @@ function isInACL($ip) {
}
//-------------------------DEFINED OPERATIONS FUNCTIONS-------------------------
function get_groups($thrash1, $thrash2, $other, $returnType, $user_in_db) {
if ($other['type'] == 'string') {
if ($other['data'] != '') {
returnError('error_parameter', 'Error in the parameters.');
return;
}
else {//Default values
$separator = ';';
}
}
else if ($other['type'] == 'array') {
$separator = $other['data'][0];
}
$groups = users_get_groups ($user_in_db, "IR");
$data_groups = array();
foreach ($groups as $id => $group) {
$data_groups[] = array($id, $group);
}
$data['type'] = 'array';
$data['data'] = $data_groups;
returnData($returnType, $data, $separator);
}
function get_agent_module_name_last_value($agentName, $moduleName, $other = ';', $returnType)
{