1
0
mirror of https://github.com/e107inc/e107.git synced 2025-06-06 19:06:39 +02:00

Minor tidying - lose a few globals, a few 'todos'

This commit is contained in:
SteveD 2013-02-13 22:34:06 +00:00
parent bcaf4e70c6
commit b9a452e793
3 changed files with 875 additions and 871 deletions

View File

@ -2,7 +2,7 @@
/* /*
* e107 website system * e107 website system
* *
* Copyright 2008-2011 e107 Inc (e107.org) * Copyright 2008-2013 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)
* *
@ -58,7 +58,6 @@
* *
*/ */
// define("BAN_TYPE_LEGACY",0); // Quick fix for PHP Notice. If the error is triggered from somewhere else, the class name needs adding - eIPHandler::BAN_TYPE_LEGACY
class eIPHandler class eIPHandler
{ {
@ -271,8 +270,8 @@ class eIPHandler
if ($ip == 'ff02:0000:0000:0000:0000:0000:0000:0001') return FALSE; if ($ip == 'ff02:0000:0000:0000:0000:0000:0000:0001') return FALSE;
if ($ip == '::1') return FALSE; // localhost if ($ip == '::1') return FALSE; // localhost
if ($ip == '0000:0000:0000:0000:0000:0000:0000:0001') return FALSE; if ($ip == '0000:0000:0000:0000:0000:0000:0000:0001') return FALSE;
if (substr($ip, 0, 5) == 'fc00:') return FALSE; // local addresses
// @todo add: // @todo add:
// fc00::/7 - local addresses
// ::0 (all zero) - invalid // ::0 (all zero) - invalid
// ff02::1:ff00:0/104 - Solicited-Node multicast addresses - add? // ff02::1:ff00:0/104 - Solicited-Node multicast addresses - add?
// 2001:0000::/29 through 2001:01f8::/29 - special purpose addresses // 2001:0000::/29 through 2001:01f8::/29 - special purpose addresses
@ -717,7 +716,7 @@ class eIPHandler
*/ */
function makeDomainQuery($email, $fieldName = 'banlist_ip') function makeDomainQuery($email, $fieldName = 'banlist_ip')
{ {
global $tp; $tp = e107::getParser();
if (($tv = strrpos('@', $email)) !== FALSE) if (($tv = strrpos('@', $email)) !== FALSE)
{ {
$email = substr($email, $tv+1); $email = substr($email, $tv+1);
@ -852,8 +851,8 @@ class eIPHandler
$sql = e107::getDb(); $sql = e107::getDb();
$pref = e107::getPref(); $pref = e107::getPref();
$tp = e107::getParser(); $tp = e107::getParser();
$admin_log = e107::getAdminLog();
//global $admin_log;
//$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'))
{ {

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
/* /*
* e107 website system * e107 website system
* *
* Copyright (C) 2008-2009 e107 Inc (e107.org) * Copyright (C) 2008-2013 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)
* *
@ -171,7 +171,7 @@ class login_menu_class
function get_forum_stats($get_stats=true) function get_forum_stats($get_stats=true)
{ {
global $sql; $sql = e107::getDb();
if(!e107::isInstalled('forum')) if(!e107::isInstalled('forum'))
return array(); return array();
@ -204,7 +204,7 @@ class login_menu_class
function get_chatbox_menu_stats() function get_chatbox_menu_stats()
{ {
global $sql; $sql = e107::getDb();
if(!e107::isInstalled('chatbox_menu')) if(!e107::isInstalled('chatbox_menu'))
return array(); return array();
@ -339,14 +339,16 @@ class login_menu_class
/** /**
* @todo - $plugin_path is undefined - needs to be obtained from somewhere * Get data for a plugin
*
* @param string $plugid - name (= base directory) of the required plugin
*/ */
function get_plugin_data($plugid) function get_plugin_data($plugid)
{ {
if(($tmp = getcachedvars('loginbox_eplug_data_'.$plugid)) !== FALSE) return $tmp; if(($tmp = getcachedvars('loginbox_eplug_data_'.$plugid)) !== FALSE) return $tmp;
$ret = array(); $ret = array();
if (is_readable(e_PLUGIN.vartrue($plugin_path).'/plugin.xml')) if (is_readable(e_PLUGIN.$plugid.'/plugin.xml'))
{ {
require_once(e_HANDLER.'xml_class.php'); require_once(e_HANDLER.'xml_class.php');
$xml = new xmlClass; $xml = new xmlClass;