diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index 141add720..f1eb09681 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -269,6 +269,11 @@ $config['nfsen_enable'] = 0; #$config['nfsen_rrds'] = "/var/nfsen/profiles-stat/live/"; #$config['nfsen_suffix'] = "_yourdomain_com"; +### Location Mapping +### Use this feature to map ugly locations to pretty locations +#config['location_map']['Under the Sink'] = "Under The Sink, The Office, London, UK"; + + ### Ignores & Allows # Has to be lowercase diff --git a/includes/polling/system.inc.php b/includes/polling/system.inc.php index 27a9f685b..23b1dc26d 100755 --- a/includes/polling/system.inc.php +++ b/includes/polling/system.inc.php @@ -82,6 +82,13 @@ } $poll_device['sysLocation'] = str_replace("\"","", $poll_device['sysLocation']); + + /// Rewrite sysLocation if there is a mapping array (database too?) + if(!empty($poll_device['sysLocation']) && is_array($config['location_map'])) + { + $poll_device['sysLocation'] = rewrite_location($poll_device['sysLocation']); + } + $poll_device['sysContact'] = str_replace("\"","", $poll_device['sysContact']); if ($poll_device['sysLocation'] == "not set") diff --git a/includes/rewrites.php b/includes/rewrites.php index ac9014b6a..38e6b7ffb 100644 --- a/includes/rewrites.php +++ b/includes/rewrites.php @@ -1,5 +1,21 @@