mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
Update function calls where moved from e107_class.php to iphandler_class.php
This commit is contained in:
parent
7998e4f247
commit
8962c13f50
@ -594,7 +594,7 @@ init_session();
|
||||
//DEPRECATED but necessary. BC Fix.
|
||||
function getip()
|
||||
{
|
||||
return e107::ipDecode(USERIP);
|
||||
return e107::getIPHandler()->ipDecode(USERIP);
|
||||
}
|
||||
|
||||
// for multi-language these definitions needs to come after the language loaded.
|
||||
@ -832,7 +832,7 @@ if (($_SERVER['QUERY_STRING'] == 'logout')/* || (($pref['user_tracking'] == 'ses
|
||||
}
|
||||
}
|
||||
|
||||
$ip = $e107->getip();
|
||||
// $ip = e107::getIPHandler()->getIP(FALSE); Appears to not be used, so removed
|
||||
$udata = (USER === true ? USERID.'.'.USERNAME : '0');
|
||||
|
||||
// TODO - should be done inside online handler, more core areas need it (session handler for example)
|
||||
@ -1493,7 +1493,7 @@ function init_session()
|
||||
// New user model
|
||||
$user = e107::getUser();
|
||||
|
||||
define('USERIP', $e107->getip());
|
||||
define('USERIP', e107::getIPHandler()->getIP(FALSE));
|
||||
define('POST_REFERER', md5($user->getToken()));
|
||||
|
||||
// Check for intruders - outside the model for now
|
||||
|
@ -796,7 +796,7 @@ if(isset($page_title[$action]))
|
||||
$text .= "
|
||||
<td class='label'>".RL_LAN_060."</td>
|
||||
<td class='control'>
|
||||
<input class='tbox' type='text' name='roll_ipaddress_filter' size='20' value='".$e107->ipDecode($ipaddress_filter)."' maxlength='20' />
|
||||
<input class='tbox' type='text' name='roll_ipaddress_filter' size='20' value='".e107::getIPHandler()->ipDecode($ipaddress_filter)."' maxlength='20' />
|
||||
<div class='field-help'>".RL_LAN_061."</div>
|
||||
</td>
|
||||
";
|
||||
@ -981,10 +981,10 @@ if(isset($page_title[$action]))
|
||||
$val = preg_replace_callback("#\[!(\w+?)(=.+?){0,1}!]#", 'log_process', $row['dblog_remarks']);
|
||||
break;
|
||||
case 'dblog_ip':
|
||||
$val = $e107->ipDecode($row['dblog_ip']);
|
||||
$val = e107::getIPHandler()->ipDecode($row['dblog_ip']);
|
||||
break;
|
||||
case 'comment_ip':
|
||||
$val = $e107->ipDecode($row['comment_ip']);
|
||||
$val = e107::getIPHandler()->ipDecode($row['comment_ip']);
|
||||
/* if (strlen($val) == 8) // New decoder should handle this automatically
|
||||
{
|
||||
$hexip = explode('.', chunk_split($val, 2, '.'));
|
||||
|
@ -88,7 +88,8 @@ if(isset($_POST['delbanSubmit']))
|
||||
if($sql->db_Select("generic", "*", "gen_id={$ban}"))
|
||||
{
|
||||
$at = $sql->db_Fetch();
|
||||
if (!$e107->add_ban(4, FLALAN_4, $at['gen_ip'], ADMINID))
|
||||
//if (!$e107->add_ban(4, FLALAN_4, $at['gen_ip'], ADMINID))
|
||||
if (!e107::getIPHandler()add_ban(4, FLALAN_4, $at['gen_ip'], ADMINID))
|
||||
{ // IP on whitelist (although possibly we shouldn't get to this stage, but check anyway
|
||||
$emessage->add(str_replace(FLALAN_18,'--IP--',$at['gen_ip']), E_MESSAGE_WARNING);
|
||||
}
|
||||
@ -184,7 +185,7 @@ else
|
||||
<tr>
|
||||
<td>".$gen->convert_date($gen_datestamp, "forum")."</td>
|
||||
<td>".$gen_chardata."</td>
|
||||
<td>".$e107->ipDecode($fa['gen_ip'])."<br />{$host}</td>
|
||||
<td>".e107::getIPHandler()->ipDecode($fa['gen_ip'])."<br />{$host}</td>
|
||||
<td class='center middle autocheck e-pointer'>
|
||||
".$frm->checkbox('fladelete[]', $gen_id)."
|
||||
</td>
|
||||
|
@ -157,7 +157,7 @@ $text .= "
|
||||
$text .= "<tr>
|
||||
<td class='nowrap'>".e107::getDateConvert()->convert_date($val['online_timestamp'],'%H:%M:%S')."</td>
|
||||
<td>".renderOnlineName($val['online_user_id'])."</td>
|
||||
<td>".e107::ipDecode($val['online_ip'])."</td>
|
||||
<td>".e107::getIPHandler()->ipDecode($val['online_ip'])."</td>
|
||||
<td><a href='".$val['online_location']."' title='".$val['online_location']."'>".$tp->text_truncate($val['online_location'],50,'...')."</a></td>
|
||||
<td>".$tp->text_truncate(str_replace("/"," / ",$val['online_agent']),20,'...')."</td>
|
||||
</tr>
|
||||
|
@ -2320,7 +2320,7 @@ class admin_newspost
|
||||
</td>";
|
||||
|
||||
$text .= "<td class='nowrap'>".date('D jS M, Y, g:ia', $row['submitnews_datestamp'])."</td>
|
||||
<td><a href=\"mailto:".$row['submitnews_email']."?subject=[".SITENAME."] ".trim($row['submitnews_title'])."\" title='".$row['submitnews_email']." - ".$e107->ipDecode($row['submitnews_ip'])."'>".$row['submitnews_name']."</a></td>
|
||||
<td><a href=\"mailto:".$row['submitnews_email']."?subject=[".SITENAME."] ".trim($row['submitnews_title'])."\" title='".$row['submitnews_email']." - ".e107::getIPHandler()->ipDecode($row['submitnews_ip'])."'>".$row['submitnews_name']."</a></td>
|
||||
<td>".$newsCat[$row['submitnews_category']]."</td>
|
||||
<td class='center'>".($row['submitnews_auth'] == 0 ? "-" : ADMIN_TRUE_ICON)."</td>
|
||||
|
||||
|
@ -1334,7 +1334,7 @@ class users
|
||||
break;
|
||||
|
||||
case 'user_ip':
|
||||
return $e107->ipDecode($row['user_ip']);
|
||||
return e107::getIPHandler()->ipDecode($row['user_ip']);
|
||||
break;
|
||||
|
||||
|
||||
@ -1775,7 +1775,7 @@ class users
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($e107->add_ban(6,USRLAN_149.$row['user_name'].'/'.$row['user_loginname'],$row['user_ip'],USERID))
|
||||
if (e107::getIPHandler()->add_ban(6,USRLAN_149.$row['user_name'].'/'.$row['user_loginname'],$row['user_ip'],USERID))
|
||||
{
|
||||
// Successful IP ban
|
||||
$this->show_message(str_replace("{IP}",$row['user_ip'],USRLAN_137));
|
||||
|
@ -128,7 +128,7 @@ SC_END
|
||||
SC_BEGIN IPADDRESS
|
||||
global $IPADDRESS, $comrow, $e107;
|
||||
//require_once(e_HANDLER."encrypt_handler.php");
|
||||
return (ADMIN ? "<a href='".SITEURL."userposts.php?0.comments.".$comrow['user_id']."'>".COMLAN_330." ".$e107->ipDecode($comrow['comment_ip'])."</a>" : "");
|
||||
return (ADMIN ? "<a href='".SITEURL."userposts.php?0.comments.".$comrow['user_id']."'>".COMLAN_330." ".e107::getIPHandler()->ipDecode($comrow['comment_ip'])."</a>" : "");
|
||||
SC_END
|
||||
|
||||
SC_BEGIN LEVEL
|
||||
|
@ -205,8 +205,8 @@ class e_admin_log
|
||||
// Calculations common to all logs
|
||||
//---------------------------------------
|
||||
$userid = (USER === TRUE) ? USERID : 0;
|
||||
$userstring = (USER === true ? USERNAME : "LAN_ANONYMOUS");
|
||||
$userIP = $e107->getip();
|
||||
$userstring = (USER === true ? USERNAME : 'LAN_ANONYMOUS');
|
||||
$userIP = e107::getIPHandler()->getIP(FALSE);
|
||||
|
||||
$importance = $tp->toDB($importance, true, false, 'no_html');
|
||||
$eventcode = $tp->toDB($eventcode, true, false, 'no_html');
|
||||
@ -331,7 +331,7 @@ class e_admin_log
|
||||
else $userid = (USER === TRUE) ? USERID : 0;
|
||||
if ($u_name) $userstring = $u_name;
|
||||
else $userstring = (USER === true ? USERNAME : "LAN_ANONYMOUS");
|
||||
$userIP = $e107->getip();
|
||||
$userIP = e107::getIPHandler()->getIP(FALSE);
|
||||
$eventcode = 'USER_'.$event_type;
|
||||
|
||||
$title = 'LAN_AUDIT_LOG_0'.$event_type; // This creates a string which will be displayed as a constant
|
||||
|
@ -239,7 +239,7 @@ class comment
|
||||
$unblock = "[<a href='".e_ADMIN_ABS."comment.php?unblock-".$comrow['comment_id']."-$url-".$comrow['comment_item_id']."'>".COMLAN_1."</a>] ";
|
||||
$block = "[<a href='".e_ADMIN_ABS."comment.php?block-".$comrow['comment_id']."-$url-".$comrow['comment_item_id']."'>".COMLAN_2."</a>] ";
|
||||
$delete = "[<a href='".e_ADMIN_ABS."comment.php?delete-".$comrow['comment_id']."-$url-".$comrow['comment_item_id']."'>".COMLAN_3."</a>] ";
|
||||
$userinfo = "[<a href='".e_ADMIN_ABS."userinfo.php?".$e107->ipDecode($comrow['comment_ip'])."'>".COMLAN_4."</a>]";
|
||||
$userinfo = "[<a href='".e_ADMIN_ABS."userinfo.php?".e107::getIPHandler()->ipDecode($comrow['comment_ip'])."'>".COMLAN_4."</a>]";
|
||||
if (!$COMMENTSTYLE)
|
||||
{
|
||||
global $THEMES_DIRECTORY;
|
||||
|
@ -2604,15 +2604,16 @@ class e107
|
||||
*
|
||||
* @return boolean check result
|
||||
*/
|
||||
/*
|
||||
public function add_ban($bantype, $ban_message = '', $ban_ip = '', $ban_user = 0, $ban_notes = '')
|
||||
{
|
||||
return e107::getIPHandler()->add_ban($bantype, $ban_message, $ban_ip, $ban_user, $ban_notes);
|
||||
}
|
||||
} */
|
||||
|
||||
/**
|
||||
* Get the current user's IP address
|
||||
* returns the address in internal 'normalised' IPV6 format - so most code should continue to work provided the DB Field is big enougn
|
||||
* FIXME - call ipHandler directly
|
||||
* FIXME - call ipHandler directly (done for core - left temporarily for BC)
|
||||
* @return string
|
||||
*/
|
||||
public function getip()
|
||||
@ -2638,7 +2639,7 @@ class e107
|
||||
* Set $IP4Legacy TRUE to display 'old' (IPv4) addresses in the familiar dotted format,
|
||||
* FALSE to display in standard IPV6 format
|
||||
* Should handle most things that can be thrown at it.
|
||||
* FIXME - moved to ipHandler - check for calls elsewhere
|
||||
* FIXME - moved to ipHandler - check for calls elsewhere - core done; left temporarily for BC
|
||||
* @param string $ip encoded IP
|
||||
* @param boolean $IP4Legacy
|
||||
* @return string decoded IP
|
||||
|
@ -1298,8 +1298,8 @@ class e_form
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
$e107 = e107::getInstance();
|
||||
$value = $e107->ipDecode($value);
|
||||
//$e107 = e107::getInstance();
|
||||
$value = e107::getIPHandler()->ipDecode($value);
|
||||
// else same
|
||||
break;
|
||||
|
||||
@ -1637,7 +1637,7 @@ class e_form
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
return $this->text($key, e107::getInstance()->ipDecode($value), 32, $parms);
|
||||
return $this->text($key, e107::getIPHandler()->ipDecode($value), 32, $parms);
|
||||
break;
|
||||
|
||||
case 'url':
|
||||
|
@ -743,6 +743,34 @@ class eIPHandler
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Split up an email address to check for banned domains.
|
||||
* @param string $email - email address to process
|
||||
* @param string $fieldname - name of field being searched in DB
|
||||
*
|
||||
* @return bool|string false if invalid address. Otherwise returns a set of values to check
|
||||
* (Moved in from user_handler.php)
|
||||
*/
|
||||
public function makeEmailQuery($email, $fieldname = 'banlist_ip')
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
$tmp = strtolower($tp -> toDB(trim(substr($email, strrpos($email, "@")+1)))); // Pull out the domain name
|
||||
if ($tmp == '') return FALSE;
|
||||
if (strpos($tmp,'.') === FALSE) return FALSE;
|
||||
$em = array_reverse(explode('.',$tmp));
|
||||
$line = '';
|
||||
$out = array($fieldname."='*@{$tmp}'"); // First element looks for domain as email address
|
||||
foreach ($em as $e)
|
||||
{
|
||||
$line = '.'.$e.$line;
|
||||
$out[] = '`'.$fieldname."`='*{$line}'";
|
||||
}
|
||||
return implode(' OR ',$out);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Routines beyond here are to handle banlist-related tasks which involve the DB
|
||||
* note: Most of these routines already existed; moved in from e107_class.php
|
||||
|
@ -514,8 +514,8 @@ class userlogin
|
||||
$fails = $this->e107->sql->db_Count("generic", "(*)", "WHERE gen_ip='{$this->userIP}' AND gen_type='failed_login' ");
|
||||
if($fails > 10)
|
||||
{
|
||||
$this->e107->add_ban(4,LAN_LOGIN_18,$this->userIP,1);
|
||||
$this->e107->sql->db_Insert("generic", "0, 'auto_banned', '".time()."', 0, '{$this->userIP}', '{$extra_text}', '".LAN_LOGIN_20.": ".$this->e107->tp -> toDB($username).", ".LAN_LOGIN_17.": ".md5($ouserpass)."' ");
|
||||
e107::getIPHandler()->add_ban(4,LAN_LOGIN_18,$this->userIP,1);
|
||||
e107::getDb()->db_Insert("generic", "0, 'auto_banned', '".time()."', 0, '{$this->userIP}', '{$extra_text}', '".LAN_LOGIN_20.": ".$this->e107->tp -> toDB($username).", ".LAN_LOGIN_17.": ".md5($ouserpass)."' ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ class e_db_mysql
|
||||
list($time_usec, $time_sec) = explode(" ", microtime());
|
||||
$uid = (USER) ? USERID : '0';
|
||||
$userstring = ( USER === true ? USERNAME : "LAN_ANONYMOUS");
|
||||
$ip = $e107->getip();
|
||||
$ip = e107::getIPHandler()->getIP(FALSE);
|
||||
$qry = $tp->toDB($log_query);
|
||||
$this->db_Insert('dblog', "0, {$time_sec}, {$time_usec}, '{$log_type}', 'DBDEBUG', {$uid}, '{$userstring}', '{$ip}', '', '{$log_remark}', '{$qry}'");
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ function notify_userveri($data)
|
||||
global $nt, $e107;
|
||||
$msgtext = NT_LAN_UV_2.$data['user_id']."\n";
|
||||
$msgtext .= NT_LAN_UV_3.$data['user_loginname']."\n";
|
||||
$msgtext .= NT_LAN_UV_4.$e107->getip();
|
||||
$msgtext .= NT_LAN_UV_4.e107::getIPHandler()->getIP(FALSE);
|
||||
$nt->send('userveri', NT_LAN_UV_1, $msgtext);
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ class e_online
|
||||
$page = e_REQUEST_URI; // mod rewrite & single entry support
|
||||
// FIXME parse url, trigger registered e_online callbacks
|
||||
$page = $e107->tp->toDB($page, true); /// @todo - try not to use toDB() - triggers prefilter
|
||||
$ip = $e107->getip();
|
||||
$ip = e107::getIPHandler()->getIP(FALSE);
|
||||
$udata = ($user->isUser() ? $user->getId().'.'.$user->getName() : '0');
|
||||
$agent = $_SERVER['HTTP_USER_AGENT'];
|
||||
|
||||
@ -208,7 +208,7 @@ class e_online
|
||||
if ($row['online_pagecount'] > $online_bancount)
|
||||
{
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_banlist.php');
|
||||
if ($e107->add_ban(2,str_replace('--HITS--',$row['online_pagecount'],BANLAN_78),$ip,0))
|
||||
if (e107::getIPHandler()->add_ban(2,str_replace('--HITS--',$row['online_pagecount'],BANLAN_78),$ip,0))
|
||||
{
|
||||
e107::getEvent()->trigger('flood', $ip);
|
||||
exit;
|
||||
|
@ -416,9 +416,13 @@ class UserHandler
|
||||
* @param string $fieldname - name of field being searched in DB
|
||||
*
|
||||
* @return bool|string false if invalid address. Otherwise returns a set of values to check
|
||||
* Moved to IPHandler
|
||||
*/
|
||||
/*
|
||||
public function make_email_query($email, $fieldname = 'banlist_ip')
|
||||
{
|
||||
return e107::getIPHandler()->makeEmailQuery($v, $fieldname); // Valid 'stub' if required
|
||||
|
||||
$tp = e107::getParser();
|
||||
$tmp = strtolower($tp -> toDB(trim(substr($email, strrpos($email, "@")+1)))); // Pull out the domain name
|
||||
if ($tmp == '') return FALSE;
|
||||
@ -433,7 +437,7 @@ class UserHandler
|
||||
}
|
||||
return implode(' OR ',$out);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@ -610,9 +614,9 @@ Following fields auto-filled in code as required:
|
||||
}
|
||||
else
|
||||
{ // See if email address banned
|
||||
$wc = $this->make_email_query($v); // Generate the query for the ban list
|
||||
$wc = e107::getIPHandler()->makeEmailQuery($v); // Generate the query for the ban list
|
||||
if ($wc) { $wc = "`banlist_ip`='{$v}' OR ".$wc; }
|
||||
if (($wc === FALSE) || !e107::getInstance()->check_ban($wc, FALSE, TRUE))
|
||||
if (($wc === FALSE) || !e107::getIPHandler()->checkBan($wc, FALSE, TRUE))
|
||||
{
|
||||
// echo "Email banned<br />";
|
||||
$errMsg = ERR_BANNED_EMAIL;
|
||||
|
@ -1229,7 +1229,7 @@ class e_user extends e_user_model
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
$this->set('last_ip', $this->get('user_ip'));
|
||||
$current_ip = e107::getInstance()->getip();
|
||||
$current_ip = e107::getIPHandler()->getIP(FALSE);
|
||||
$update_ip = $this->get('user_ip' != $current_ip ? ", user_ip = '".$current_ip."'" : "");
|
||||
$this->set('user_ip', $current_ip);
|
||||
if($this->get('user_currentvisit') + 3600 < time() || !$this->get('user_lastvisit'))
|
||||
|
@ -43,7 +43,7 @@ if (e_QUERY) {
|
||||
$query_string = intval(e_QUERY);
|
||||
$sql->db_Select("banner", "*", "banner_id = '{$query_string}' ");
|
||||
$row = $sql->db_Fetch();
|
||||
$ip = $e107->getip();
|
||||
$ip = e107::getIPHandler()->getIP(FALSE);
|
||||
$newip = (strpos($row['banner_ip'], "{$ip}^") !== FALSE) ? $row['banner_ip'] : "{$row['banner_ip']}{$ip}^";
|
||||
$sql->db_Update("banner", "banner_clicks = banner_clicks + 1, `banner_ip` = '{$newip}' WHERE `banner_id` = '{$query_string}'");
|
||||
header("Location: {$row['banner_clickurl']}");
|
||||
|
@ -316,7 +316,7 @@ class ecal_class
|
||||
}
|
||||
else
|
||||
$cmessage .= "Event Start unknown<br />";
|
||||
$edata_ec = array('cmessage' => $cmessage, 'ip' => $e107->getip());
|
||||
$edata_ec = array('cmessage' => $cmessage, 'ip' => e107::getIPHandler()->getIP(FALSE));
|
||||
switch ($event_type)
|
||||
{
|
||||
case 5 :
|
||||
|
@ -70,7 +70,7 @@ if(isset($_POST['chat_submit']) && $_POST['cmessage'] != '')
|
||||
else
|
||||
{
|
||||
$datestamp = time();
|
||||
$ip = $e107->getip();
|
||||
$ip = e107::getIPHandler()->getIP(FALSE);
|
||||
if(USER)
|
||||
{
|
||||
$nick = USERID.".".USERNAME;
|
||||
|
@ -1083,7 +1083,7 @@ function show_content_item()
|
||||
|
||||
//update refer count outside of cache (count visits ^ count unique ips)
|
||||
if( varsettrue($content_pref["content_log"]) ){
|
||||
$ip = $e107->getip();
|
||||
$ip = e107::getIPHandler()->getIP(FALSE);
|
||||
$self = e_SELF;
|
||||
$refertmp = explode("^", $row['content_refer']);
|
||||
if(strpos($self, "admin") === FALSE){
|
||||
|
@ -118,7 +118,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
{
|
||||
if($this->postInfo['post_user_anon'] && (ADMIN || MODERATOR))
|
||||
{
|
||||
return $this->e107->ipDecode($this->postInfo['post_ip']);
|
||||
return e107::getIPHandler()->ipDecode($this->postInfo['post_ip']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
{
|
||||
if((ADMIN || MODERATOR) && !$this->postInfo['user_admin'])
|
||||
{
|
||||
return $this->e107->ipDecode($this->postInfo['post_ip']);
|
||||
return e107::getIPHandler()->ipDecode($this->postInfo['post_ip']);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ if (isset($_POST['newthread']) || isset($_POST['reply']))
|
||||
exit;
|
||||
}
|
||||
$hasPoll = ($action == 'nt' && varset($_POST['poll_title']) && $_POST['poll_option'][0] != '' && $_POST['poll_option'][1] != '');
|
||||
$postInfo['post_ip'] = $e107->getip();
|
||||
$postInfo['post_ip'] = e107::getIPHandler()->getIP(FALSE);
|
||||
|
||||
if (USER)
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ if(defined('FPW_ACTIVE'))
|
||||
|
||||
global $eMenuActive, $pref, $e107, $sql, $tp, $ns, $use_imagecode, $ADMIN_DIRECTORY, $LOGIN_MENU_MESSAGE, $LOGIN_MENU_STATITEM, $LM_STATITEM_SEPARATOR,
|
||||
$login_menu_shortcodes, $LOGIN_MENU_FORM, $LOGIN_MENU_LOGGED, $LOGIN_MENU_STATS, $LOGIN_MENU_EXTERNAL_LINK;
|
||||
$ip = $e107->getip();
|
||||
$ip = e107::getIPHandler()->getIP(FALSE);
|
||||
|
||||
//shortcodes
|
||||
require_once(e_PLUGIN."login_menu/login_menu_shortcodes.php");
|
||||
|
@ -186,7 +186,7 @@ class poll
|
||||
break;
|
||||
|
||||
case POLL_MODE_IP:
|
||||
$userid = $e107->getip();
|
||||
$userid = e107::getIPHandler()->getIP(FALSE);
|
||||
$voted_ids = explode('^', substr($pollArray['poll_ip'], 0, -1));
|
||||
if (in_array($userid, $voted_ids))
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ if (varset($e107_popup) != 1)
|
||||
$logLine = '';
|
||||
if ($pref['log_page_accesses'])
|
||||
{ // Collect the first batch of data to log
|
||||
$logLine .= "'".($now = time())."','".gmstrftime('%y-%m-%d %H:%M:%S', $now)."','".$e107->getIP()."','".e_PAGE.'?'.e_QUERY."','".$rendertime."','".$db_time."','".$queryCount."','".$memuse."'";
|
||||
$logLine .= "'".($now = time())."','".gmstrftime('%y-%m-%d %H:%M:%S', $now)."','".e107::getIPHandler()->getIP(FALSE)."','".e_PAGE.'?'.e_QUERY."','".$rendertime."','".$db_time."','".$queryCount."','".$memuse."'";
|
||||
}
|
||||
|
||||
if (function_exists('getrusage'))
|
||||
|
@ -103,7 +103,7 @@ if (isset($_POST['emailsubmit']))
|
||||
{
|
||||
// $message .= $comments."\n"; // Added to message later on
|
||||
}
|
||||
$ip = $e107->getip();
|
||||
$ip = e107::getIPHandler()->getIP(FALSE);
|
||||
$message .= "\n\n".LAN_EMAIL_2." ".$ip."\n\n";
|
||||
|
||||
if (substr($source,0,7) == 'plugin:')
|
||||
|
4
fpw.php
4
fpw.php
@ -148,7 +148,7 @@ if (isset($_POST['pwsubmit']))
|
||||
|
||||
if (($row['user_admin'] == 1) && (($row['user_perms'] == '0') OR ($row['user_perms'] == '0.')))
|
||||
{ // Main admin expected to be competent enough to never forget password! (And its a security check - so warn them)
|
||||
sendemail($pref['siteadminemail'], LAN_06, LAN_07.' '.$e107->getip().' '.LAN_08);
|
||||
sendemail($pref['siteadminemail'], LAN_06, LAN_07.' '.e107::getIPHandler()->getIP(FALSE).' '.LAN_08);
|
||||
echo "<script type='text/javascript'>document.location.href='index.php'</script>\n";
|
||||
die();
|
||||
}
|
||||
@ -177,7 +177,7 @@ if (isset($_POST['pwsubmit']))
|
||||
$rcode = md5($_SERVER['HTTP_USER_AGENT'] . serialize($pref). $rand_num . $datekey);
|
||||
|
||||
$link = SITEURL.'fpw.php?'.$rcode;
|
||||
$message = LAN_FPW5.' '.SITENAME.' '.LAN_FPW14.' : '.$e107->getip().".\n\n".LAN_FPW15."\n\n".LAN_FPW16."\n\n".LAN_FPW17."\n\n{$link}";
|
||||
$message = LAN_FPW5.' '.SITENAME.' '.LAN_FPW14.' : '.e107::getIPHandler()->getIP(FALSE).".\n\n".LAN_FPW15."\n\n".LAN_FPW16."\n\n".LAN_FPW17."\n\n{$link}";
|
||||
|
||||
$deltime = time()+86400 * 2; //Set timestamp two days ahead so it doesn't get auto-deleted
|
||||
$sql->db_Insert('tmp', "'pwreset',{$deltime},'".$row['user_loginname'].FPW_SEPARATOR.$rcode."'");
|
||||
|
@ -192,7 +192,7 @@ if ($type == "file")
|
||||
// increment download count
|
||||
$sql->db_Update("download", "download_requested = download_requested + 1 WHERE download_id = '{$id}'");
|
||||
$user_id = USER ? USERID : 0;
|
||||
$ip = $e107->getip();
|
||||
$ip = e107::getIPHandler()->getIP(FALSE);
|
||||
$request_data = "'0', '{$user_id}', '{$ip}', '{$id}', '".time()."'";
|
||||
//add request info to db
|
||||
$sql->db_Insert("download_requests", $request_data, FALSE);
|
||||
@ -452,7 +452,7 @@ function check_download_limits()
|
||||
{
|
||||
$where = "dr.download_request_datestamp > {$cutoff} AND dr.download_request_userid = ".USERID;
|
||||
} else {
|
||||
$ip = $e107->getip();
|
||||
$ip = e107::getIPHandler()->getIP(FALSE);
|
||||
$where = "dr.download_request_datestamp > {$cutoff} AND dr.download_request_ip = '{$ip}'";
|
||||
}
|
||||
$qry = "SELECT COUNT(d.download_id) as count FROM #download_requests as dr LEFT JOIN #download as d ON dr.download_request_download_id = d.download_id AND d.download_active = 1 WHERE {$where} GROUP by dr.download_request_userid";
|
||||
@ -478,7 +478,7 @@ function check_download_limits()
|
||||
if(USER) {
|
||||
$where = "dr.download_request_datestamp > {$cutoff} AND dr.download_request_userid = ".USERID;
|
||||
} else {
|
||||
$ip = $e107->getip();
|
||||
$ip = e107::getIPHandler()->getIP(FALSE);
|
||||
$where = "dr.download_request_datestamp > {$cutoff} AND dr.download_request_ip = '{$ip}'";
|
||||
}
|
||||
$qry = "SELECT SUM(d.download_filesize) as total_bw FROM #download_requests as dr LEFT JOIN #download as d ON dr.download_request_download_id = d.download_id AND d.download_active = 1 WHERE {$where} GROUP by dr.download_request_userid";
|
||||
|
@ -206,7 +206,7 @@ if (isset($_GET['q']) || isset($_GET['in']) || isset($_GET['ex']) || isset($_GET
|
||||
elseif ($search_prefs['time_restrict']) {
|
||||
$time = time() - $search_prefs['time_secs'];
|
||||
$query_check = $tp -> toDB($full_query);
|
||||
$ip = $e107->getip();
|
||||
$ip = e107::getIPHandler()->getIP(FALSE);
|
||||
if ($sql -> db_Select("tmp", "tmp_ip, tmp_time, tmp_info", "tmp_info LIKE 'type_search%' AND tmp_ip='".$ip."'")) {
|
||||
$row = $sql -> db_Fetch();
|
||||
if (($row['tmp_time'] > $time) && ($row['tmp_info'] != 'type_search '.$query_check)) {
|
||||
|
@ -399,7 +399,7 @@ if (isset($_POST['register']))
|
||||
unset($_POST['password1']); // Restrict the scope of this
|
||||
unset($_POST['password2']);
|
||||
|
||||
$allData['user_ip'] = $e107->getip();
|
||||
$allData['user_ip'] = e107::getIPHandler()->getIP(FALSE);
|
||||
|
||||
|
||||
// check for multiple signups from the same IP address. But ignore localhost
|
||||
@ -411,7 +411,7 @@ if (isset($_POST['register']))
|
||||
{
|
||||
$allData['errors']['user_email'] = ERR_GENERIC;
|
||||
$allData['errortext']['user_email'] = LAN_SIGNUP_71;
|
||||
$admin_log->log_event('USET_15',LAN_SIGNUP_103.$e107->getip(),4);
|
||||
$admin_log->log_event('USET_15',LAN_SIGNUP_103.e107::getIPHandler()->getIP(FALSE),4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ if (!check_class($pref['subnews_class']))
|
||||
|
||||
if (isset($_POST['submitnews_submit']) && $_POST['submitnews_title'] && $_POST['submitnews_item'])
|
||||
{
|
||||
$ip = $e107->getip();
|
||||
$ip = e107::getIPHandler()->getIP(FALSE);
|
||||
$fp = new floodprotect;
|
||||
if ($fp->flood("submitnews", "submitnews_datestamp") == FALSE)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user