Update google api key setting

This commit is contained in:
Thilina Hasantha
2019-07-26 04:04:32 +02:00
parent fd99ea299e
commit 6e77aa99c4
3 changed files with 24 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
<?php <?php
$migrationList = []; $migrationList = [];
$migrationList[] = 'v20190707_260006_google_map_api';
$migrationList[] = 'v20190707_260005_attendance_location'; $migrationList[] = 'v20190707_260005_attendance_location';
$migrationList[] = 'v20190707_260004_attendance_out_map'; $migrationList[] = 'v20190707_260004_attendance_out_map';
$migrationList[] = 'v20190630_260603_add_dept_leave_to_rule'; $migrationList[] = 'v20190630_260603_add_dept_leave_to_rule';

View File

@@ -0,0 +1,20 @@
<?php
namespace Classes\Migration;
class v20190707_260006_google_map_api extends AbstractMigration {
public function up(){
$sql = <<<'SQL'
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Google Maps Api Key', '', 'Google Map Api Key','');
SQL;
return $this->executeQuery($sql);
}
public function down(){
return true;
}
}

View File

@@ -90,9 +90,9 @@ class AttendanceRestEndPoint extends RestEndPoint
} }
if ($user->user_level !== 'Admin' && !PermissionManager::manipulationAllowed( if ($user->user_level !== 'Admin' && !PermissionManager::manipulationAllowed(
BaseService::getInstance()->getCurrentProfileId(), BaseService::getInstance()->getCurrentProfileId(),
$this->getModelObject($parameter) $this->getModelObject($parameter)
) )
) { ) {
return new IceResponse(IceResponse::ERROR, self::RESPONSE_ERR_PERMISSION_DENIED, 403); return new IceResponse(IceResponse::ERROR, self::RESPONSE_ERR_PERMISSION_DENIED, 403);
} }
@@ -392,13 +392,9 @@ class AttendanceRestEndPoint extends RestEndPoint
&markers=color:red%7Clabel:C%7C$location &markers=color:red%7Clabel:C%7C$location
&key=".SettingsManager::getInstance()->getSetting('System: Google Maps Api Key'); &key=".SettingsManager::getInstance()->getSetting('System: Google Maps Api Key');
LogManager::getInstance()->info('Url:'.$url);
$data = file_get_contents($url); $data = file_get_contents($url);
//LogManager::getInstance()->info('Data:'.$data);
if (!empty($data)) { if (!empty($data)) {
//LogManager::getInstance()->info('Data Base64:'.base64_encode($data));
return'data:image/png;base64,' . base64_encode($data); return'data:image/png;base64,' . base64_encode($data);
} }