mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-24 14:25:18 +02:00
2012-06-20 Miguel de Dios <miguel.dedios@artica.es>
* extensions/net_tools.php: cleaned source code style. * extensions/module_groups.php, operation/agentes/status_monitor.php: fixed the lost "module group" "unasigned". Fixes: #3532075 MERGED FROM 4.0.2 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6614 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
d9552510b5
commit
e9abfff98e
@ -1,3 +1,15 @@
|
|||||||
|
2012-06-20 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* extensions/net_tools.php: cleaned source code style.
|
||||||
|
|
||||||
|
* extensions/module_groups.php,
|
||||||
|
operation/agentes/status_monitor.php: fixed the lost "module group"
|
||||||
|
"unasigned".
|
||||||
|
|
||||||
|
Fixes: #3532075
|
||||||
|
|
||||||
|
MERGED FROM 4.0.2
|
||||||
|
|
||||||
2012-06-20 Sergio Martin <sergio.martin@artica.es>
|
2012-06-20 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* include/functions_modules.php
|
* include/functions_modules.php
|
||||||
|
@ -25,8 +25,8 @@ if (is_ajax ()) {
|
|||||||
$get_info_alert_module_group = (bool)get_parameter('get_info_alert_module_group');
|
$get_info_alert_module_group = (bool)get_parameter('get_info_alert_module_group');
|
||||||
$module_group = (int)get_parameter('module_group');
|
$module_group = (int)get_parameter('module_group');
|
||||||
$id_agent_group = (int)get_parameter('id_agent_group');
|
$id_agent_group = (int)get_parameter('id_agent_group');
|
||||||
|
|
||||||
$data = false;
|
$data = false;
|
||||||
if ($get_info_alert_module_group) {
|
if ($get_info_alert_module_group) {
|
||||||
$agents = agents_get_group_agents($id_agent_group);
|
$agents = agents_get_group_agents($id_agent_group);
|
||||||
if (!empty($agents)) {
|
if (!empty($agents)) {
|
||||||
@ -67,15 +67,15 @@ if (is_ajax ()) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!$data){
|
if (!$data) {
|
||||||
echo '<i>These module/s have no alerts or alert/s are not fired</i>';
|
echo '<i>These module/s have no alerts or alert/s are not fired</i>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
echo '<i>No available data</i>';
|
echo '<i>No available data</i>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
echo '<i>No available data</i>';
|
echo '<i>No available data</i>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -93,11 +93,11 @@ if (is_ajax ()) {
|
|||||||
*/
|
*/
|
||||||
function mainModuleGroups() {
|
function mainModuleGroups() {
|
||||||
global $config; //the useful global var of Pandora Console, it has many data can you use
|
global $config; //the useful global var of Pandora Console, it has many data can you use
|
||||||
|
|
||||||
require_once ('include/functions_reporting.php');
|
require_once ('include/functions_reporting.php');
|
||||||
require_once($config['homedir'] . "/include/functions_agents.php");
|
require_once($config['homedir'] . "/include/functions_agents.php");
|
||||||
require_once($config['homedir'] . "/include/functions_users.php");
|
require_once($config['homedir'] . "/include/functions_users.php");
|
||||||
|
|
||||||
//The big query
|
//The big query
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
@ -121,8 +121,8 @@ function mainModuleGroups() {
|
|||||||
FROM tagente_modulo
|
FROM tagente_modulo
|
||||||
WHERE id_module_group = %d AND disabled = 0 AND delete_pending = 0)
|
WHERE id_module_group = %d AND disabled = 0 AND delete_pending = 0)
|
||||||
GROUP BY estado";
|
GROUP BY estado";
|
||||||
break;
|
break;
|
||||||
case "oracle":
|
case "oracle":
|
||||||
$sql = "SELECT COUNT(id_agente) AS count, estado
|
$sql = "SELECT COUNT(id_agente) AS count, estado
|
||||||
FROM tagente_estado
|
FROM tagente_estado
|
||||||
WHERE utimestamp != 0 AND id_agente IN
|
WHERE utimestamp != 0 AND id_agente IN
|
||||||
|
@ -46,11 +46,11 @@ function main_net_tools () {
|
|||||||
echo "<input name=submit type=submit class='sub next' value='".__('Execute')."'>";
|
echo "<input name=submit type=submit class='sub next' value='".__('Execute')."'>";
|
||||||
echo "</tr></table>";
|
echo "</tr></table>";
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
|
|
||||||
|
|
||||||
$operation = get_parameter ("operation",0);
|
$operation = get_parameter ("operation",0);
|
||||||
$community = get_parameter ("community","public");
|
$community = get_parameter ("community","public");
|
||||||
|
|
||||||
switch($operation) {
|
switch($operation) {
|
||||||
case 1:
|
case 1:
|
||||||
ob_start();
|
ob_start();
|
||||||
|
@ -48,7 +48,7 @@ $ag_modulename = (string) get_parameter ('ag_modulename');
|
|||||||
$ag_group = (int) get_parameter ('ag_group', 0);
|
$ag_group = (int) get_parameter ('ag_group', 0);
|
||||||
$offset = (int) get_parameter ('offset');
|
$offset = (int) get_parameter ('offset');
|
||||||
$status = (int) get_parameter ('status', 4);
|
$status = (int) get_parameter ('status', 4);
|
||||||
$modulegroup = (int) get_parameter ('modulegroup');
|
$modulegroup = (int) get_parameter ('modulegroup', -1);
|
||||||
$sql_extra = '';
|
$sql_extra = '';
|
||||||
$refr = get_parameter('refr', 0);
|
$refr = get_parameter('refr', 0);
|
||||||
// Sort functionality
|
// Sort functionality
|
||||||
@ -81,8 +81,10 @@ echo '</td>';
|
|||||||
|
|
||||||
echo '<td valign="middle">'.__('Module group').'</td>';
|
echo '<td valign="middle">'.__('Module group').'</td>';
|
||||||
echo '<td valign="middle">';
|
echo '<td valign="middle">';
|
||||||
html_print_select_from_sql ("SELECT * FROM tmodule_group ORDER BY name",
|
$rows = db_get_all_rows_sql("SELECT * FROM tmodule_group ORDER BY name");
|
||||||
'modulegroup', $modulegroup, '',__('All'), 0, false, false, true, false, 'width: 100px;');
|
$rows = io_safe_output($rows);
|
||||||
|
$rows[0] = __('Not assigned');
|
||||||
|
html_print_select($rows, 'modulegroup', $modulegroup, '', __('All'), -1);
|
||||||
|
|
||||||
echo '</td></tr><tr><td valign="middle">'.__('Module name').'</td>';
|
echo '</td></tr><tr><td valign="middle">'.__('Module name').'</td>';
|
||||||
echo '<td valign="middle">';
|
echo '<td valign="middle">';
|
||||||
@ -92,7 +94,6 @@ $user_groups = implode (",", array_keys (users_get_groups ()));
|
|||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
|
|
||||||
$profiles = db_get_all_rows_sql('SELECT id_grupo
|
$profiles = db_get_all_rows_sql('SELECT id_grupo
|
||||||
FROM tusuario_perfil AS t1
|
FROM tusuario_perfil AS t1
|
||||||
INNER JOIN tperfil AS t2 ON t1.id_perfil = t2.id_perfil
|
INNER JOIN tperfil AS t2 ON t1.id_perfil = t2.id_perfil
|
||||||
@ -164,8 +165,8 @@ switch ($config["dbtype"]) {
|
|||||||
FROM tagente
|
FROM tagente
|
||||||
WHERE';
|
WHERE';
|
||||||
|
|
||||||
$sql .= $extra_sql.'(';
|
$sql .= $extra_sql.'(';
|
||||||
|
|
||||||
if ($flag_is_admin || $flag_all_group) {
|
if ($flag_is_admin || $flag_all_group) {
|
||||||
$sql .= ' 1 = 1 ';
|
$sql .= ' 1 = 1 ';
|
||||||
}
|
}
|
||||||
@ -254,7 +255,7 @@ switch ($sortField) {
|
|||||||
$order = array('field' => 'tagente_modulo.nombre', 'order' => 'DESC');
|
$order = array('field' => 'tagente_modulo.nombre', 'order' => 'DESC');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'interval':
|
case 'interval':
|
||||||
switch ($sort) {
|
switch ($sort) {
|
||||||
case 'up':
|
case 'up':
|
||||||
@ -302,7 +303,7 @@ switch ($sortField) {
|
|||||||
$order = array('field' => 'tagente_estado.utimestamp', 'order' => 'DESC');
|
$order = array('field' => 'tagente_estado.utimestamp', 'order' => 'DESC');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$selectAgentNameUp = $selected;
|
$selectAgentNameUp = $selected;
|
||||||
$selectAgentNameDown = '';
|
$selectAgentNameDown = '';
|
||||||
@ -339,7 +340,7 @@ elseif($user_groups != '') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Module group
|
// Module group
|
||||||
if ($modulegroup > 0) {
|
if ($modulegroup > -1) {
|
||||||
$sql .= sprintf (" AND tagente_modulo.id_module_group = '%d'", $modulegroup);
|
$sql .= sprintf (" AND tagente_modulo.id_module_group = '%d'", $modulegroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user