2012-07-24 Miguel de Dios <miguel.dedios@artica.es>

* godmode/agentes/module_manager_editor.php: fixed the javascript
	error when the module have "remote config" and set to translate
	some strings that were not translated.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6809 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-07-25 11:11:29 +00:00
parent e6ae8a76e0
commit 2be7245510
2 changed files with 62 additions and 41 deletions

View File

@ -1,3 +1,9 @@
2012-07-24 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/module_manager_editor.php: fixed the javascript
error when the module have "remote config" and set to translate
some strings that were not translated.
2012-07-24 Miguel de Dios <miguel.dedios@artica.es> 2012-07-24 Miguel de Dios <miguel.dedios@artica.es>
* operation/messages/message_edit.php, * operation/messages/message_edit.php,

View File

@ -73,11 +73,17 @@ if (is_ajax ()) {
switch ($config["dbtype"]) { switch ($config["dbtype"]) {
case "mysql": case "mysql":
$component['type'] = db_get_value_sql('SELECT id_tipo FROM ttipo_modulo WHERE nombre LIKE "' . $typeName . '"'); $component['type'] = db_get_value_sql('
SELECT id_tipo
FROM ttipo_modulo
WHERE nombre LIKE "' . $typeName . '"');
break; break;
case "postgresql": case "postgresql":
case "oracle": case "oracle":
$component['type'] = db_get_value_sql('SELECT id_tipo FROM ttipo_modulo WHERE nombre LIKE \'' . $typeName . '\''); $component['type'] = db_get_value_sql('
SELECT id_tipo
FROM ttipo_modulo
WHERE nombre LIKE \'' . $typeName . '\'');
break; break;
} }
@ -105,9 +111,10 @@ if (is_ajax ()) {
$snmp3_privacy_pass = get_parameter('snmp3_privacy_pass'); $snmp3_privacy_pass = get_parameter('snmp3_privacy_pass');
$snmp_port = get_parameter('snmp_port'); $snmp_port = get_parameter('snmp_port');
$snmpwalk = get_snmpwalk($ip_target, $snmp_version, $snmp_community, $snmp3_auth_user, $snmpwalk = get_snmpwalk($ip_target, $snmp_version, $snmp_community,
$snmp3_security_level, $snmp3_auth_method, $snmp3_auth_pass, $snmp3_auth_user, $snmp3_security_level, $snmp3_auth_method,
$snmp3_privacy_method, $snmp3_privacy_pass, 1, "", $snmp_port); $snmp3_auth_pass, $snmp3_privacy_method, $snmp3_privacy_pass,
1, "", $snmp_port);
if ($snmpwalk === false) { if ($snmpwalk === false) {
echo json_encode ($snmpwalk); echo json_encode ($snmpwalk);
@ -275,7 +282,6 @@ if($is_function_policies !== ENTERPRISE_NOT_HOOK) {
db_pandora_audit("Agent management", "Unlink module " . $id_agent_module); db_pandora_audit("Agent management", "Unlink module " . $id_agent_module);
} }
} }
global $__code_from; global $__code_from;
$__code_from = 'modules'; $__code_from = 'modules';
@ -336,12 +342,13 @@ switch ($moduletype) {
/* WARNING: type 7 is reserved on enterprise */ /* WARNING: type 7 is reserved on enterprise */
default: default:
if (enterprise_include ('godmode/agentes/module_manager_editor.php') === ENTERPRISE_NOT_HOOK) { if (enterprise_include ('godmode/agentes/module_manager_editor.php') === ENTERPRISE_NOT_HOOK) {
echo '<h3 class="error">DEBUG: Invalid module type specified in '.__FILE__.':'.__LINE__.'</h3>'; echo '<h3 class="error">';
echo 'Most likely you have recently upgraded from an earlier version of Pandora and either <br /> echo sprintf(__('DEBUG: Invalid module type specified in %s:%s'), __FILE__, __LINE__);
echo '</h3>';
echo __('Most likely you have recently upgraded from an earlier version of Pandora and either <br />
1) forgot to use the database converter<br /> 1) forgot to use the database converter<br />
2) used a bad version of the database converter (see Bugreport #2124706 for the solution)<br /> 2) used a bad version of the database converter (see Bugreport #2124706 for the solution)<br />
3) found a new bug - please report a way to duplicate this error'; 3) found a new bug - please report a way to duplicate this error');
return; return;
} }
break; break;
@ -418,6 +425,7 @@ $(document).ready (function () {
configure_modules_form (); configure_modules_form ();
$("#module_form").submit(function() { $("#module_form").submit(function() {
if (typeof(check_remote_conf) != 'undefined') {
if (check_remote_conf) { if (check_remote_conf) {
//Check the name //Check the name
name = $("#text-name").val(); name = $("#text-name").val();
@ -427,19 +435,26 @@ $(document).ready (function () {
regexp_plugin = new RegExp('^module_plugin\\s*'); regexp_plugin = new RegExp('^module_plugin\\s*');
if (remote_config == '' || remote_config.match(regexp_name) || remote_config.match(regexp_plugin) || $("#id_module_type").val()==100 || $("#hidden-id_module_type_hidden").val()==100) return true; if (remote_config == '' || remote_config.match(regexp_name) ||
remote_config.match(regexp_plugin) ||
$("#id_module_type").val()==100 ||
$("#hidden-id_module_type_hidden").val()==100) {
return true;
}
else { else {
alert("<?php echo __("Error, The field name and name in module_name in data configuration are different.");?>"); alert("<?php echo __("Error, The field name and name in module_name in data configuration are different.");?>");
return false; return false;
} }
} }
}
return true; return true;
}); });
function checkKeepaliveModule() { function checkKeepaliveModule() {
// keepalive modules have id = 100 // keepalive modules have id = 100
if($("#id_module_type").val()==100 || $("#hidden-id_module_type_hidden").val()==100) { if ($("#id_module_type").val()==100 ||
$("#hidden-id_module_type_hidden").val()==100) {
$("#simple-configuration_data").hide(); $("#simple-configuration_data").hide();
} }
else { else {