2012-04-19 Vanessa Gil <vanessa.gil@artica.es>

* godmode/setup/setup.php
	  index.php
	  pandora_db.sql
	  pandoradb_data.sql: Changed timezone setup.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6031 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
vgilc 2012-04-19 09:50:52 +00:00
parent 39fc3636f5
commit 7b8a15e7f2
5 changed files with 318 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2012-04-19 Vanessa Gil <vanessa.gil@artica.es>
* godmode/setup/setup.php
index.php
pandora_db.sql
pandoradb_data.sql: Changed timezone setup.
2012-04-18 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, extensions/update_manager.php,

View File

@ -20,6 +20,7 @@ check_login ();
if (is_ajax ()) {
$get_os_icon = (bool) get_parameter ('get_os_icon');
$select_timezone = get_parameter ('select_timezone', 0);
if ($get_os_icon) {
$id_os = (int) get_parameter ('id_os');
@ -27,6 +28,21 @@ if (is_ajax ()) {
return;
}
if ($select_timezone) {
$zone = get_parameter('zone');
$timezones = db_get_all_rows_sql ("SELECT timezone FROM ttimezone WHERE zone='$zone'");
if ($timezones === false)
$timezones = array();
foreach ($timezones as $timezone) {
foreach ($timezone as $key=>$name_tz) {
if ($key == 'timezone')
$timezone_name[$name_tz] = $name_tz;
}
}
echo json_encode($timezone_name);
}
return;
}
@ -186,8 +202,30 @@ if ($config["integria_enabled"]) {
$table->data[22][1] = html_print_select($inventories, 'integria_inventory', $config["integria_inventory"], '', '', '', true);
}
$zones = db_get_all_rows_sql("SELECT DISTINCT(zone) FROM ttimezone");
if ($zones === false) {
$zones = array();
}
foreach ($zones as $zone) {
foreach ($zone as $key=>$name) {
$zone_name[$name] = $name;
}
}
$timezones = db_get_all_rows_sql ("SELECT timezone FROM ttimezone WHERE zone='Africa'");
foreach ($timezones as $timezone) {
foreach ($timezone as $key=>$name_tz) {
if ($key == 'timezone')
$timezone_n[$name_tz] = $name_tz;
}
}
$table->data[23][0] = __('Timezone setup');
$table->data[23][1] = html_print_input_text ('timezone', $config["timezone"], '', 25, 25, true);
$table->data[23][1] = html_print_input_text_extended ('timezone_text', $config["timezone"], 'text-timezone_text', '', 25, 25, false, '', 'readonly', true);
$table->data[23][1] .= '<a id="change_timezone">'.html_print_image ('images/pencil.png', true, array ('title' => __('Change timezone'))).'</a>';
$table->data[23][1] .= "&nbsp;&nbsp;". html_print_select($zone_name, 'zone', 'None', 'show_timezone();', '', '', true);
$table->data[23][1] .= "&nbsp;&nbsp;". html_print_select($timezone_n, 'timezone', $config["timezone"], '', '', '', true);
$sounds = get_sounds();
$table->data[24][0] = __('Sound for Alert fired');
@ -233,14 +271,40 @@ function replaySound(type) {
}
}
function show_timezone () {
zone = $("#zone").val();
$.ajax({
type: "POST",
url: "ajax.php",
data: "page=<?php echo $_GET['sec2']; ?>&select_timezone=1&zone=" + zone,
dataType: "json",
success: function(data){
$("#timezone").empty();
jQuery.each (data, function (id, value) {
timezone = value;
$("select[name='timezone']").append($("<option>").val(timezone).html(timezone));
});
}
});
}
$(document).ready (function () {
$("#zone").attr("disabled", true);
$("#timezone").attr("disabled", true);
$("#radiobtn0011").click(function(){
flag = $("#radiobtn0011").is(':checked');
if (flag == true){
<?php echo "if (! confirm ('" . __('If Enterprise ACL System is enabled without rules you will lose access to Pandora FMS Console (even admin). Do you want to continue?') . "')) return false" ?>
}
});
$("#change_timezone").click(function () {
$("#zone").attr("disabled", false);
$("#timezone").attr("disabled", false);
});
});
</script>
<?php

View File

@ -21,7 +21,7 @@ if (function_exists ('mb_internal_encoding')) {
// Set to 1 to do not check for installer or config file (for development!).
// Activate gives more error information, not useful for production sites
$develop_bypass = 1;
$develop_bypass = 0;
if ($develop_bypass != 1) {
// If no config file, automatically try to install

View File

@ -1387,3 +1387,13 @@ CREATE TABLE IF NOT EXISTS `tevent_filter` (
PRIMARY KEY (`id_filter`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `ttimezone`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `ttimezone` (
`id_tz` int(10) unsigned NOT NULL auto_increment,
`zone` varchar(60) NOT NULL,
`timezone` varchar(60) NOT NULL,
PRIMARY KEY (`id_tz`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -432,4 +432,239 @@ INSERT INTO `trecon_script` VALUES
INSERT INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `execute`, `net_dst_opt`, `net_port_opt`, `user_opt`, `pass_opt`, `plugin_type`) VALUES (1,'IPMI&#x20;Plugin','Plugin&#x20;to&#x20;get&#x20;IPMI&#x20;monitors&#x20;from&#x20;a&#x20;IPMI&#x20;Device.',0,'/usr/share/pandora_server/util/plugin/ipmi-plugin.pl','-h','','-u','-p',0),(2,'DNS&#x20;Plugin','This&#x20;plugin&#x20;is&#x20;used&#x20;to&#x20;check&#x20;if&#x20;a&#x20;specific&#x20;domain&#x20;return&#x20;a&#x20;specific&#x20;IP&#x20;address,&#x20;and&#x20;to&#x20;check&#x20;how&#x20;time&#x20;&#40;milisecs&#41;&#x20;takes&#x20;the&#x20;DNS&#x20;to&#x20;answer.&#x20;Use&#x20;IP&#x20;address&#x20;parameter&#x20;to&#x20;specify&#x20;the&#x20;IP&#x20;of&#x20;your&#x20;domain.&#x20;Use&#x20;these&#x20;custom&#x20;parameters&#x20;for&#x20;the&#x20;other&#x20;parameters:&#x0d;&#x0a;&#x0d;&#x0a;-d&#x20;domain&#x20;to&#x20;check&#x20;&#40;for&#x20;example&#x20;pandorafms.com&#41;&#x0d;&#x0a;-s&#x20;DNS&#x20;Server&#x20;to&#x20;check&#x20;&#x20;&#40;for&#x20;example&#x20;8.8.8.8&#41;&#x0d;&#x0a;&#x0d;&#x0a;Optional&#x20;parameters:&#x0d;&#x0a;&#x0d;&#x0a;-t&#x20;Do&#x20;a&#x20;DNS&#x20;time&#x20;response&#x20;check&#x20;instead&#x20;DNS&#x20;resolve&#x20;test&#x0d;&#x0a;&#x0d;&#x0a;',15,'/usr/share/pandora_server/util/plugin/dns_plugin.sh','-i','','','',0),(3,'UDP&#x20;port&#x20;check','Check&#x20;a&#x20;remote&#x20;UDP&#x20;port&#x20;&#40;by&#x20;using&#x20;NMAP&#41;.&#x20;Use&#x20;IP&#x20;address&#x20;and&#x20;Port&#x20;options.',5,'/usr/share/pandora_server/util/plugin/udp_nmap_plugin.sh','-t','-p','','',0),(4,'SMTP&#x20;Check','This&#x20;plugin&#x20;is&#x20;used&#x20;to&#x20;send&#x20;a&#x20;mail&#x20;to&#x20;a&#x20;SMTP&#x20;server&#x20;and&#x20;check&#x20;if&#x20;works.&#x20;Parameters&#x20;in&#x20;the&#x20;plugin&#x20;&#x0d;&#x0a;IP&#x20;Addres&#x20;-&#x20;SMTP&#x20;Server&#x20;IP&#x20;address&#x0d;&#x0a;User&#x20;-&#x20;AUTH&#x20;login&#x20;&#x20;&#x0d;&#x0a;Pass&#x20;-&#x20;AUTH&#x20;password&#x0d;&#x0a;Port&#x20;-&#x20;SMTP&#x20;port&#x20;&#40;optional&#41;&#x0d;&#x0a;&#x0d;&#x0a;Optional&#x20;parameters&#x20;&#x0d;&#x0a;&#x0d;&#x0a;&#x20;-d&#x20;Destination&#x20;email&#x0d;&#x0a;&#x20;-f&#x20;Email&#x20;of&#x20;the&#x20;sender&#x0d;&#x0a;&#x20;-a&#x20;Autentication&#x20;system,&#x20;could&#x20;be&#x20;LOGIN,&#x20;PLAIN,&#x20;CRAM-MD5&#x20;or&#x20;DIGEST-MD&#x0d;&#x0a;&#x0d;&#x0a;&#x0d;&#x0a;',10,'/usr/share/pandora_server/util/plugin/SMTP_check.pl','-h','-o','-u','-p',0);
-- -----------------------------------------------------
-- Table `ttimezone`
-- -----------------------------------------------------
INSERT INTO `ttimezone` (`zone`, `timezone`) VALUES
('Africa','Africa/Abidjan'),
('Africa','Africa/Accra'),
('Africa','Africa/Addis_Ababa'),
('Africa','Africa/Algiers'),
('Africa','Africa/Asmara'),
('Africa','Africa/Asmera'),
('Africa','Africa/Bamako'),
('Africa','Africa/Bangui'),
('Africa','Africa/Banjul'),
('Africa','Africa/Bissau'),
('Africa','Africa/Blantyre'),
('Africa','Africa/Brazzaville'),
('Africa', 'Africa/Bujumbura'),
('Africa', 'Africa/Cairo'),
('Africa', 'Africa/Casablanca'),
('Africa', 'Africa/Ceuta'),
('Africa', 'Africa/Conakry'),
('Africa', 'Africa/Dakar'),
('Africa', 'Africa/Dar_es_Salaam'),
('Africa', 'Africa/Djibouti'),
('Africa', 'Africa/Douala'),
('Africa', 'Africa/El_Aaiun'),
('Africa', 'Africa/Freetown'),
('Africa', 'Africa/Gaborone'),
('Africa', 'Africa/Harare'),
('Africa', 'Africa/Johannesburg'),
('Africa', 'Africa/Juba'),
('Africa', 'Africa/Kampala'),
('Africa', 'Africa/Khartoum'),
('Africa', 'Africa/Kigali'),
('Africa', 'Africa/Kinshasa'),
('Africa', 'Africa/Lagos'),
('Africa', 'Africa/Libreville'),
('Africa', 'Africa/Lome'),
('Africa', 'Africa/Luanda'),
('Africa', 'Africa/Lubumbashi'),
('Africa', 'Africa/Lusaka'),
('Africa', 'Africa/Malabo'),
('Africa', 'Africa/Maputo'),
('Africa', 'Africa/Maseru'),
('Africa', 'Africa/Mbabane'),
('Africa', 'Africa/Mogadishu'),
('Africa', 'Africa/Monrovia'),
('Africa', 'Africa/Nairobi'),
('Africa', 'Africa/Ndjamena'),
('Africa', 'Africa/Niamey'),
('Africa', 'Africa/Nouakchott'),
('Africa', 'Africa/Ouagadougou'),
('Africa', 'Africa/Porto-Novo'),
('Africa', 'Africa/Sao_Tome'),
('Africa', 'Africa/Timbuktu'),
('Africa', 'Africa/Tripoli'),
('Africa', 'Africa/Tunis'),
('Africa', 'Africa/Windhoek'),
('America', 'America/Adak'),
('America', 'America/Anchorage'),
('America', 'America/Anguilla'),
('America', 'America/Antigua'),
('America', 'America/Araguaina'),
('America', 'America/Argentina/Buenos_Aires'),
('America', 'America/Argentina/Catamarca'),
('America', 'America/Argentina/ComodRivadavia'),
('America', 'America/Argentina/Cordoba'),
('America', 'America/Argentina/Jujuy'),
('America', 'America/Argentina/La_Rioja'),
('America', 'America/Argentina/Mendoza'),
('America', 'America/Argentina/Rio_Gallegos'),
('America', 'America/Argentina/Salta'),
('America', 'America/Argentina/San_Juan'),
('America', 'America/Argentina/San_Luis'),
('America', 'America/Argentina/Tucuman'),
('America', 'America/Argentina/Ushuaia'),
('America', 'America/Aruba'),
('America', 'America/Asuncion'),
('America', 'America/Atikokan'),
('America', 'America/Atka'),
('America', 'America/Bahia'),
('America', 'America/Bahia_Banderas'),
('America', 'America/Barbados'),
('America', 'America/Belem'),
('America', 'America/Belize'),
('America', 'America/Blanc-Sablon'),
('America', 'America/Boa_Vista'),
('America', 'America/Bogota'),
('America', 'America/Boise'),
('America', 'America/Buenos_Aires'),
('America', 'America/Cambridge_Bay'),
('America', 'America/Campo_Grande'),
('America', 'America/Cancun'),
('America', 'America/Caracas'),
('America', 'America/Catamarca'),
('America', 'America/Cayenne'),
('America', 'America/Cayman'),
('America', 'America/Chicago'),
('America', 'America/Chihuahua'),
('America', 'America/Coral_Harbour'),
('America', 'America/Cordoba'),
('America', 'America/Costa_Rica'),
('America', 'America/Cuiaba'),
('America', 'America/New_York'),
('America', 'America/Vancouver'),
('America', 'America/Toronto'),
('America', 'America/Phoenix'),
('America', 'America/Monterrey'),
('America', 'America/Panama'),
('America', 'America/Puerto_Rico'),
('Antarctica', 'Antarctica/Casey'),
('Antarctica', 'Antarctica/Davis'),
('Antarctica', 'Antarctica/DumontDUrville'),
('Antarctica', 'Antarctica/Macquarie'),
('Antarctica', 'Antarctica/Mawson'),
('Antarctica', 'Antarctica/McMurdo'),
('Antarctica', 'Antarctica/Palmer'),
('Antarctica', 'Antarctica/Rothera'),
('Antarctica', 'Antarctica/South_Pole'),
('Antarctica', 'Antarctica/Syowa'),
('Antarctica', 'Antarctica/Vostok'),
('Arctic', 'Arctic/Longyearbyen'),
('Asia', 'Asia/Aden'),
('Asia', 'Asia/Almaty'),
('Asia', 'Asia/Amman'),
('Asia', 'Asia/Anadyr'),
('Asia', 'Asia/Aqtau'),
('Asia', 'Asia/Aqtobe'),
('Asia', 'Asia/Ashgabat'),
('Asia', 'Asia/Ashkhabad'),
('Asia', 'Asia/Baghdad'),
('Asia', 'Asia/Bahrain'),
('Asia', 'Asia/Baku'),
('Asia', 'Asia/Bangkok'),
('Asia', 'Asia/Beirut'),
('Asia', 'Asia/Bishkek'),
('Asia', 'Asia/Brunei'),
('Asia', 'Asia/Calcutta'),
('Asia', 'Asia/Choibalsan'),
('Asia', 'Asia/Chongqing'),
('Asia', 'Asia/Chungking'),
('Asia', 'Asia/Colombo'),
('Asia', 'Asia/Dacca'),
('Asia', 'Asia/Damascus'),
('Asia', 'Asia/Dhaka'),
('Asia', 'Asia/Dili'),
('Asia', 'Asia/Dubai'),
('Asia', 'Asia/Dushanbe'),
('Asia', 'Asia/Gaza'),
('Atlantic', 'Atlantic/Azores'),
('Atlantic', 'Atlantic/Bermuda'),
('Atlantic', 'Atlantic/Canary'),
('Atlantic', 'Atlantic/Cape_Verde'),
('Atlantic', 'Atlantic/Faeroe'),
('Atlantic', 'Atlantic/Faroe'),
('Atlantic', 'Atlantic/Jan_Mayen'),
('Atlantic', 'Atlantic/Madeira'),
('Atlantic', 'Atlantic/Reykjavik'),
('Atlantic', 'Atlantic/South_Georgia'),
('Atlantic', 'Atlantic/St_Helena'),
('Atlantic', 'Atlantic/Stanley'),
('Australia', 'Australia/ACT'),
('Australia', 'Australia/Adelaide'),
('Australia', 'Australia/Brisbane'),
('Australia', 'Australia/Broken_Hill'),
('Australia', 'Australia/Canberra'),
('Australia', 'Australia/Currie'),
('Australia', 'Australia/Darwin'),
('Australia', 'Australia/Eucla'),
('Australia', 'Australia/Hobart'),
('Australia', 'Australia/LHI'),
('Australia', 'Australia/Lindeman'),
('Australia', 'Australia/Lord_Howe'),
('Australia', 'Australia/Melbourne'),
('Australia', 'Australia/North'),
('Australia', 'Australia/NSW'),
('Australia', 'Australia/Perth'),
('Australia', 'Australia/Queensland'),
('Australia', 'Australia/South'),
('Australia', 'Australia/Sydney'),
('Australia', 'Australia/Tasmania'),
('Australia', 'Australia/Victoria'),
('Australia', 'Australia/West'),
('Australia', 'Australia/Yancowinna'),
('Europe', 'Europe/Amsterdam'),
('Europe', 'Europe/Andorra'),
('Europe', 'Europe/Athens'),
('Europe', 'Europe/Belfast'),
('Europe', 'Europe/Belgrade'),
('Europe', 'Europe/Berlin'),
('Europe', 'Europe/Bratislava'),
('Europe', 'Europe/Brussels'),
('Europe', 'Europe/Bucharest'),
('Europe', 'Europe/Budapest'),
('Europe', 'Europe/Chisinau'),
('Europe', 'Europe/Copenhagen'),
('Europe', 'Europe/Dublin'),
('Europe', 'Europe/Gibraltar'),
('Europe', 'Europe/Guernsey'),
('Europe', 'Europe/Helsinki'),
('Europe', 'Europe/Isle_of_Man'),
('Europe', 'Europe/Istanbul'),
('Europe', 'Europe/Jersey'),
('Europe', 'Europe/Kaliningrad'),
('Europe', 'Europe/Kiev'),
('Europe', 'Europe/Lisbon'),
('Europe', 'Europe/Ljubljana'),
('Europe', 'Europe/London'),
('Europe', 'Europe/Luxembourg'),
('Europe', 'Europe/Madrid'),
('Europe', 'Europe/Malta'),
('Europe', 'Europe/Mariehamn'),
('Europe', 'Europe/Minsk'),
('Europe', 'Europe/Monaco'),
('Europe', 'Europe/Moscow'),
('Europe', 'Europe/Nicosia'),
('Europe', 'Europe/Oslo'),
('Europe', 'Europe/Paris'),
('Europe', 'Europe/Podgorica'),
('Europe', 'Europe/Prague'),
('Europe', 'Europe/Riga'),
('Europe', 'Europe/Rome'),
('Indian', 'Indian/Antananarivo'),
('Indian', 'Indian/Chagos'),
('Indian', 'Indian/Christmas'),
('Indian', 'Indian/Cocos'),
('Indian', 'Indian/Comoro'),
('Pacific', 'Pacific/Apia'),
('Pacific', 'Pacific/Auckland'),
('Pacific', 'Pacific/Chatham'),
('Pacific', 'Pacific/Chuuk'),
('Pacific', 'Pacific/Easter'),
('Pacific', 'Pacific/Efate');