2019-01-30 16:18:44 +01:00
|
|
|
<?php
|
2010-09-09 16:07:21 +02:00
|
|
|
|
2021-11-04 16:28:15 +01:00
|
|
|
// Pandora FMS - http://pandorafms.com
|
2010-09-09 16:07:21 +02:00
|
|
|
// ==================================================
|
2020-11-27 13:52:35 +01:00
|
|
|
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
2010-09-09 16:07:21 +02:00
|
|
|
// Please see http://pandorafms.org for full contribution list
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation for version 2.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
// Load global vars
|
|
|
|
global $config;
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
check_login();
|
2010-09-09 16:07:21 +02:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
|
2022-02-01 13:39:18 +01:00
|
|
|
db_pandora_audit(
|
|
|
|
AUDIT_LOG_ACL_VIOLATION,
|
|
|
|
'Trying to access Setup Management'
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
include 'general/noaccess.php';
|
|
|
|
return;
|
2010-09-09 16:07:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
echo '<form id="form_setup" method="post">';
|
2015-06-25 10:07:53 +02:00
|
|
|
$table = new stdClass();
|
2015-06-16 16:09:50 +02:00
|
|
|
$table->width = '100%';
|
|
|
|
$table->class = 'databox filters';
|
2010-09-09 16:07:21 +02:00
|
|
|
|
2015-06-16 16:09:50 +02:00
|
|
|
$table->style[0] = 'font-weight: bolder;';
|
2010-09-09 16:07:21 +02:00
|
|
|
|
|
|
|
$table->data[0][0] = __('Name:');
|
2011-04-27 15:43:31 +02:00
|
|
|
$table->data[0][1] = html_print_input_text('name', $name, __('Name'), 20, 30, true);
|
2010-09-09 16:07:21 +02:00
|
|
|
$table->data[1][0] = __('Description');
|
2011-04-27 15:43:31 +02:00
|
|
|
$table->data[1][1] = html_print_textarea('description', 5, 10, $description, '', true);
|
2010-09-09 16:07:21 +02:00
|
|
|
$icons = get_list_os_icons_dir();
|
|
|
|
$table->data[2][0] = __('Icon');
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data[2][1] = html_print_select($icons, 'icon', $icon, 'show_icon_OS();', __('None'), 0, true);
|
|
|
|
$table->data[2][1] .= ' <span id="icon_image">'.ui_print_os_icon($idOS, false, true).'</span>';
|
2010-09-09 16:07:21 +02:00
|
|
|
|
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
|
|
|
|
2011-04-27 15:43:31 +02:00
|
|
|
html_print_table($table);
|
2010-09-09 16:07:21 +02:00
|
|
|
|
2011-04-27 15:43:31 +02:00
|
|
|
html_print_input_hidden('id_os', $idOS);
|
2019-01-30 16:18:44 +01:00
|
|
|
html_print_input_hidden('action', $actionHidden);
|
2010-09-09 16:07:21 +02:00
|
|
|
|
|
|
|
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
2019-01-30 16:18:44 +01:00
|
|
|
html_print_submit_button($textButton, 'update_button', false, $classButton);
|
2010-09-09 16:07:21 +02:00
|
|
|
echo '</div>';
|
|
|
|
echo '</form>';
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
|
|
|
|
function get_list_os_icons_dir()
|
|
|
|
{
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
$return = [];
|
|
|
|
|
|
|
|
$items = scandir($config['homedir'].'/images/os_icons');
|
|
|
|
|
|
|
|
foreach ($items as $item) {
|
|
|
|
if (strstr($item, '_small.png') || strstr($item, '_small.gif')
|
|
|
|
|| strstr($item, '_small.jpg')
|
|
|
|
) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strstr($item, '.png') || strstr($item, '.gif')
|
|
|
|
|| strstr($item, '.jpg')
|
|
|
|
) {
|
|
|
|
$return[$item] = $item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $return;
|
2010-09-09 16:07:21 +02:00
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
|
|
|
|
|
2010-09-09 16:07:21 +02:00
|
|
|
?>
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
function show_icon_OS() {
|
2011-02-28 17:53:09 +01:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
var params = [];
|
|
|
|
params.push("get_image_path=1");
|
|
|
|
params.push('img_src=images/os_icons/' + $("#icon").val());
|
|
|
|
params.push("page=include/ajax/skins.ajax");
|
|
|
|
jQuery.ajax ({
|
|
|
|
data: params.join ("&"),
|
|
|
|
type: 'POST',
|
|
|
|
url: action="ajax.php",
|
|
|
|
async: false,
|
|
|
|
timeout: 10000,
|
|
|
|
success: function (data) {
|
|
|
|
$("#icon_image").html(data);
|
|
|
|
}
|
|
|
|
});
|
2010-09-09 16:07:21 +02:00
|
|
|
}
|
|
|
|
</script>
|