bug fixing minor improvements
This commit is contained in:
@@ -108,7 +108,8 @@ class Map extends \Controller\AccessController {
|
||||
foreach((array)$rows as $rowData){
|
||||
$data = [
|
||||
'id' => $rowData->id,
|
||||
'label' => $rowData->label
|
||||
'label' => $rowData->label,
|
||||
'connectorDefinition' => $rowData->connectorDefinition
|
||||
];
|
||||
$connectionScopeData[$rowData->name] = $data;
|
||||
}
|
||||
@@ -319,16 +320,26 @@ class Map extends \Controller\AccessController {
|
||||
// cache time(s) per user should be equal or less than this function is called
|
||||
// prevent request flooding
|
||||
$responseTTL = $f3->get('PATHFINDER.TIMER.UPDATE_SERVER_MAP.DELAY') / 1000;
|
||||
$mapData = (array)$f3->get('POST.mapData');
|
||||
|
||||
$user = $this->_getUser();
|
||||
|
||||
$return = (object) [];
|
||||
$return->error = [];
|
||||
|
||||
if($user){
|
||||
$cacheKey = 'user_map_data_' . $user->id;
|
||||
// -> get active user object
|
||||
$activeCharacter = $user->getActiveUserCharacter();
|
||||
|
||||
$cacheKey = 'user_map_data_' . $activeCharacter->id;
|
||||
|
||||
// if there is any system/connection change data submitted -> clear cache
|
||||
if(!empty($mapData)){
|
||||
$f3->clear($cacheKey);
|
||||
}
|
||||
|
||||
if($f3->exists($cacheKey) === false ){
|
||||
|
||||
$mapData = (array)$f3->get('POST.mapData');
|
||||
// get current map data ========================================================
|
||||
$maps = $user->getMaps();
|
||||
|
||||
@@ -356,8 +367,7 @@ class Map extends \Controller\AccessController {
|
||||
){
|
||||
|
||||
// map changes expected =============================================
|
||||
// -> get active user object
|
||||
$activeCharacter = $user->getActiveUserCharacter();
|
||||
|
||||
|
||||
// loop current user maps and check for changes
|
||||
foreach($maps as $map){
|
||||
@@ -379,6 +389,7 @@ class Map extends \Controller\AccessController {
|
||||
// system belongs to the current map
|
||||
if(is_object($filteredMap->systems)){
|
||||
// update
|
||||
unset($systemData['updated']);
|
||||
$system = $filteredMap->systems->current();
|
||||
$system->setData($systemData);
|
||||
$system->updatedCharacterId = $activeCharacter->characterId;
|
||||
@@ -407,6 +418,7 @@ class Map extends \Controller\AccessController {
|
||||
// connection belongs to the current map
|
||||
if(is_object($filteredMap->connections)){
|
||||
// update
|
||||
unset($connectionData['updated']);
|
||||
$connection = $filteredMap->connections->current();
|
||||
$connection->setData($connectionData);
|
||||
$connection->save($user);
|
||||
|
||||
@@ -238,7 +238,7 @@ class Route extends \Controller\AccessController {
|
||||
|
||||
if(count($rows) > 0){
|
||||
// switch DB back to pathfinder DB
|
||||
$this->setDB();
|
||||
$this->setDB('PF');
|
||||
|
||||
// clear cache table
|
||||
$query = "TRUNCATE system_neighbour";
|
||||
|
||||
@@ -149,11 +149,12 @@ class System extends \Controller\AccessController {
|
||||
public function search($f3, $params){
|
||||
|
||||
// switch DB
|
||||
\DB\Database::instance();
|
||||
$this->setDB('CCP');
|
||||
|
||||
$searchToken = '';
|
||||
// check for search parameter
|
||||
if( array_key_exists( 'arg1', $params) ){
|
||||
if( isset($params['arg1']) ){
|
||||
$searchToken = $params['arg1'];
|
||||
}
|
||||
|
||||
|
||||
@@ -117,6 +117,15 @@ class User extends Controller\Controller{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* log the current user out + clear character system log data
|
||||
*/
|
||||
public function logOut(){
|
||||
$this->deleteLog();
|
||||
|
||||
return parent::logOut();
|
||||
}
|
||||
|
||||
/**
|
||||
* save/update "map sharing" configurations for all map types
|
||||
* the user has access to
|
||||
|
||||
Reference in New Issue
Block a user