Added module crontab to local modules with rc. Ticket #246

This commit is contained in:
Arturo Gonzalez 2017-02-10 11:43:12 +01:00
parent 6b168873fa
commit 9a73cb56d7
5 changed files with 18 additions and 9 deletions

View File

@ -499,7 +499,7 @@ if ($agents !== false) {
/* Begin Update tagente.remote 0/1 with remote agent function return */
if(enterprise_hook('config_agents_has_remote_configuration',$agent['id_agente'])){
if(enterprise_hook('config_agents_has_remote_configuration',array($agent['id_agente']))){
db_process_sql_update('tagente', array('remote' => 1),'id_agente = '.$agent['id_agente'].'');
}
else{
@ -584,7 +584,7 @@ if ($agents !== false) {
// Has remote configuration ?
if (enterprise_installed()) {
enterprise_include_once('include/functions_config_agents.php');
if (enterprise_hook('config_agents_has_remote_configuration',$agent["id_agente"])) {
if (enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"]))) {
echo "<a href='index.php?" .
"sec=gagente&" .
"sec2=godmode/agentes/configurar_agente&" .

View File

@ -396,7 +396,7 @@ switch ($moduletype) {
$remote_conf = false;
if (enterprise_installed()) {
enterprise_include_once('include/functions_config_agents.php');
$remote_conf = enterprise_hook('config_agents_has_remote_configuration',$id_agente);
$remote_conf = enterprise_hook('config_agents_has_remote_configuration',array($id_agente));
}
/* Categories is an array containing the allowed module types

View File

@ -576,11 +576,20 @@ $table_advanced->data[10][1] = html_print_textarea ('unknown_instructions', 2, 6
$table_advanced->colspan[10][1] = 6;
if (isset($id_agente) && $moduletype == MODULE_DATA) {
$has_remote_conf = enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"]));
if ($has_remote_conf) {
$table_advanced->data[11][0] = __('Cron') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour, $minute, $mday, $month, $wday, true, $disabledBecauseInPolicy);
$table_advanced->colspan[11][1] = 6;
}
else {
$table_advanced->data[11][0] = __('Cron') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour, $minute, $mday, $month, $wday, true, true);
$table_advanced->colspan[11][1] = 6;
}
}
else {
$table_advanced->data[11][0] = __('Cron') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);

View File

@ -231,7 +231,7 @@ function modules_copy_agent_module_to_agent ($id_agent_module, $id_destiny_agent
if ($module['id_modulo'] == MODULE_DATA) {
if (enterprise_installed()) {
if (enterprise_hook('config_agents_has_remote_configuration',$id_agente)) {
if (enterprise_hook('config_agents_has_remote_configuration',array($id_agente))) {
$result = enterprise_hook(
'config_agents_copy_agent_module_to_agent',
array($id_agent_module, $id_new_module));

View File

@ -586,7 +586,7 @@ foreach ($agents as $agent) {
if (enterprise_installed()) {
enterprise_include_once('include/functions_config_agents.php');
if (enterprise_hook('config_agents_has_remote_configuration',$agent["id_agente"])) {
if (enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"]))) {
$data[9] = html_print_image("images/application_edit.png", true, array("align" => 'middle', "title" => __('Remote config')));