1
0
mirror of https://github.com/e107inc/e107.git synced 2025-06-08 20:21:13 +02:00

globals cleanup

This commit is contained in:
secretr 2011-09-14 07:31:32 +00:00
parent 27e95d93c3
commit 024d0250ea

View File

@ -2,7 +2,7 @@
/* /*
* e107 website system * e107 website system
* *
* Copyright (C) 2008-2010 e107 Inc (e107.org) * Copyright (C) 2008-2011 e107 Inc (e107.org)
* Released under the terms and conditions of the * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
@ -1809,7 +1809,7 @@ class e107
*/ */
public static function loadLanFiles($unitName, $type='runtime') public static function loadLanFiles($unitName, $type='runtime')
{ {
global $pref; //global $pref;
switch ($type) switch ($type)
{ {
case 'runtime' : case 'runtime' :
@ -1838,7 +1838,7 @@ class e107
return (isset($ret)) ? $ret : ""; return (isset($ret)) ? $ret : "";
} }
} }
if (varsettrue($pref['noLanguageSubs']) || (e_LANGUAGE == 'English')) if (e107::getPref('noLanguageSubs') || (e_LANGUAGE == 'English'))
{ {
return FALSE; // No point looking for the English files twice return FALSE; // No point looking for the English files twice
} }
@ -2436,7 +2436,7 @@ class e107
*/ */
public function ban() public function ban()
{ {
global $sql, $pref; $sql = e107::getDb();
$ban_count = $sql->db_Count('banlist'); $ban_count = $sql->db_Count('banlist');
if($ban_count) if($ban_count)
{ {
@ -2458,7 +2458,7 @@ class e107
$vals[] = substr($ip, 0, -14).'*'; $vals[] = substr($ip, 0, -14).'*';
} }
} }
if(varsettrue($pref['enable_rdns'])) if(e107::getPref('enable_rdns'))
{ {
$tmp = array_reverse(explode('.', $this->get_host_name(getenv('REMOTE_ADDR')))); $tmp = array_reverse(explode('.', $this->get_host_name(getenv('REMOTE_ADDR'))));
$line = ''; $line = '';
@ -2494,7 +2494,11 @@ class e107
*/ */
public function check_ban($query, $show_error = TRUE, $do_return = FALSE) public function check_ban($query, $show_error = TRUE, $do_return = FALSE)
{ {
global $sql, $tp, $pref, $admin_log; $sql = e107::getDb();
$pref = e107::getPref();
$tp = e107::getParser();
$admin_log = e107::getAdminLog();
//$admin_log->e_log_event(4,__FILE__."|".__FUNCTION__."@".__LINE__,"DBG","Check for Ban",$query,FALSE,LOG_TO_ROLLING); //$admin_log->e_log_event(4,__FILE__."|".__FUNCTION__."@".__LINE__,"DBG","Check for Ban",$query,FALSE,LOG_TO_ROLLING);
if($sql->db_Select('banlist', '*', $query.' ORDER BY `banlist_bantype` DESC')) if($sql->db_Select('banlist', '*', $query.' ORDER BY `banlist_bantype` DESC'))
{ {
@ -2552,7 +2556,10 @@ class e107
public function add_ban($bantype, $ban_message = '', $ban_ip = '', $ban_user = 0, $ban_notes = '') public function add_ban($bantype, $ban_message = '', $ban_ip = '', $ban_user = 0, $ban_notes = '')
{ {
global $sql, $pref, $e107, $admin_log; global $sql, $pref, $e107, $admin_log;
$sql = e107::getDb();
$pref = e107::getPref();
$e107 = e107::getInstance();
$admin_log = e107::getAdminLog();
if(!$ban_message) if(!$ban_message)
{ {
$ban_message = 'No explanation given'; $ban_message = 'No explanation given';
@ -2932,4 +2939,3 @@ class e107
return $ret; return $ret;
} }
} }
?>