Update google api key setting
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$migrationList = [];
|
||||
$migrationList[] = 'v20190707_260006_google_map_api';
|
||||
$migrationList[] = 'v20190707_260005_attendance_location';
|
||||
$migrationList[] = 'v20190707_260004_attendance_out_map';
|
||||
$migrationList[] = 'v20190630_260603_add_dept_leave_to_rule';
|
||||
|
||||
20
core/migrations/v20190707_260006_google_map_api.php
Normal file
20
core/migrations/v20190707_260006_google_map_api.php
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -90,9 +90,9 @@ class AttendanceRestEndPoint extends RestEndPoint
|
||||
}
|
||||
|
||||
if ($user->user_level !== 'Admin' && !PermissionManager::manipulationAllowed(
|
||||
BaseService::getInstance()->getCurrentProfileId(),
|
||||
$this->getModelObject($parameter)
|
||||
)
|
||||
BaseService::getInstance()->getCurrentProfileId(),
|
||||
$this->getModelObject($parameter)
|
||||
)
|
||||
) {
|
||||
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
|
||||
&key=".SettingsManager::getInstance()->getSetting('System: Google Maps Api Key');
|
||||
|
||||
LogManager::getInstance()->info('Url:'.$url);
|
||||
|
||||
$data = file_get_contents($url);
|
||||
|
||||
//LogManager::getInstance()->info('Data:'.$data);
|
||||
if (!empty($data)) {
|
||||
//LogManager::getInstance()->info('Data Base64:'.base64_encode($data));
|
||||
return'data:image/png;base64,' . base64_encode($data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user