Skip to content

Commit

Permalink
Eliminate static checklogin function call
Browse files Browse the repository at this point in the history
  • Loading branch information
thekabal committed Sep 13, 2018
1 parent 044fbd1 commit c7b80a5
Show file tree
Hide file tree
Showing 46 changed files with 91 additions and 46 deletions.
3 changes: 2 additions & 1 deletion attack.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$title = $langvars['l_att_title'];
$header = new Tki\Header();
Expand Down
3 changes: 2 additions & 1 deletion beacon.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

echo "<h1>" . $title . "</h1>\n";

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Get playerinfo from database
$players_gateway = new \Tki\Players\PlayersGateway($pdo_db); // Build a player gateway object to handle the SQL calls
Expand Down
3 changes: 2 additions & 1 deletion bounty.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('bounty', 'port', 'common',
Expand Down
2 changes: 1 addition & 1 deletion classes/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

class Login
{
public static function checkLogin(\PDO $pdo_db, string $lang, Reg $tkireg, Smarty $template) : bool
public function checkLogin(\PDO $pdo_db, string $lang, Reg $tkireg, Smarty $template) : bool
{
// Database driven language entries
$langvars = Translate::load(
Expand Down
3 changes: 2 additions & 1 deletion defence_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('defense_report', 'planet_report', 'main', 'device', 'port', 'modify_defenses', 'common', 'global_includes', 'global_funcs', 'combat', 'footer', 'news', 'regional'));
Expand Down
3 changes: 2 additions & 1 deletion device.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('device', 'common', 'global_includes', 'global_funcs', 'report', 'footer', 'regional'));
Expand Down
3 changes: 2 additions & 1 deletion dump.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$title = $langvars['l_dump_title'];

Expand Down
3 changes: 2 additions & 1 deletion emerwarp.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Always make sure we are using empty vars before use.
$variables = null;
Expand Down
3 changes: 2 additions & 1 deletion feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('feedback', 'galaxy', 'common', 'global_includes', 'global_funcs', 'footer'));
Expand Down
3 changes: 2 additions & 1 deletion galaxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('main', 'port', 'galaxy', 'common', 'global_includes', 'global_funcs', 'footer'));
Expand Down
3 changes: 2 additions & 1 deletion genesis.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('genesis', 'common', 'global_includes', 'global_funcs', 'footer', 'news'));
Expand Down
3 changes: 2 additions & 1 deletion help.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$title = $langvars['l_help'];

Expand Down
3 changes: 2 additions & 1 deletion ibank.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
// File: ibank.php

require_once './common.php';
Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('ibank', 'common', 'global_includes', 'global_funcs', 'footer', 'news', 'regional'));
Expand Down
3 changes: 2 additions & 1 deletion log.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Hack for log bug issue - this really needs to be fixed
$log_list = array(null,
Expand Down
3 changes: 2 additions & 1 deletion lrscan.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('main', 'lrscan', 'common', 'global_includes', 'global_funcs', 'combat', 'footer', 'news', 'regional'));
Expand Down
3 changes: 2 additions & 1 deletion mailto.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$body_class = 'tki';
$include_ckeditor = "include";
Expand Down
3 changes: 2 additions & 1 deletion main.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('combat', 'common', 'main', 'modify_defenses', 'admin', 'footer', 'global_includes', 'regional'));
Expand Down
3 changes: 2 additions & 1 deletion mines.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('mines', 'common', 'global_includes', 'global_funcs', 'combat', 'footer', 'news', 'regional'));
Expand Down
3 changes: 2 additions & 1 deletion modify_defences.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$title = $langvars['l_md_title'];
$header = new Tki\Header();
Expand Down
3 changes: 2 additions & 1 deletion move.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$title = $langvars['l_move_title'];

Expand Down
3 changes: 2 additions & 1 deletion navcomp.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('navcomp', 'common', 'global_includes', 'global_funcs', 'footer'));
Expand Down
3 changes: 2 additions & 1 deletion option2.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Set a flag that we have not changed the language
$changed_language = false;
Expand Down
3 changes: 2 additions & 1 deletion options.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$body_class = 'options';

Expand Down
3 changes: 2 additions & 1 deletion planet.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$title = $langvars['l_planet_title'];

Expand Down
3 changes: 2 additions & 1 deletion planet2.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$title = $langvars['l_planet2_title'];
$header = new Tki\Header();
Expand Down
3 changes: 2 additions & 1 deletion planet3.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$title = $langvars['l_planet3_title'];

Expand Down
3 changes: 2 additions & 1 deletion planet_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('main', 'planet', 'port', 'common', 'global_includes', 'global_funcs', 'footer', 'planet_report', 'regional'));
Expand Down
3 changes: 2 additions & 1 deletion planet_report_ce.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$title = $langvars['l_pr_title'];

Expand Down
3 changes: 2 additions & 1 deletion port.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('port', 'report', 'device', 'common', 'global_includes', 'global_funcs', 'combat', 'footer', 'news', 'bounty', 'regional'));
Expand Down
3 changes: 2 additions & 1 deletion port2.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$title = $langvars['l_title_port'];

Expand Down
3 changes: 2 additions & 1 deletion preset.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$langvars = Tki\Translate::load($pdo_db, $lang, array('presets'));
$title = $langvars['l_pre_title'];
Expand Down
3 changes: 2 additions & 1 deletion readmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('readmail', 'common', 'global_includes', 'global_funcs', 'footer', 'planet_report'));
Expand Down
3 changes: 2 additions & 1 deletion report.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('main', 'report', 'device', 'common', 'global_includes', 'global_funcs', 'footer', 'regional'));
Expand Down
3 changes: 2 additions & 1 deletion rsmove.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('rsmove', 'common', 'global_funcs', 'global_includes', 'combat', 'footer', 'news', 'regional'));
Expand Down
3 changes: 2 additions & 1 deletion scan.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$title = $langvars['l_scan_title'];

Expand Down
3 changes: 2 additions & 1 deletion self_destruct.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('self_destruct', 'ranking', 'common', 'global_includes', 'global_funcs', 'news', 'footer'));
Expand Down
3 changes: 2 additions & 1 deletion ship.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$title = $langvars['l_ship_title'];
$header = new Tki\Header();
Expand Down
3 changes: 2 additions & 1 deletion team.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$title = $langvars['l_teamm_title'];
$header = new Tki\Header();
Expand Down
3 changes: 2 additions & 1 deletion team_planets.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

$title = $langvars['l_teamplanet_title'];

Expand Down
3 changes: 2 additions & 1 deletion teams.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

require_once './common.php';

Tki\Login::checkLogin($pdo_db, $lang, $tkireg, $template);
$login = new Tki\Login;
$login->checkLogin($pdo_db, $lang, $tkireg, $template);

// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('teams', 'common', 'global_includes', 'global_funcs', 'main', 'footer'));
Expand Down
Loading

0 comments on commit c7b80a5

Please sign in to comment.