customer_key == FREE_USER) { echo '
'; echo html_print_image("images/information.png", true) . ' '; /* Translators: Do not translade Update Manager, it's the name of the program */ echo __('The new Update Manager client is shipped with Pandora FMS It helps system administrators to update their Pandora FMS automatically, since the Update Manager does the task of getting new modules, new plugins and new features (even full migrations tools for future versions) automatically.'); echo '

'; echo __('Update Manager is one of the most advanced features of Pandora FMS Enterprise version, for more information visit http://pandorafms.com.'); echo '

'; echo __('Update Manager sends anonymous information about Pandora FMS usage (number of agents and modules running). To disable it, just delete extension or remove remote server address from Update Manager plugin setup.'); echo '

'; } $user_key = get_user_key ($settings); $update_package = (bool) get_parameter_post ('update_package'); if ($update_package) { if ($config['enterprise_installed'] == 1) { echo '

'.__('Updating').'...

'; flush (); $force = (bool) get_parameter_post ('force_update'); um_client_upgrade_to_latest ($user_key, $force); /* TODO: Add a new in tnews */ } else { echo '
' . __('This is an Enterprise feature. Visit %s for more information.', 'http://pandorafms.com') . '
'; } } if (isset($_FILES["fileloaded"]["error"]) && !$_FILES["fileloaded"]["error"]) { $extension = substr($_FILES["fileloaded"]["name"], strlen($_FILES["fileloaded"]["name"])-4, 4); if($extension != '.oum') { $error = '
'.__('Incorrect file extension').'
'; } else { $tempDir = sys_get_temp_dir()."/tmp_oum/"; $zip = new ZipArchive; if ($zip->open($_FILES["fileloaded"]['tmp_name']) === TRUE) { $zip->extractTo($tempDir); $zip->close(); } else { $error = '
'.__('Update cannot be opened').'
'; } $package = um_package_info_from_paths ($tempDir); if ($package === false) { $error = '
'.__('Error, the file package is empty or corrupted.').'
'; } else { $settings = um_db_load_settings (); if($settings->current_update >= $package->id) { $error = '
'.__('Your system version is higher or equal than the loaded package').'
'; } else { $binary_paths = um_client_get_files ($tempDir."binary/"); foreach($binary_paths as $key => $paths) { foreach($paths as $index => $path) { $tempDir_scaped = preg_replace('/\//', '\/', $tempDir."binary"); $binary_paths[$key][$index] = preg_replace('/^'.$tempDir_scaped.'/', ' ', $path); } } $code_paths = um_client_get_files ($tempDir."code/"); foreach($code_paths as $key => $paths) { foreach($paths as $index => $path) { $tempDir_scaped = preg_replace('/\//', '\/', $tempDir."code"); $code_paths[$key][$index] = preg_replace('/^'.$tempDir_scaped.'/', ' ', $path); } } $sql_paths = um_client_get_files ($tempDir); foreach($sql_paths as $key => $paths) { foreach($paths as $index => $path) { if($path != $tempDir || ($key == 'info_package' && $path == $tempDir)) { unset($sql_paths[$key]); } } } $updates_binary = array(); $updates_code = array(); $updates_sql = array(); if(!empty($binary_paths)) { $updates_binary = um_client_update_from_paths ($binary_paths, $tempDir, $package->id, 'binary'); } if(!empty($code_paths)) { $updates_code = um_client_update_from_paths ($code_paths, $tempDir, $package->id, 'code'); } if(!empty($sql_paths)) { $updates_sql = um_client_update_from_paths ($sql_paths, $tempDir, $package->id, 'sql'); } um_delete_directory($tempDir); $updates= array_merge((array) $updates_binary, (array) $updates_code, (array) $updates_sql); $package->updates = $updates; $settings = um_db_load_settings (); if(um_client_upgrade_to_package ($package, $settings, true)) { echo '
'.__('Successfully upgraded').'.
'; $settings = um_db_load_settings (); } else { echo '
'.__('Cannot be upgraded').'
'; } } } } } else { $error = '
'.__('File cannot be uploaded').'
'; } db_clean_cache(); $settings = um_db_load_settings (); $user_key = get_user_key ($settings); $package = um_client_check_latest_update ($settings, $user_key); if (check_acl ($config['id_user'], 0, 'PM')) { if ($package === true) { echo '
'.__('Your system is up-to-date').'.
'; } elseif ($package === false) { echo '
'.__('Server authorization rejected').'
'; } elseif ($package === 0) { echo '
'.__('Server connection failed').'
'; } else { echo '
'.__('There\'s a new update for Pandora FMS').'
'; $table->width = '98%'; $table->data = array (); $table->data[0][0] = ''.__('Id').''; $table->data[0][1] = $package->id; $table->data[1][0] = ''.__('Timestamp').''; $table->data[1][1] = $package->timestamp; $table->data[2][0] = ''.__('Description').''; $table->data[2][1] = html_entity_decode ($package->description); html_print_table ($table); echo '
'; echo '
'; echo __('Overwrite local changes'); html_print_checkbox ('force_update', '1', false); echo '

'; html_print_input_hidden ('update_package', 1); html_print_submit_button (__('Update'), 'update_button', false, 'class="sub upd"'); echo '

'; echo '
'; } if($error != '' && isset($_FILES["fileloaded"]["error"])) { echo $error; } unset($table); $table->width = '98%'; $table->data = array (); $table->colspan[0][0] = 2; $table->data[0][0] = '

'.__('Offline packages loader').'

'; $table->data[1][0] = ''; $table->data[1][0] .= ''; $table->data[1][1] = ''; echo '
'; html_print_table($table); echo '
'; } echo '

'.__('Your system version number is').': '.$settings->current_update.'

'; ?>