From 775ba0a3d826e6970834844f9ad48a9f1775a9b7 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 8 Mar 2019 13:01:34 +0100 Subject: [PATCH] Minor - format code --- main/social/map.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/main/social/map.php b/main/social/map.php index ac361bc43c..74616f9462 100644 --- a/main/social/map.php +++ b/main/social/map.php @@ -32,6 +32,19 @@ if (empty($infoStage) || empty($infoVille)) { api_not_allowed(true); } +$gMapsPlugin = GoogleMapsPlugin::create(); +$localization = $gMapsPlugin->get('enable_api') === 'true'; + +if ($localization) { + $apiKey = $gMapsPlugin->get('api_key'); + if (empty($apiKey)) { + api_not_allowed(true); + } +} else { + api_not_allowed(true); +} + + $tableUser = Database::get_main_table(TABLE_MAIN_USER); $sql = "SELECT u.id, firstname, lastname, ev.value ville, ev2.value stage FROM $tableUser u @@ -98,18 +111,6 @@ foreach ($data as &$result) { } } -$gMapsPlugin = GoogleMapsPlugin::create(); -$localization = $gMapsPlugin->get('enable_api') === 'true'; - -if ($localization) { - $apiKey = $gMapsPlugin->get('api_key'); - if (empty($apiKey)) { - api_not_allowed(true); - } -} else { - api_not_allowed(true); -} - $htmlHeadXtra[] = ''; $htmlHeadXtra[] = '';