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

@ -6,7 +6,6 @@ function __logAdmin($txt, $level = null) {
if (!$logInit) {
global $__logPrefix;
define_syslog_variables();
openlog("lwControl", LOG_PID, LOG_USER);
$logInit = true;
}

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
include("config.inc");
include("as_log.inc");
@ -213,27 +211,27 @@ foreach ($games as $name => $game) {
<p>Games can have the following status:</p>
<table>
<tr>
<?printStatus('PRE');?>
<?php printStatus('PRE');?>
<td>The game is configured, but is hidden for now</td>
</tr>
<tr>
<?printStatus('READY');?>
<?php printStatus('READY');?>
<td>The game is visible, but ticks have not started</td>
</tr>
<tr>
<?printStatus('RUNNING');?>
<?php printStatus('RUNNING');?>
<td>The game is running normally</td>
</tr>
<tr>
<?printStatus('VICTORY');?>
<?php printStatus('VICTORY');?>
<td>The game is still running but someone reached victory</td>
</tr>
<tr>
<?printStatus('ENDING');?>
<?php printStatus('ENDING');?>
<td>The game is still available but is about to end.</td>
</tr>
<tr>
<?printStatus('FINISHED');?>
<?php printStatus('FINISHED');?>
<td>The game is no longer running and only visible through the rankings page</td>
</tr>
</table>

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
include('config.inc');
include('../scripts/config.inc');
include('as_manager.inc');
@ -137,25 +135,25 @@ if (!class_exists('config')) {
<body>
<h1><a href="index.html">LWB5 > Administration</a> > Ticks</h1>
<h2>Manager status</h2>
<p>Tick manager status: <?
<p>Tick manager status: <?php
if ($mRunning === false) {
?>
<b>not running</b> - <a href="?c=sm">Start manager</a>
<?
<?php
} else {
?> <b>running</b>, process ID #<?=$mRunning?> - <a href="?c=km">Kill manager</a><br/>
<?
<?php
if ($tActive === 'pending') {
?> Ticks status change pending; please <a href="?">reload</a> the page.<br/>
This can take up to 20 seconds, be patient.
<?
<?php
} elseif ($tActive) {
?> Ticks are <b>active</b> - <a href="?c=dt">Disable ticks</a>
<?
<?php
} else {
?> Ticks are <b>inactive</b> - <a href="?c=et">Enable ticks</a>
<?
<?php
}
}
@ -203,7 +201,7 @@ if ($statusMessage != '') {
for game
<select name="g">
<option value="">-- select --</option>
<?
<?php
$games = config::getGames();
foreach (array_keys($games) as $game) {
if ($game == 'main') {

View file

@ -3,7 +3,7 @@
class admin_beta5_library {
var $index = array();
function admin_beta5_library($lib) {
function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
$this->msgs = $this->lib->game->getLib('beta5/msg');

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;
}

View file

@ -15,7 +15,7 @@ class main_account_library {
'terminate'
);
function main_account_library($lib) {
function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -11,7 +11,7 @@ class actions_main {
);
function actions_main($game) {
function __construct($game) {
$this->game = $game;
$this->main = $this->game->getLib('main');
$this->accounts = $this->game->getLib('main/account');

View file

@ -49,7 +49,7 @@
*/
class main_joinGame {
function main_joinGame($main) {
public function __construct($main) {
$this->main = $main;
$this->lib = $this->main->getLib();
}

View file

@ -10,7 +10,7 @@
*/
class main_lostPassword {
function main_lostPassword($main) {
public function __construct($main) {
$this->main = $main;
$this->db = $this->main->db;
$this->lib = $this->main->getLib();

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -8,7 +8,7 @@ class main_rankings_library {
'update'
);
function main_rankings_library($lib) {
function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}

View file

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

View file

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

View file

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

View file

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

View file

@ -9,7 +9,7 @@
class main_ticks_day_library {
function main_ticks_day_library($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
$this->main = $this->lib->game->getLib();

View file

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

View file

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

View file

@ -2,7 +2,7 @@
class main_vacation_leave {
function main_vacation_leave($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
$this->accounts =& $this->lib->game->getLib('main/account');

View file

@ -2,7 +2,7 @@
class main_vacation_start {
function main_vacation_start($lib) {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
$this->accounts = $this->lib->game->getLib('main/account');

View file

@ -49,7 +49,7 @@ abstract class game_action {
/** The __get() overload method is useful to access the
* libraries associated with this game action.
*/
protected function __get($var) {
public function __get($var) {
if (array_key_exists($var, $this->__libraries)) {
return $this->__libraries[$var];
}

View file

@ -8,7 +8,7 @@ class ajax {
static $fTheme = array();
static $init = "";
function getTheme() {
private static function getTheme() {
$f = getLayoutDirectory(input::$game->version->id) . "/ajax.inc";
if (!file_exists($f)) {
return array();

View file

@ -38,7 +38,7 @@ class db_deadlock_exception extends Exception {
class db {
static $database = null;
static $accessors = array();
private $accessors = array();
private $isOpen = false;
private $cString = '';
@ -137,7 +137,7 @@ class db {
$this->end();
@pg_close($this->conn);
$this->isOpen = false;
self::$accessors = array();
$this->accessors = array();
if ($this->queries >= 20) {
l::debug("SQL: connection closed after {$this->queries} queries");

View file

@ -128,7 +128,7 @@ class game {
$lib = $this->version->id;
}
if (is_null($this->libraries[$lib])) {
if (!isset($this->libraries[$lib])) {
$this->libraries[$lib] = new library($lib, $this);
}
$this->getDBAccess();
@ -230,7 +230,7 @@ class game {
$this->initExternal();
}
function sessName() {
public static function sessName() {
if (class_exists('input')) {
return input::$game->name . "_data";
}

View file

@ -6,12 +6,12 @@ class library {
var $mainClass = null;
var $functions = array();
function library($name, $game) {
function __construct($name, $game) {
$this->name = $name;
$this->game = $game;
}
function loadClass($name = null) {
private function loadClass($name = null) {
// Get the path to the class to be loaded
$path = config::$main['scriptdir'] . "/game/{$this->name}/library";
if (!is_null($name)) {
@ -28,7 +28,7 @@ class library {
return $cn;
}
function call() {
public function call() {
$n = func_num_args();
if ($n == 0) {
l::fatal(22, "Empty library call for library '{$this->name}' on game '{$this->game->game['site_path']}'");

View file

@ -36,7 +36,7 @@ class prefs {
private static function getDefaults() {
prefs::$prefs = array();
$qr = dbQuery("SELECT id,version,value FROM user_preferences WHERE account=0");
if (!$qr || !count($qr)) {
if (!$qr || !pg_num_rows($qr)) {
return;
}
prefs::fromBase($qr);
@ -46,7 +46,7 @@ class prefs {
/** This function reads the current user's preferences from the base. */
private static function loadUser() {
$qr = dbQuery("SELECT id,version,value FROM user_preferences WHERE account={$_SESSION['userid']}");
if (!$qr || !count($qr)) {
if (!$qr || !pg_num_rows($qr)) {
return;
}
prefs::fromBase($qr, true);

View file

@ -144,7 +144,15 @@ class tracking {
}
if (tracking::readData()) {
setcookie(tracking::$cName, $trackId, time() + 31536000, dirname($_SERVER['SCRIPT_NAME']));
setcookie(
tracking::$cName,
$trackId,
[
'expires' => time() + 31536000,
'path' => dirname($_SERVER['SCRIPT_NAME']),
'samesite' => 'strict',
]
);
} else {
$trackDBId = tracking::$dbId;
l::fatal(5, "Tracking data: ID='$trackId',DB ID=$trackDBId" . ($trackNew ? ",new" : ""));

View file

@ -1,10 +1,10 @@
<title>Legacy Worlds<?= is_null($this->title) ? "" : " - {$this->title}" ?></title>
<? if (! is_null($this->cssRes) ) : ?>
<?php if (! is_null($this->cssRes) ) : ?>
<link rel='stylesheet' type='text/css' href='<?= makeLink('css', 'main', 'css') ?>?id=<?= $this->cssRes ?>' />
<? endif; ?>
<? if (! is_null($this->jsRes) ) : ?>
<?php endif; ?>
<?php if (! is_null($this->jsRes) ) : ?>
<script type='text/javascript' charset='utf-8' src='<?= makeLink('js', 'main', 'js') ?>?id=<?= $this->jsRes ?>'></script>
<? endif; ?>
<?php endif; ?>
<meta name=description content="Massively multiplayer strategy game based on planet conquest, research, spying, diplomacy, war, alliances. Features both permanent and 'speed' games." />
<meta name=keywords content="massively multiplayer, free, strategy game, wargame, multiplayer games, multiplayer game, strategy games, planet conquest, planets, colonisation, colonization, galaxy, galactic, universe, persistent, permanent, warships, fleets, fighter, massively multiplayer game, cruiser, battle cruiser, star, starship, ground armies, strategy game, planet, nebula, nebulae, players, alliances, online multiplayer game, diplomacy, spy, trade, spying, trading, web, browser, based, multiplayer, strategy" />
</head>
@ -17,5 +17,5 @@
engine v<?= config::$main['v_engine'] ?> -
revision <?= config::$main['v_rev'] ?>
</div>
<div id="players"><? include("players.en.inc"); ?></div>
<div id="lbox"><? include("lbox.en.inc"); ?></div>
<div id="players"><?php include("players.en.inc"); ?></div>
<div id="lbox"><?php include("lbox.en.inc"); ?></div>

View file

@ -1,20 +1,20 @@
<? if ($_SESSION['authok']) : ?>
<?php if ($_SESSION['authok']) : ?>
Welcome, <b><?= utf8entities($_SESSION['login']) ?></b><br/>
<? if ($__vacation) : ?>
<?php if ($__vacation) : ?>
Vacation mode activated
<? endif; ?>
<?php endif; ?>
<br/>
<a title="Preferences" href="<?= makeLink('settings', 'main') ?>">Preferences</a><br/>
<a title="Log out" href="<?= makeLink('logout', 'main') ?>">Log out</a>
<? else : ?>
<? if (input::$path == "main" && input::$page == "logout") : ?>
<?php else : ?>
<?php if (input::$path == "main" && input::$page == "logout") : ?>
<form method="post" action="<?= makeLink('index', 'main') ?>?userlogin=1"><div>
<? else : ?>
<?php else : ?>
<form method="post" action="?userlogin=1"><div>
<? endif; ?>
<?php endif; ?>
Username: <input type="text" name="login" value='' size="15" maxlength="15" class='input' /><br/>
Password: <input type="password" name="password" value='' size="15" maxlength="65" class='input' /><br/>
<a title="Recover password" href="<?= makeLink('lostpass', 'main') ?>">Forgot your password?</a>
<input type="submit" value='Log in' class='input' />
</div></form>
<? endif; ?>
<?php endif; ?>

View file

@ -1,4 +1,4 @@
<?
<?php
include("menu.en.inc");
$this->title = "About Legacy Worlds";
$this->addStylesheet('text');
@ -39,4 +39,4 @@ $this->startContents();
<a href="http://www.gpmanagerpro.com">GP Manager Pro</a> is DeepClone's latest project, a game
in which you play as the manager of a Grand Prix team.
</p>
<? $this->endContents(); ?>
<?php $this->endContents(); ?>

View file

@ -1,4 +1,4 @@
<?
<?php
include("menu.en.inc");
$this->title = "My account";
$this->addScript("account");
@ -73,9 +73,9 @@ function displayRegistered($a) {
?>
<div id='tabs'>
<a href="#acc-games" id="tab-games">Games</a>
<? if (is_null($__quit)) : ?>
<?php if (is_null($__quit)) : ?>
<a href="#acc-vacation" id="tab-vacation">Vacation</a>
<? endif; ?>
<?php endif; ?>
<a href="#acc-quit" id="tab-quit">Quit LegacyWorlds</a>
</div>
<div id="acc-games" class="acctab">
@ -89,7 +89,7 @@ $onVacation = ($vac['status'] == 'VAC');
if (count($args['play'])) {
echo "<p>You are currently playing the following games:</p>\n";
displayRegistered($args['play']);
if (count($args['other'])) {
if (isset($args['other']) && count($args['other'])) {
if ($onVacation) {
echo "<p>Other games are available, but you must exit vacation mode to see them.</p>\n";
} elseif (!$_SESSION['show_unregistered']) {
@ -133,7 +133,7 @@ if ($args['leech']) {
?>
</div>
<?
<?php
if (is_null($args['quit'])) {
?>

View file

@ -1,4 +1,4 @@
<?
<?php
$this->title = "Please contribute";
$this->addStylesheet('annoy');
$this->addScript('annoy');

View file

@ -1,4 +1,4 @@
<?
<?php
include('menu.en.inc');
$this->title = 'Beta 6 planets';
$this->addStylesheet('b6pp');
@ -30,7 +30,7 @@ $this->startContents();
<h2>Beta 6 planet pictures</h2>
<p><a href="?c=">Rate a picture</a> - <a href="?c=t">Top ratings</a> - You rated <?=$args['rated']?> out of <?=$args['total']?> pictures.</p>
<p>&nbsp;</p>
<? if ($args['page'] == 'nu'): ?>
<?php if ($args['page'] == 'nu'): ?>
<h3>There are no more pictures for you to rate</h3>
<p>
It would seem that you have rated all of the currently available pictures.
@ -38,7 +38,7 @@ $this->startContents();
<p>
Please come back later!
</p>
<? elseif ($args['page'] == 'vp') : ?>
<?php elseif ($args['page'] == 'vp') : ?>
<table style="margin: 0px auto; border-width:0px; width: 90%">
<tr>
<td style="vertical-align: middle; border-width:0px; text-align:center">
@ -53,7 +53,7 @@ $this->startContents();
<p>Environment: <?= $envType[$args['pic']['p_type']] ?></p>
<p>Type: <?= $pType[$args['pic']['p_type']][0] ?></p>
<p>Description: <?= $pType[$args['pic']['p_type']][1] ?></p>
<? if (is_null($args['cr'])) : ?>
<?php if (is_null($args['cr'])) : ?>
<p>&nbsp;</p>
<h3>Rate this picture</h3>
<div>
@ -66,7 +66,7 @@ $this->startContents();
for ($i = 1; $i <= 5; $i ++) {
?>
<input type="radio" name="r" value="<?=$i?>" onclick="this.form.submit();" />&nbsp;<?=$i?> &nbsp;
<?
<?php
}
?> &nbsp;(best)
</p></div>
@ -74,12 +74,12 @@ for ($i = 1; $i <= 5; $i ++) {
</div>
<p>&nbsp;</p>
<p>Each planet you rate grants you 120 <a href='<?=makeLink('contrib', 'main')?>'>contribution credits</a>.</p>
<? else: ?>
<?php else: ?>
<h3>Ratings</h3>
<p>Your rating: <?= $args['cr'] ?> / 5</p>
<p>Average rating: <?= $args['ar'] ?></p>
<p>Total votes: <?= $args['nv'] ?></p>
<? endif; ?>
<?php endif; ?>
</td>
</tr>
<tr>
@ -88,7 +88,7 @@ for ($i = 1; $i <= 5; $i ++) {
</td>
</tr>
</table>
<? elseif ($args['page'] == 'tt') : ?>
<?php elseif ($args['page'] == 'tt') : ?>
<h3 style="margin: 5px 0px; text-align: center">Top 50 planet pictures</h3>
<table style="margin: 0px auto; border-style: none">
<?php
@ -105,12 +105,12 @@ foreach ($args['pics'] as $pic) {
<?= sprintf("%.2f", $pic['rating']) ?> / 5.00
</td>
</tr>
<?
<?php
}
?>
</table>
<? elseif ($args['page'] == 'nt') : ?>
<?php elseif ($args['page'] == 'nt') : ?>
<h3>No planets have been rated at the moment</h3>
<p>... which kind of explains why this page is blank.</p>
<? endif; ?>
<? $this->endContents(); ?>
<?php endif; ?>
<?php $this->endContents(); ?>

View file

@ -1,4 +1,4 @@
<?
<?php
include("menu.en.inc");
$this->title = "Cancel account deletion";
$this->addStylesheet("account");
@ -17,4 +17,4 @@ $this->startContents();
<input type="submit" name="cancel" value="No, get on with it" class="input" />
</div></form>
</div>
<? $this->endContents(); ?>
<?php $this->endContents(); ?>

View file

@ -1,4 +1,4 @@
<?
<?php
include("menu.en.inc");
$this->title = "Account confirmation";
$this->startContents();
@ -17,4 +17,4 @@ $this->startContents();
<input type='submit' value='Validate my account' class="input" />
</p>
</div></form>
<? $this->endContents(); ?>
<?php $this->endContents(); ?>

View file

@ -1,4 +1,4 @@
<?
<?php
include('menu.en.inc');
$this->title = 'Contributions';
$this->addStylesheet('text');
@ -30,4 +30,4 @@ $this->startContents();
Note: if the resources you used are higher than the estimate of your contributions, you will start getting an
annoying message every time you log on to LegacyWorlds.
</p>
<? $this->endContents(); ?>
<?php $this->endContents(); ?>

View file

@ -102,7 +102,7 @@ if ($__err3) {
</div>
</div>
</div>
<?
<?php
$ePlanet = array(
"Valid characters: letters, numbers, spaces, and _@.+'/",
"The planet name is too long.",
@ -132,4 +132,4 @@ if ($__err4) {
<div class="formline"><input type='submit' name='create' value='Create account' class="input" /></div>
</div>
</div></form>
<? $this->endContents(); ?>
<?php $this->endContents(); ?>

View file

@ -1,4 +1,4 @@
<?
<?php
include("menu.en.inc");
$this->title = "Account creation";
$this->addStylesheet('text');

View file

@ -1,4 +1,4 @@
<?
<?php
include("menu.en.inc");
$this->title = "Credits";
$this->addStylesheet("credits");
@ -37,4 +37,4 @@ $this->startContents();
<div class="misc">Thanks to everyone who contributed to the game with various ideas or by reporting bugs...</div>
<div class="misc">Many bottles of beer were harmed during the making of this game.</div>
<? $this->endContents(); ?>
<?php $this->endContents(); ?>

View file

@ -1,4 +1,4 @@
<?
<?php
include("menu.en.inc");
$this->title = "Disclaimer";
$this->addStylesheet('text');
@ -28,4 +28,4 @@ $this->startContents();
the <a href="<?=makeLink('manual')?>?p=general_rules">manual</a>.
</p>
<?=$args?"<p>&nbsp;</p><p><a href='?'>Continue to account creation</a></p>":""?>
<? $this->endContents(); ?>
<?php $this->endContents(); ?>

View file

@ -1,5 +1,5 @@
<? $this->addStylesheet('home'); ?>
<? include('menu.en.inc'); ?>
<?php $this->addStylesheet('home'); ?>
<?php include('menu.en.inc'); ?>
<div id="gamedesc">
Legacy Worlds is a free, massively multiplayer, browser-based strategy game.<br/>
You don't need any plugins to play it, nor do you need to download anything.<br/>

View file

@ -1,4 +1,4 @@
<?
<?php
include("menu.en.inc");
$this->addStylesheet('text');
$this->title = "Logged out";
@ -17,4 +17,4 @@ $this->startContents();
<p>
See you soon!
</p>
<? $this->endContents(); ?>
<?php $this->endContents(); ?>

Some files were not shown because too many files have changed in this diff Show more