initial commit; version 22.5.12042

This commit is contained in:
2022-12-12 23:28:25 -05:00
commit af1b03d79f
17653 changed files with 22692970 additions and 0 deletions

36
update/415.php Normal file
View File

@ -0,0 +1,36 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage update
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$sql = "SELECT * FROM `devices_locations` WHERE 1";
$sql .= generate_query_values(['Unknown', ''], 'location_country', '!=');
$devices_locations = dbFetchRows($sql);
if (count($devices_locations))
{
echo 'Unificate GEO Country names: ';
foreach ($devices_locations as $entry)
{
$country = country_from_code($entry['location_country']);
if ($country != $entry['location_country'])
{
$update_array = ['location_country' => $country,
'location_updated' => $entry['location_updated']]; // Keep updated timestamp
dbUpdate($update_array, 'devices_locations', '`location_id` = ?', [$entry['location_id']]);
echo('.');
}
}
}
// EOF