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
62dc186577
commit
8b1190353d
|
@ -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>
|
||||
|
||||
* include/functions_modules.php
|
||||
|
|
|
@ -25,8 +25,8 @@ if (is_ajax ()) {
|
|||
$get_info_alert_module_group = (bool)get_parameter('get_info_alert_module_group');
|
||||
$module_group = (int)get_parameter('module_group');
|
||||
$id_agent_group = (int)get_parameter('id_agent_group');
|
||||
|
||||
$data = false;
|
||||
|
||||
$data = false;
|
||||
if ($get_info_alert_module_group) {
|
||||
$agents = agents_get_group_agents($id_agent_group);
|
||||
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>';
|
||||
}
|
||||
}
|
||||
else{
|
||||
else {
|
||||
echo '<i>No available data</i>';
|
||||
}
|
||||
}
|
||||
else{
|
||||
else {
|
||||
echo '<i>No available data</i>';
|
||||
}
|
||||
}
|
||||
|
@ -93,11 +93,11 @@ if (is_ajax ()) {
|
|||
*/
|
||||
function mainModuleGroups() {
|
||||
global $config; //the useful global var of Pandora Console, it has many data can you use
|
||||
|
||||
|
||||
require_once ('include/functions_reporting.php');
|
||||
require_once($config['homedir'] . "/include/functions_agents.php");
|
||||
require_once($config['homedir'] . "/include/functions_users.php");
|
||||
|
||||
|
||||
//The big query
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
|
@ -121,8 +121,8 @@ function mainModuleGroups() {
|
|||
FROM tagente_modulo
|
||||
WHERE id_module_group = %d AND disabled = 0 AND delete_pending = 0)
|
||||
GROUP BY estado";
|
||||
break;
|
||||
case "oracle":
|
||||
break;
|
||||
case "oracle":
|
||||
$sql = "SELECT COUNT(id_agente) AS count, estado
|
||||
FROM tagente_estado
|
||||
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 "</tr></table>";
|
||||
echo "</form>";
|
||||
|
||||
|
||||
|
||||
|
||||
$operation = get_parameter ("operation",0);
|
||||
$community = get_parameter ("community","public");
|
||||
|
||||
|
||||
switch($operation) {
|
||||
case 1:
|
||||
ob_start();
|
||||
|
|
|
@ -48,7 +48,7 @@ $ag_modulename = (string) get_parameter ('ag_modulename');
|
|||
$ag_group = (int) get_parameter ('ag_group', 0);
|
||||
$offset = (int) get_parameter ('offset');
|
||||
$status = (int) get_parameter ('status', 4);
|
||||
$modulegroup = (int) get_parameter ('modulegroup');
|
||||
$modulegroup = (int) get_parameter ('modulegroup', -1);
|
||||
$sql_extra = '';
|
||||
$refr = get_parameter('refr', 0);
|
||||
// Sort functionality
|
||||
|
@ -81,8 +81,10 @@ echo '</td>';
|
|||
|
||||
echo '<td valign="middle">'.__('Module group').'</td>';
|
||||
echo '<td valign="middle">';
|
||||
html_print_select_from_sql ("SELECT * FROM tmodule_group ORDER BY name",
|
||||
'modulegroup', $modulegroup, '',__('All'), 0, false, false, true, false, 'width: 100px;');
|
||||
$rows = db_get_all_rows_sql("SELECT * FROM tmodule_group ORDER BY name");
|
||||
$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 valign="middle">';
|
||||
|
@ -92,7 +94,6 @@ $user_groups = implode (",", array_keys (users_get_groups ()));
|
|||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
|
||||
$profiles = db_get_all_rows_sql('SELECT id_grupo
|
||||
FROM tusuario_perfil AS t1
|
||||
INNER JOIN tperfil AS t2 ON t1.id_perfil = t2.id_perfil
|
||||
|
@ -164,8 +165,8 @@ switch ($config["dbtype"]) {
|
|||
FROM tagente
|
||||
WHERE';
|
||||
|
||||
$sql .= $extra_sql.'(';
|
||||
|
||||
$sql .= $extra_sql.'(';
|
||||
|
||||
if ($flag_is_admin || $flag_all_group) {
|
||||
$sql .= ' 1 = 1 ';
|
||||
}
|
||||
|
@ -254,7 +255,7 @@ switch ($sortField) {
|
|||
$order = array('field' => 'tagente_modulo.nombre', 'order' => 'DESC');
|
||||
break;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 'interval':
|
||||
switch ($sort) {
|
||||
case 'up':
|
||||
|
@ -302,7 +303,7 @@ switch ($sortField) {
|
|||
$order = array('field' => 'tagente_estado.utimestamp', 'order' => 'DESC');
|
||||
break;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
$selectAgentNameUp = $selected;
|
||||
$selectAgentNameDown = '';
|
||||
|
@ -339,7 +340,7 @@ elseif($user_groups != '') {
|
|||
}
|
||||
|
||||
// Module group
|
||||
if ($modulegroup > 0) {
|
||||
if ($modulegroup > -1) {
|
||||
$sql .= sprintf (" AND tagente_modulo.id_module_group = '%d'", $modulegroup);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue