function getRemoteInfo() { $proxy = ""; $IP = ""; if (isset($_SERVER)) { if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) { $IP = $_SERVER["HTTP_X_FORWARDED_FOR"]; $proxy = $_SERVER["REMOTE_ADDR"]; } elseif (isset($_SERVER["HTTP_CLIENT_IP"])) { $IP = $_SERVER["HTTP_CLIENT_IP"]; } else { $IP = $_SERVER["REMOTE_ADDR"]; } } else { if (getenv('HTTP_X_FORWARDED_FOR')) { $IP = getenv('HTTP_X_FORWARDED_FOR'); $proxy = getenv('REMOTE_ADDR'); } elseif (getenv('HTTP_CLIENT_IP')) { $IP = getenv('HTTP_CLIENT_IP'); } else { $IP = getenv('REMOTE_ADDR'); } } if (strstr($IP, ',')) { $ips = explode(',', $IP); $IP = $ips[0]; } $RemoteInfo[0] = $IP; $RemoteInfo[1] = @GetHostByAddr($IP); $RemoteInfo[2] = $proxy; return $RemoteInfo; }
function gethostname() { $ipaddress = getenv('REMOTE_ADDR'); if (!$ipaddress) { $ipaddress = getenv('REMOTE_ADDR'); } $ipaddress = @GetHostByAddr($ipaddress); return $ipaddress; }
/** * Retrieves the host name of a vistor / user * @return string */ function gethostname() { $hostaddress = getenv('REMOTE_ADDR'); if (!$hostaddress) { $hostaddress = getenv('REMOTE_HOST'); } $hostaddress = @GetHostByAddr($hostaddress); return $hostaddress; }
$proxy = ""; $envIP = ""; if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) { $envIP = $_SERVER["HTTP_X_FORWARDED_FOR"]; $proxy = $_SERVER["REMOTE_ADDR"]; } elseif (isset($_SERVER["HTTP_CLIENT_IP"])) { $envIP = $_SERVER["HTTP_CLIENT_IP"]; } else { $envIP = $_SERVER["REMOTE_ADDR"]; } if (strstr($envIP, ',')) { $ips = explode(',', $envIP); $envIP = $ips[0]; } $RemoteInfo["ip"] = $envIP; $RemoteInfo["host"] = @GetHostByAddr($envIP); $RemoteInfo["proxy"] = $proxy; for ($i = 0; $i < count($env_report); $i++) { $string = trim($env_report[$i]); if ($string == "REMOTE_HOST" && isset($RemoteInfo["host"])) { $content['env'] = $content['env'] . str_pad("REMOTE HOST", 15, " ", STR_PAD_LEFT) . ": " . $RemoteInfo["host"] . "\n"; } if ($string == "REMOTE_ADDR" && isset($RemoteInfo["ip"])) { $content['env'] .= $content['env'] . str_pad("REMOTE ADDR", 15, " ", STR_PAD_LEFT) . ": " . $RemoteInfo["ip"] . "\n"; if (isset($RemoteInfo["proxy"])) { $content['env'] = $content['env'] . str_pad("PROXY HOST", 15, " ", STR_PAD_LEFT) . ": " . $RemoteInfo["proxy"] . "\n"; } } if ($string == "REMOTE_USER" && isset($_SERVER['REMOTE_USER'])) { $content['env'] = $content['env'] . str_pad("REMOTE USER", 15, " ", STR_PAD_LEFT) . ": " . $_SERVER['REMOTE_USER'] . "\n"; }
$row = $q->getrow(); $noattach = false; list($date, $time) = explode(" ", $row["datestamp"]); list($year, $month, $day) = explode("-", $date); list($hour, $minute, $second) = explode(":", $time); $ip = getenv('REMOTE_HOST'); if (!$ip) { $ip = getenv('REMOTE_ADDR'); } if (!$ip) { $ip = $REMOTE_ADDR; } if (!$ip) { $ip = $REMOTE_HOST; } $host = @GetHostByAddr($ip); $datestamp = date_format($row["datestamp"]); $author = chop($row["author"]); $SQL = "Select count(*) as count from {$ForumTableName}" . "_attachments where message_id={$id}"; $q->query($DB, $SQL); if ($q->field("count", 0) > 0) { $count = $q->field("count", 0); } else { $count = 0; } if (time() - mktime($hour, $minute, $second, $month, $day, $year) > 300 || $host != trim($row["host"]) || $count >= $ForumMaxUploads) { $noattach = true; } if (isset($post) && !$noattach) { // Attachment handling: if (is_array($HTTP_POST_FILES) && count($HTTP_POST_FILES) > 0) {
function HTML_facileFormsProcessor($runmode, $inframe, $form, $page = 1, $border = 0, $align = 1, $top = 0, $target = '', $suffix = '', $editable = 0, $editable_override = 0) { global $database, $ff_config, $ff_mossite, $ff_mospath, $ff_processor; $ff_processor = $this; $database = JFactory::getDBO(); $this->dying = false; $this->runmode = $runmode; $this->inframe = $inframe; $this->form = $form; $this->page = $page; $this->border = $border; $this->align = $align; $this->top = $top; $this->target = $target; $this->suffix = trim($suffix); $this->editable = $editable; $this->editable_override = $editable_override; if (!class_exists('JBrowser')) { require_once JPATH_SITE . '/libraries/joomla/environment/browser.php'; } $this->ip = $_SERVER['REMOTE_ADDR']; $this->agent = JBrowser::getInstance()->getAgentString(); $this->browser = JBrowser::getInstance()->getAgentString(); $jbrowserInstance = JBrowser::getInstance(); $this->opsys = $jbrowserInstance->getPlatform(); if ($ff_config->getprovider == 0) { $this->provider = BFText::_('COM_BREEZINGFORMS_PROCESS_UNKNOWN'); } else { $host = @GetHostByAddr($this->ip); $this->provider = preg_replace('/^./', '', strchr($host, '.')); } // if $submitted = JFactory::getDate(); jimport('joomla.version'); $version = new JVersion(); if (version_compare($version->getShortVersion(), '3.0', '>=')) { $this->submitted = $submitted->toSql(); } else { $this->submitted = $submitted->toMySQL(); } /* $format = JText::_('DATE_FORMAT_LC2'); if ( !$format ) { $this->submitted = date('Y-m-d H:i:s'); }else{ $config = JFactory::getConfig(); $offset = $config->getValue('config.offset'); $instance = JFactory::getDate(date('Y-m-d H:i:s')); $instance->setOffset($offset); $this->submitted = $instance->toFormat($format); } */ $this->formrow = new facileFormsForms($database); $this->formrow->load($form); if ($this->formrow->published) { $database->setQuery("select * from #__facileforms_elements " . "where form=" . $this->form . " and published=1 " . "order by page, ordering"); $this->rows = $database->loadObjectList(); $this->rowcount = count($this->rows); } // if $this->inline = 0; $this->template = 0; $this->form_id = "ff_form" . $form; if ($runmode == _FF_RUNMODE_FRONTEND) { $this->homepage = $ff_mossite; } else { if ($this->inframe) { $this->homepage = $ff_mossite . '/administrator/index.php?tmpl=component'; if ($this->formrow->runmode == 2) { $this->template++; } } else { $this->template++; if ($runmode == _FF_RUNMODE_PREVIEW) { $this->inline = 1; $this->form_id = "adminForm"; } // if $this->homepage = 'index.php?tmpl=component'; } // if } // if $this->mospath = $ff_mospath; $this->mossite = $ff_mossite; $this->findtags = array('{ff_currentpage}', '{ff_lastpage}', '{ff_name}', '{ff_title}', '{ff_homepage}', '{mospath}', '{mossite}'); $this->replacetags = array($this->page, $this->formrow->pages, $this->formrow->name, $this->formrow->title, $this->homepage, $this->mospath, $this->mossite); $this->images = str_replace($this->findtags, $this->replacetags, $ff_config->images); $this->findtags[] = '{ff_images}'; $this->replacetags[] = $this->images; $this->uploads = str_replace($this->findtags, $this->replacetags, $ff_config->uploads); $this->findtags[] = '{ff_uploads}'; $this->replacetags[] = $this->uploads; // CONTENTBUILDER $this->findtags[] = '{CBSite}'; $this->replacetags[] = JPATH_SITE; $this->findtags[] = '{cbsite}'; $this->replacetags[] = JPATH_SITE; $this->showgrid = $runmode == _FF_RUNMODE_PREVIEW && $this->formrow->prevmode > 0 && $ff_config->gridshow == 1 && $ff_config->gridsize > 1; $this->okrun = $this->formrow->published; if ($this->okrun) { switch ($this->runmode) { case _FF_RUNMODE_FRONTEND: $this->okrun = $this->formrow->runmode == 0 || $this->formrow->runmode == 1; break; case _FF_RUNMODE_BACKEND: $this->okrun = $this->formrow->runmode == 0 || $this->formrow->runmode == 2; break; default: } } // switch $this->traceMode = _FF_TRACEMODE_FIRST; $this->traceStack = array(); $this->traceBuffer = null; }
echo $arr[0]; ?> &net2=<?php echo $arr[1]; ?> &net3=<?php echo $arr[2]; ?> &net4=<?php echo $arr[3]; ?> "><?php echo GetMessage("STAT_STOP"); ?> </a>] (<?php echo @GetHostByAddr($f_LAST_IP); ?> )</td> </tr> <tr> <td nowrap><?php echo GetMessage("STAT_REGION"); ?> :</td> <td> <?php echo $f_REGION_NAME; ?> </td> </tr> <tr> <td nowrap><?php
/** * (macro) ReverseDNSLookup * Performs a reverse lookup on an IP Address. * * @param ip The IP address. */ function ReverseDNSLookup($ip) { // get hostname and ip $hostname = GetHostByAddr($ip); $hostip = GetHostByName($hostname); // return result return array('hostname' => $hostname, 'hostip' => $hostip, 'sourceip' => $ip, 'match' => $ip == $hostip); }
FUNCTION LogFile($nick, $class, $action, $logaction) { GLOBAL $VA_setup; $log = $VA_setup['log_format']; $log = EregI_Replace("%time%", Date($VA_setup['time_format']), $log); $log = EregI_Replace("%date%", Date($VA_setup['date_format']), $log); $log = EregI_Replace("%nick%", $nick, $log); $log = EregI_Replace("%class%", $class, $log); $log = EregI_Replace("%ip%", $_SERVER['REMOTE_ADDR'], $log); $log = EregI_Replace("%host%", GetHostByAddr($_SERVER['REMOTE_ADDR']), $log); $log = EregI_Replace("%action%", $action, $log); //If loging by action is enabled log to file by action name IF(EregI("%logfileaction%", $log)) { $write = EregI_Replace("%logfileaction%", "", $log); $write = EregI_Replace("%logfilenick%", "", $write); $file = @FOpen($VA_setup['log_dir'].$logaction.".log", "a+"); @FWrite($file, $write."\r\n"); @FClose($file); } //If loging by nick is enabled log to file by nick name IF(EregI("%logfilenick%", $log)) { $write = EregI_Replace("%logfileaction%", "", $log); $write = EregI_Replace("%logfilenick%", "", $write); $file = @FOpen($VA_setup['log_dir'].$nick.".log", "a+"); @FWrite($file, $write."\r\n"); @FClose($file); } RETURN; }