2013-04-26 Sergio Martin <sergio.martin@artica.es>
* include/styles/pandora.css: Fix aesthetical issues * include/functions_modules.php: Mark as needy to calculate the module status count in an agent when disable/enable one of his modules. The part of server to avoid disabled modules in counts was made by ramon. BUG #3611683 * godmode/users/configure_user.php: Fix warnings due the latest fields added to database schemma * images/blank.gif: Add a missed image * godmode/agentes/agent_template.php: Fix a little feedback bug on template application and add category id to the fields copied from components to modules when apply a template git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8068 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
e5270b9e90
commit
d36d4a52e8
|
@ -1,3 +1,21 @@
|
|||
2013-04-26 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/styles/pandora.css: Fix aesthetical issues
|
||||
|
||||
* include/functions_modules.php: Mark as needy to calculate
|
||||
the module status count in an agent when disable/enable one of
|
||||
his modules. The part of server to avoid disabled modules in
|
||||
counts was made by ramon. BUG #3611683
|
||||
|
||||
* godmode/users/configure_user.php: Fix warnings due the
|
||||
latest fields added to database schemma
|
||||
|
||||
* images/blank.gif: Add a missed image
|
||||
|
||||
* godmode/agentes/agent_template.php: Fix a little feedback
|
||||
bug on template application and add category id to the
|
||||
fields copied from components to modules when apply a template
|
||||
|
||||
2013-04-25 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/users/user_list.php: changed the table layout and other
|
||||
|
|
|
@ -94,7 +94,8 @@ if (isset ($_POST["template_id"])) {
|
|||
'warning_inverse' => $row2['warning_inverse'],
|
||||
'critical_instructions' => $row2['critical_instructions'],
|
||||
'warning_instructions' => $row2['warning_instructions'],
|
||||
'unknown_instructions' => $row2['unknown_instructions']
|
||||
'unknown_instructions' => $row2['unknown_instructions'],
|
||||
'id_category' => $row2['id_category']
|
||||
);
|
||||
|
||||
$name = $row2["name"];
|
||||
|
@ -112,6 +113,9 @@ if (isset ($_POST["template_id"])) {
|
|||
if ($id_agente_modulo === false) {
|
||||
$error_count++;
|
||||
}
|
||||
else {
|
||||
$success_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,6 +127,12 @@ if ($new_user && $config['admin_can_add_user']) {
|
|||
//This attributes are inherited from global configuration
|
||||
$user_info['block_size'] = $config["block_size"];
|
||||
$user_info['flash_chart'] = $config["flash_charts"];
|
||||
|
||||
if (enterprise_installed() && defined('METACONSOLE')) {
|
||||
$user_info['metaconsole_agents_manager'] = 0;
|
||||
$user_info['metaconsole_assigned_server'] = '';
|
||||
$user_info['metaconsole_access_node'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ($create_user) {
|
||||
|
@ -158,6 +164,9 @@ if ($create_user) {
|
|||
$values['last_pass_change'] = date ("Y/m/d H:i:s", get_system_time());
|
||||
if(defined('METACONSOLE')) {
|
||||
$values['metaconsole_access'] = get_parameter ('metaconsole_access', 'basic');
|
||||
$values['metaconsole_agents_manager'] = get_parameter ('metaconsole_agents_manager', '0');
|
||||
$values['metaconsole_assigned_server'] = get_parameter ('metaconsole_assigned_server', '');
|
||||
$values['metaconsole_access_node'] = get_parameter ('metaconsole_access_node', '0');
|
||||
}
|
||||
}
|
||||
$values["not_login"] = (bool)get_parameter ('not_login', false);
|
||||
|
@ -253,6 +262,9 @@ if ($update_user) {
|
|||
|
||||
if(enterprise_installed() && defined('METACONSOLE')) {
|
||||
$values['metaconsole_access'] = get_parameter ('metaconsole_access');
|
||||
$values['metaconsole_agents_manager'] = get_parameter ('metaconsole_agents_manager', '0');
|
||||
$values['metaconsole_assigned_server'] = get_parameter ('metaconsole_assigned_server', '');
|
||||
$values['metaconsole_access_node'] = get_parameter ('metaconsole_access_node', '0');
|
||||
}
|
||||
$values["not_login"] = (bool)get_parameter ('not_login', false);
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 49 B |
|
@ -152,52 +152,30 @@ function modules_copy_agent_module_to_agent ($id_agent_module, $id_destiny_agent
|
|||
*/
|
||||
function modules_change_disabled($id_agent_module, $new_value = 1) {
|
||||
$id_agent_module = (array) $id_agent_module;
|
||||
|
||||
// Define the operation dependes if is disable or enable
|
||||
if($new_value == 1) {
|
||||
$operation = '-';
|
||||
}
|
||||
else {
|
||||
$operation = '+';
|
||||
}
|
||||
|
||||
$id_agent_module_changed = array();
|
||||
|
||||
foreach($id_agent_module as $id_module) {
|
||||
// If the module is already disabled/enabled abort
|
||||
// If the module is already disabled/enabled ignore
|
||||
$current_disabled = db_get_value('disabled', 'tagente_modulo', 'id_agente_modulo', $id_module);
|
||||
if($current_disabled == $new_value) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$status = modules_get_agentmodule_status($id_module);
|
||||
|
||||
$agent_id = modules_get_agentmodule_agent($id_module);
|
||||
|
||||
// Define the field to update depends the status
|
||||
switch($status) {
|
||||
case AGENT_MODULE_STATUS_NO_DATA:
|
||||
$modification = 'notinit_count = notinit_count ' . $operation . ' 1,';
|
||||
break;
|
||||
case AGENT_MODULE_STATUS_CRITICAL_BAD:
|
||||
$modification = 'critical_count = critical_count ' . $operation . ' 1,';
|
||||
break;
|
||||
case AGENT_MODULE_STATUS_WARNING:
|
||||
$modification = 'warning_count = warning_count ' . $operation . ' 1,';
|
||||
break;
|
||||
case AGENT_MODULE_STATUS_NORMAL:
|
||||
$modification = 'normal_count = normal_count ' . $operation . ' 1,';
|
||||
break;
|
||||
case AGENT_MODULE_STATUS_UNKNOW:
|
||||
$modification = 'unknown_count = unknown_count ' . $operation . ' 1,';
|
||||
break;
|
||||
default:
|
||||
$modification = '';
|
||||
break;
|
||||
}
|
||||
$id_agent_changed[] = modules_get_agentmodule_agent($id_module);
|
||||
$id_agent_module_changed[] = $id_module;
|
||||
}
|
||||
|
||||
$result = db_process_sql_update('tagente_modulo', array('disabled' => $new_value), array('id_agente_modulo' => $id_agent_module));
|
||||
if(empty($id_agent_module_changed)) {
|
||||
$result = false;
|
||||
}
|
||||
else {
|
||||
$result = db_process_sql_update('tagente_modulo', array('disabled' => (int) $new_value), array('id_agente_modulo' => $id_agent_module_changed));
|
||||
}
|
||||
|
||||
if($result) {
|
||||
// Change the agent flag to update modules count
|
||||
db_process_sql_update('tagente', array('update_module_count' => 1), array('id_agente' => $id_agent_changed));
|
||||
return NOERR;
|
||||
}
|
||||
else {
|
||||
|
@ -316,10 +294,7 @@ function modules_update_agent_module ($id, $values, $onlyNoDeletePending = false
|
|||
|
||||
// Disable action requires a special function
|
||||
if (isset($values['disabled'])) {
|
||||
$result_disable = NOERR;
|
||||
if ($values['disabled'])
|
||||
$result_disable = modules_change_disabled($id,
|
||||
$values['disabled']);
|
||||
$result_disable = modules_change_disabled($id, $values['disabled']);
|
||||
|
||||
unset($values['disabled']);
|
||||
}
|
||||
|
|
|
@ -1658,6 +1658,7 @@ div#main_pure {
|
|||
}
|
||||
.img_help {
|
||||
cursor: help;
|
||||
margin-top: -5px;
|
||||
}
|
||||
#loading {
|
||||
position:fixed;
|
||||
|
|
Loading…
Reference in New Issue