fix: work on very basic PHP remediation

This commit is contained in:
Emmanuel BENOîT 2024-12-31 00:25:05 +01:00
parent b18b795ab3
commit 6ee9078e0c
Signed by: Emmanuel BENOîT
SSH key fingerprint: SHA256:l7PFUUF5TCDsvYeQC9OnTNz08dFY7Fvf4Hv3neIqYpg
117 changed files with 216 additions and 208 deletions

View file

@ -30,7 +30,7 @@ class actions_beta5 {
var $ePower = array();
function actions_beta5($game) {
public function __construct($game) {
$this->game = $game;
$this->lib = $game->getLib();
$this->alliance = $game->getLib('beta5/alliance');

View file

@ -53,7 +53,7 @@ class beta5_alliance_library {
);
function beta5_alliance_library($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_acceptRequest {
function beta5_alliance_acceptRequest($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
$this->msgs = $this->lib->game->getLib('beta5/msg');

View file

@ -2,7 +2,7 @@
class beta5_alliance_addCandidate {
function beta5_alliance_addCandidate($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_cancelRequest {
function beta5_alliance_cancelRequest($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_changeRank {
function beta5_alliance_changeRank($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->game = $this->lib->game;
$this->db = $this->game->db;

View file

@ -2,7 +2,7 @@
class beta5_alliance_create {
function beta5_alliance_create($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_createForum {
function beta5_alliance_createForum($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_createRank {
function beta5_alliance_createRank($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_deleteForum {
function beta5_alliance_deleteForum($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_deleteRank {
function beta5_alliance_deleteRank($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_get {
function beta5_alliance_get($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_getCandidates {
function beta5_alliance_getCandidates($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_getForums {
function beta5_alliance_getForums($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_getForumsComplete {
function beta5_alliance_getForumsComplete($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
$this->players = $this->lib->game->getLib('beta5/player');

View file

@ -2,7 +2,7 @@
class beta5_alliance_getId {
function beta5_alliance_getId($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_getKeepers {
function beta5_alliance_getKeepers($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_getMembers {
function beta5_alliance_getMembers($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_getMilitary {
function beta5_alliance_getMilitary($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_getPlanets {
function beta5_alliance_getPlanets($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
$this->planets = $this->lib->game->getLib('beta5/planet');

View file

@ -2,7 +2,7 @@
class beta5_alliance_getPrivileges {
function beta5_alliance_getPrivileges($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
$this->players = $this->lib->game->getLib('beta5/player');

View file

@ -2,7 +2,7 @@
class beta5_alliance_getRankPrivileges {
function beta5_alliance_getRankPrivileges($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_getRankSize {
function beta5_alliance_getRankSize($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_alliance_getRanks {
function beta5_alliance_getRanks($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -23,7 +23,7 @@ class beta5_fleet_library {
);
function beta5_fleet_library($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -3,7 +3,7 @@
class beta5_fleet_getPower {
var $ePower = array();
function beta5_fleet_getPower($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
$this->rules = $this->lib->game->getLib('beta5/rules');

View file

@ -17,7 +17,7 @@ class beta5_library {
'updateRankings'
);
function beta5_library($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_getPlayerCount {
function beta5_getPlayerCount($lib) {
function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_getPlayerStatus {
function beta5_getPlayerStatus($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -2,7 +2,7 @@
class beta5_register {
function beta5_register($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -22,7 +22,7 @@ class beta5_planet_library {
);
function beta5_planet_library($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->game = $this->lib->game;
$this->db = $this->game->db;

View file

@ -3,7 +3,7 @@
class beta5_planet_updateHappiness {
var $avgFPower = null;
function beta5_planet_updateHappiness($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
$this->players = $this->lib->game->getLib('beta5/player');

View file

@ -3,7 +3,7 @@
class beta5_planet_updateMaxPopulation {
var $maxPops = array();
function beta5_planet_updateMaxPopulation($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
$this->rules = $this->lib->game->getLib('beta5/rules');

View file

@ -2,7 +2,7 @@
class beta5_player_assign {
function beta5_player_assign($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->game = $this->lib->game;
$this->db = $this->game->db;

View file

@ -3,7 +3,7 @@
class beta5_player_getPlanetCount {
var $pPlanets = array();
function beta5_player_getPlanetCount($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -3,7 +3,7 @@
class beta5_player_getPower {
var $pFleets = array();
function beta5_player_getPower($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
$this->fleets = $this->lib->game->getLib('beta5/fleet');

View file

@ -7,7 +7,7 @@ class beta5_rules_library {
);
function beta5_rules_library($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
$this->planets = $this->lib->game->getLib('beta5/planet');

View file

@ -1,7 +1,8 @@
<?php
class beta5_rules_get {
function beta5_rules_get($lib) {
function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

@ -24,6 +24,7 @@ class beta5_ticks_universe_library {
// Run a special version of the tick if we are using a CTF map
$map = (int) $this->game->params['usemap'];
if ($map > 0) {
l::debug("handling CTF map");
$this->handleCTFMap($map);
return;
}
@ -40,6 +41,7 @@ class beta5_ticks_universe_library {
if ($this->maxSystems) {
$ns = $this->getAllSystems();
if ($ns >= $this->maxSystems) {
l::debug("max system count reached");
return;
}
}
@ -47,7 +49,8 @@ class beta5_ticks_universe_library {
// Get the amount of free systems
$this->reassignEmpty();
$ns = $this->getFreeSystems();
if ($ns >= $this->minSystems) {
if (!is_null($this->minSystems) && $ns >= $this->minSystems) {
l::debug("$ns systems are available, exiting");
return;
}