Skip to content

Commit

Permalink
Merge pull request #8 from goryn-clade/dev2.1.1
Browse files Browse the repository at this point in the history
Dev2.1.1
  • Loading branch information
samoneilll authored Aug 6, 2021
2 parents 5007c8b + 22855d4 commit 58ad0c9
Show file tree
Hide file tree
Showing 221 changed files with 111 additions and 45 deletions.
90 changes: 73 additions & 17 deletions app/Model/Pathfinder/CharacterModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,13 @@ public function isAuthorized() : string {
){
// no corp/ally restrictions set -> any character is allowed to login
$authStatus = 'OK';
}elseif(
// check if session_sharing is enabled and if a character is saved in session
Config::getPathfinderData('login.session_sharing') === 1 &&
is_array($this->getF3()->get(User::SESSION_KEY_CHARACTERS))
){
// authorized character is already logged in -> any subsequent character is allowed to login
$authStatus = 'OK';
}else{
// check if character is set in whitelist
if(
Expand Down Expand Up @@ -1292,32 +1299,81 @@ public function getMap(int $mapId) : ?MapModel {
* @return MapModel[]
*/
public function getMaps() : array {
$maps = [];
if(Config::getPathfinderData('login.session_sharing') === 1){
$maps = $this->getSessionCharacterMaps();
}else{
$maps = [];

if($alliance = $this->getAlliance()){
$maps = array_merge($maps, $alliance->getMaps());
}
if($alliance = $this->getAlliance()){
$maps = array_merge($maps, $alliance->getMaps());
}

if($corporation = $this->getCorporation()){
$maps = array_merge($maps, $corporation->getMaps());
}
if($corporation = $this->getCorporation()){
$maps = array_merge($maps, $corporation->getMaps());
}

if(is_object($this->characterMaps)){
$mapCountPrivate = 0;
foreach($this->characterMaps as $characterMap){
if(
$mapCountPrivate < Config::getMapsDefaultConfig('private')['max_count'] &&
$characterMap->mapId->isActive()
){
$maps[] = $characterMap->mapId;
$mapCountPrivate++;
if(is_object($this->characterMaps)){
$mapCountPrivate = 0;
foreach($this->characterMaps as $characterMap){
if(
$mapCountPrivate < Config::getMapsDefaultConfig('private')['max_count'] &&
$characterMap->mapId->isActive()
){
$maps[] = $characterMap->mapId;
$mapCountPrivate++;
}
}
}
}

return $maps;
}

/**
* get all accessible map models for all characters in session
* using mapIds and characters index arrays to track what has already been processed
* @return MapModel[]
*/
public function getSessionCharacterMaps() : array {
$maps = ["maps" => [], "mapIds" => []];

// get all characters in session and iterate over them
foreach($this->getAll(array_column($this->getF3()->get(User::SESSION_KEY_CHARACTERS), 'ID')) as $character){
if($alliance = $character->getAlliance()){
foreach($alliance->getMaps() as $map){
if(!in_array($map->_id, $maps["mapIds"])){
array_push($maps["maps"], $map);
array_push($maps["mapIds"], $map->id);
}
}
}

if($corporation = $character->getCorporation()){
foreach($corporation->getMaps() as $map){
if(!in_array($map->_id, $maps["mapIds"])){
array_push($maps["maps"], $map);
array_push($maps["mapIds"], $map->id);
}
}
}

if(is_object($character->characterMaps)){
$mapCountPrivate = 0;
foreach($character->characterMaps as $characterMap){
if(
$mapCountPrivate < Config::getMapsDefaultConfig('private')['max_count'] &&
$characterMap->mapId->isActive()
){
array_push($maps["maps"], $characterMap->mapId);
$mapCountPrivate++;
}
}
}
}

return $maps["maps"];
}

/**
* delete current location
*/
Expand Down Expand Up @@ -1424,4 +1480,4 @@ public static function getAll($characterIds = []){

return (new self())->find($query);
}
}
}
2 changes: 1 addition & 1 deletion app/Model/Pathfinder/MapModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ protected function validate_WebHookURL(string $key, string $val, string $type) :
if( !empty($val) ){
$hosts = [
'slack' => ['hooks.slack.com'],
'discord' => ['discordapp.com', 'ptb.discordapp.com']
'discord' => ['discord.com', 'discordapp.com', 'ptb.discordapp.com']
];

if(
Expand Down
11 changes: 9 additions & 2 deletions app/pathfinder.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ NAME = Pathfinder
; Version is used for CSS/JS cache busting and is part of the URL for static resources:
; e.g. public/js/vX.X.X/app.js
; Syntax: String (current version)
; Default: v2.1.0
VERSION = v2.1.0
; Default: v2.1.1
VERSION = v2.1.1

; Contact information [optional]
; Shown on 'licence', 'contact' page.
Expand Down Expand Up @@ -70,6 +70,13 @@ COOKIE_EXPIRE = 30
; Default: 0
MODE_MAINTENANCE = 0

; Share maps between logged in characters in the same session
; If enabled this will grant the active character access to any maps
; that other characters from the "switch character" menu have access to
; Syntax 0 | 1
; Default 0
SESSION_SHARING = 1

; Login restrictions (white lists)
; Login/registration can be restricted to specific groups.
; Use comma separated strings for CCP Ids (e.g. 1000166,1000080).
Expand Down
8 changes: 4 additions & 4 deletions export/sql/pochven_and_trailblazer.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ INSERT INTO `race` (`id`, `created`, `updated`, `name`, `description`, `factionI

-- Add new corporation definitions
INSERT INTO `corporation` (`id`, `created`, `updated`, `name`, `ticker`, `dateFounded`, `memberCount`, `isNPC`, `factionId`, `allianceId`) VALUES
(1000292, 2020-10-29 20:44:32', '2020-10-29 20:44:32', 'Veles Clade', 'CLVEL', NULL, 1, 1, NULL, NULL),
(1000293, 2020-10-29 20:44:32', '2020-10-29 20:44:32', 'Perun Clade', 'CLPER', NULL, 1, 1, NULL, NULL),
(1000294, 2020-10-29 20:44:32', '2020-10-29 20:44:32', 'Svarog Clade', 'CLSVA', NULL, 1, 1, NULL, NULL),
(1000298, 2020-10-29 20:44:32', '2020-10-29 20:44:32', 'The Convocation of Triglav', 'CTPSV', NULL, 1, 1, NULL, NULL);
(1000292, '2020-10-29 20:44:32', '2020-10-29 20:44:32', 'Veles Clade', 'CLVEL', NULL, 1, 1, NULL, NULL),
(1000293, '2020-10-29 20:44:32', '2020-10-29 20:44:32', 'Perun Clade', 'CLPER', NULL, 1, 1, NULL, NULL),
(1000294, '2020-10-29 20:44:32', '2020-10-29 20:44:32', 'Svarog Clade', 'CLSVA', NULL, 1, 1, NULL, NULL),
(1000298, '2020-10-29 20:44:32', '2020-10-29 20:44:32', 'The Convocation of Triglav', 'CTPSV', NULL, 1, 1, NULL, NULL);

-- Add the new faction defintions
INSERT INTO `faction` (`id`, `created`, `updated`, `name`, `description`, `sizeFactor`, `stationCount`, `stationSystemCount`) VALUES
Expand Down
9 changes: 6 additions & 3 deletions js/app/conf/signature_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@
6: 'U574 - C6',
7: 'S047 - H',
8: 'N290 - L',
9: 'K329 - 0.0'
9: 'K329 - 0.0',
10: 'F216 - T Pochven'
};

let c5WH = {
Expand All @@ -422,7 +423,8 @@
6: 'V753 - C6',
7: 'D792 - H',
8: 'C140 - L',
9: 'Z142 - 0.0'
9: 'Z142 - 0.0',
10: 'F216 - T Pochven'
};

let c6WH = {
Expand All @@ -437,7 +439,8 @@
9: 'C140 - L',
10: 'C391 - L',
11: 'C248 - 0.0',
12: 'Z142 - 0.0'
12: 'Z142 - 0.0',
13: 'F216 - T Pochven'
};

// Shattered WH (some of them are static)
Expand Down
2 changes: 1 addition & 1 deletion js/app/ui/module/system_intel.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ define([
*/
render(mapId, systemData){
this._systemData = systemData;
let showStationTable = ['H', 'L', '0.0', 'C12'].includes(Util.getObjVal(this._systemData, 'security'));
let showStationTable = ['H', 'L', '0.0', 'T', 'C12'].includes(Util.getObjVal(this._systemData, 'security'));

this._bodyEl = Object.assign(document.createElement('div'), {
className: this._config.bodyClassName
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pathfinder-eve",
"version": "2.1.0",
"version": "2.1.1",
"engines": {
"node": "12.x"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 0 additions & 2 deletions public/js/v2.1.0/app/admin.js

This file was deleted.

Binary file removed public/js/v2.1.0/app/admin.js.br
Binary file not shown.
1 change: 0 additions & 1 deletion public/js/v2.1.0/app/admin.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions public/js/v2.1.0/app/login.js

This file was deleted.

Binary file removed public/js/v2.1.0/app/login.js.br
Binary file not shown.
1 change: 0 additions & 1 deletion public/js/v2.1.0/app/login.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions public/js/v2.1.0/app/mappage.js

This file was deleted.

Binary file removed public/js/v2.1.0/app/mappage.js.br
Binary file not shown.
1 change: 0 additions & 1 deletion public/js/v2.1.0/app/mappage.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions public/js/v2.1.0/app/setup.js

This file was deleted.

Binary file removed public/js/v2.1.0/app/setup.js.br
Binary file not shown.
1 change: 0 additions & 1 deletion public/js/v2.1.0/app/setup.js.map

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions public/js/v2.1.1/app/admin.js

Large diffs are not rendered by default.

Binary file added public/js/v2.1.1/app/admin.js.br
Binary file not shown.
1 change: 1 addition & 0 deletions public/js/v2.1.1/app/admin.js.map

Large diffs are not rendered by default.

File renamed without changes.
2 changes: 2 additions & 0 deletions public/js/v2.1.1/app/login.js

Large diffs are not rendered by default.

Binary file added public/js/v2.1.1/app/login.js.br
Binary file not shown.
1 change: 1 addition & 0 deletions public/js/v2.1.1/app/login.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions public/js/v2.1.1/app/mappage.js

Large diffs are not rendered by default.

Binary file added public/js/v2.1.1/app/mappage.js.br
Binary file not shown.
1 change: 1 addition & 0 deletions public/js/v2.1.1/app/mappage.js.map

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions public/js/v2.1.1/app/setup.js

Large diffs are not rendered by default.

Binary file added public/js/v2.1.1/app/setup.js.br
Binary file not shown.
1 change: 1 addition & 0 deletions public/js/v2.1.1/app/setup.js.map

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions public/templates/dialog/map.html
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ <h4 class="pf-dynamic-area {{^discordSectionShow}}collapsed{{/discordSectionShow
</label>
<div class="col-sm-9 col-md-8">
<div class="input-group" {{^discordRallyEnabled}}title="Globally disabled for this map type"{{/discordRallyEnabled}}>
<input name="discordWebHookURLRally" type="url" class="form-control" id="{{discordWebHookURLRallyId}}" value="{{discordWebHookURLRally}}" placeholder="https://discordapp.com/api/webhooks/XXXYYYZZZ" data-type-error="No valid URL" pattern="^https://(\w+\.)?discordapp.com/.*" data-pattern-error="Wrong domain. https://discordapp.com/)" {{^discordRallyEnabled}}disabled{{/discordRallyEnabled}}>
<input name="discordWebHookURLRally" type="url" class="form-control" id="{{discordWebHookURLRallyId}}" value="{{discordWebHookURLRally}}" placeholder="https://discord.com/api/webhooks/YYYY/ZZZZ" data-type-error="No valid URL" pattern="^https:\/\/(\w+\.)?discord(app)?.com\/api\/webhooks\/.+\/.+" data-pattern-error="Wrong URL. https://discord.com/api/webhooks/YYYY/ZZZZ" {{^discordRallyEnabled}}disabled{{/discordRallyEnabled}}>
<div class="input-group-btn">
<a class="btn btn-default" href="//support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks" target="_blank" rel="noopener">
<a class="btn btn-default" href="//support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks" target="_blank" rel="noopener">
add… <i class="fas fa-fw fa-external-link-alt"></i>
</a>
</div>
Expand Down Expand Up @@ -286,9 +286,9 @@ <h4 class="pf-dynamic-area {{^discordSectionShow}}collapsed{{/discordSectionShow
</label>
<div class="col-sm-9 col-md-8">
<div class="input-group" {{^discordHistoryEnabled}}title="Globally disabled for this map type"{{/discordHistoryEnabled}}>
<input name="discordWebHookURLHistory" type="url" class="form-control" id="{{discordWebHookURLHistoryId}}" value="{{discordWebHookURLHistory}}" placeholder="https://discordapp.com/api/webhooks/XXXYYYZZZ" data-type-error="No valid URL" pattern="^https://discordapp.com/.*" data-pattern-error="Wrong domain. https://discordapp.com/)" {{^discordHistoryEnabled}}disabled{{/discordHistoryEnabled}}>
<input name="discordWebHookURLHistory" type="url" class="form-control" id="{{discordWebHookURLHistoryId}}" value="{{discordWebHookURLHistory}}" placeholder="https://discord.com/api/webhooks/YYYY/ZZZZ" data-type-error="No valid URL" pattern="^https:\/\/(\w+\.)?discord(app)?.com\/api\/webhooks\/.+\/.+" data-pattern-error="Wrong URL. https://discord.com/api/webhooks/YYYY/ZZZZ" {{^discordHistoryEnabled}}disabled{{/discordHistoryEnabled}}>
<div class="input-group-btn">
<a class="btn btn-default" href="//support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks" target="_blank" rel="noopener">
<a class="btn btn-default" href="//support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks" target="_blank" rel="noopener">
add… <i class="fas fa-fw fa-external-link-alt"></i>
</a>
</div>
Expand Down

0 comments on commit 58ad0c9

Please sign in to comment.