本文整理汇总了PHP中SPAMX_log函数的典型用法代码示例。如果您正苦于以下问题:PHP SPAMX_log函数的具体用法?PHP SPAMX_log怎么用?PHP SPAMX_log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SPAMX_log函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Here we do the work
*/
public function execute($comment)
{
global $_CONF, $_TABLES, $LANG_SX00;
$uid = $this->getUid();
/**
* Check for IP of url in blacklist
*/
/*
* regex to find urls $2 = fqd
*/
$regx = '(ftp|http|file)://([^/\\s]+)';
$num = preg_match_all("#{$regx}#", html_entity_decode($comment), $urls);
$result = DB_query("SELECT value FROM {$_TABLES['spamx']} WHERE name='IPofUrl'", 1);
$nrows = DB_numRows($result);
$ans = PLG_SPAM_NOT_FOUND;
for ($j = 1; $j <= $nrows; $j++) {
list($val) = DB_fetchArray($result);
for ($i = 0; $i < $num; $i++) {
$ip = gethostbyname($urls[2][$i]);
if ($val == $ip) {
$ans = PLG_SPAM_FOUND;
// quit on first positive match
$this->updateStat('IPofUrl', $val);
SPAMX_log($LANG_SX00['foundspam'] . $urls[2][$i] . $LANG_SX00['foundspam2'] . $uid . $LANG_SX00['foundspam3'] . $_SERVER['REMOTE_ADDR']);
break;
}
}
if ($ans == PLG_SPAM_FOUND) {
break;
}
}
return $ans;
}
示例2: execute
/**
* Here we do the work
*/
public function execute($comment)
{
global $_CONF, $_TABLES, $_USER, $LANG_SX00;
if (isset($_USER['uid']) && $_USER['uid'] > 1) {
$uid = $_USER['uid'];
} else {
$uid = 1;
}
/**
* Include Blacklist Data
*/
$result = DB_query("SELECT value FROM {$_TABLES['spamx']} WHERE name='Personal'", 1);
$nrows = DB_numRows($result);
// named entities
$comment = html_entity_decode($comment);
// decimal notation
$comment = preg_replace_callback('/&#(\\d+);/m', array($this, 'callbackDecimal'), $comment);
// hex notation
$comment = preg_replace_callback('/&#x([a-f0-9]+);/mi', array($this, 'callbackHex'), $comment);
$ans = 0;
for ($i = 1; $i <= $nrows; $i++) {
list($val) = DB_fetchArray($result);
$val = str_replace('#', '\\#', $val);
if (preg_match("#{$val}#i", $comment)) {
$ans = 1;
// quit on first positive match
SPAMX_log($LANG_SX00['foundspam'] . $val . $LANG_SX00['foundspam2'] . $uid . $LANG_SX00['foundspam3'] . $_SERVER['REMOTE_ADDR']);
break;
}
}
return $ans;
}
示例3: disableUser
/**
* Disables a specified user
*
* @param int $uid
**/
protected function disableUser($uid)
{
global $_TABLES, $_USER;
$this->result = PLG_SPAM_ACTION_DELETE;
DB_change($_TABLES['users'], 'status', USER_ACCOUNT_DISABLED, 'uid', $uid);
SPAMX_log("User {$_USER['username']} banned for profile spam.");
}
示例4: execute
/**
* Here we do the work
*/
function execute($comment)
{
global $_CONF, $_USER, $_TABLES, $LANG_SX00;
if (isset($_USER['uid']) && $_USER['uid'] > 1) {
$uid = $_USER['uid'];
} else {
$uid = 1;
}
/**
* Include Blacklist Data
*/
$result = DB_query("SELECT value FROM {$_TABLES['spamx']} WHERE name = 'MTBlacklist'", 1);
$nrows = DB_numRows($result);
// named entities
$comment = html_entity_decode($comment);
// decimal notation
$comment = preg_replace('/&#(\\d+);/me', "chr(\\1)", $comment);
// hex notation
$comment = preg_replace('/&#x([a-f0-9]+);/mei', "chr(0x\\1)", $comment);
$ans = 0;
// Found Flag
for ($i = 1; $i <= $nrows; $i++) {
list($val) = DB_fetchArray($result);
if (@preg_match("#{$val}#i", $comment)) {
$ans = 1;
// quit on first positive match
SPAMX_log($LANG_SX00['fsc'] . $val . $LANG_SX00['fsc1'] . $uid . $LANG_SX00['fsc2'] . $_SERVER['REMOTE_ADDR']);
break;
}
}
return $ans;
}
示例5: execute
/**
* Here we do the work
*
* @param string $comment
* @return int
*/
public function execute($comment)
{
global $_TABLES, $_USER, $LANG_SX00, $LANG28;
$uid = COM_isAnonUser() ? 1 : $_USER['uid'];
// Get homepage URLs of all banned users
$result = DB_query("SELECT DISTINCT homepage FROM {$_TABLES['users']} WHERE status = 0 AND homepage IS NOT NULL AND homepage <> ''");
$numRows = DB_numRows($result);
// named entities
$comment = html_entity_decode($comment);
// decimal notation
$comment = preg_replace_callback('/&#(\\d+);/m', array($this, 'callbackDecimal'), $comment);
// hex notation
$comment = preg_replace_callback('/&#x([a-f0-9]+);/mi', array($this, 'callbackHex'), $comment);
$ans = 0;
for ($i = 0; $i < $numRows; $i++) {
list($val) = DB_fetchArray($result);
$val = str_replace('#', '\\#', $val);
if (preg_match("#{$val}#i", $comment)) {
$ans = 1;
// quit on first positive match
SPAMX_log($LANG_SX00['foundspam'] . $val . ' (' . $LANG28[42] . ')' . $LANG_SX00['foundspam2'] . $uid . $LANG_SX00['foundspam3'] . $_SERVER['REMOTE_ADDR']);
break;
}
}
$this->result = $ans;
return $ans;
}
示例6: execute
function execute($comment)
{
global $result, $_CONF, $_TABLES, $LANG_SX00;
$result = 128;
// update count of deleted spam posts
DB_change($_TABLES['vars'], 'value', 'value + 1', 'name', 'spamx.counter', '', true);
SPAMX_log($LANG_SX00['spamdeleted']);
return 1;
}
示例7: execute
/**
* Execute
*
* @param $comment
* @return int
*/
public function execute($comment)
{
global $_CONF, $_TABLES, $LANG_SX00;
$this->result = PLG_SPAM_ACTION_DELETE;
// update count of deleted spam posts
$sql['mysql'] = "UPDATE {$_TABLES['vars']} " . "SET value = value + 1 " . "WHERE name = 'spamx.counter' ";
$sql['pgsql'] = "UPDATE {$_TABLES['vars']} " . "SET value = CAST(value AS int) + 1 " . "WHERE name = 'spamx.counter' ";
DB_query($sql);
SPAMX_log($LANG_SX00['spamdeleted']);
return PLG_SPAM_FOUND;
}
示例8: execute
/**
* Execute
*
* @param string $comment
* @return int
*/
public function execute($comment)
{
global $result, $_CONF, $_TABLES, $LANG_SX00, $_USER;
$url = COM_getCurrentURL();
if (strpos($url, 'usersettings.php') !== false) {
$this->result = PLG_SPAM_ACTION_DELETE;
DB_change($_TABLES['users'], 'status', USER_ACCOUNT_DISABLED, 'uid', $_USER['uid']);
SPAMX_log("User {$_USER['username']} banned for profile spam.");
}
return 1;
}
示例9: TRB_logRejected
/**
* Helper function for the curious: Log rejected trackbacks
*
* @param string $logmsg Message to log
* @return void
*
*/
function TRB_logRejected($reason, $url = '')
{
global $_TRB_LOG_REJECTS;
if ($_TRB_LOG_REJECTS) {
$logmsg = 'Trackback from IP ' . $_SERVER['REMOTE_ADDR'] . ' rejected for ' . $reason . ', URL: ' . $url;
if (function_exists('SPAMX_log')) {
SPAMX_log($logmsg);
} else {
COM_errorLog($logmsg);
}
}
}
示例10: execute
/**
* Here we do the work
*
* @param string
* @return int
*/
public function execute($comment)
{
global $LANG_SX00;
$ans = PLG_SPAM_NOT_FOUND;
$uid = $this->getUid();
$slv = new SLVbase();
if ($slv->CheckForSpam($comment)) {
$ans = PLG_SPAM_FOUND;
SPAMX_log($LANG_SX00['foundspam'] . 'Spam Link Verification (SLV)' . $LANG_SX00['foundspam2'] . $uid . $LANG_SX00['foundspam3'] . $_SERVER['REMOTE_ADDR']);
}
// tell the Action module that we've already been triggered
$GLOBALS['slv_triggered'] = true;
return $ans;
}
示例11: CheckForSpam
/**
* Check for spam links
*
* @param string $post post to check for spam
* @return boolean true = spam found, false = no spam
* Note: Also returns 'false' in case of problems communicating with SLV.
* Error messages are logged in Geeklog's error.log
*/
public function CheckForSpam($post)
{
global $_SPX_CONF;
$retval = false;
if (empty($post)) {
return $retval;
}
$links = $this->prepareLinks($post);
if (empty($links)) {
return $retval;
}
if (!isset($_SPX_CONF['timeout'])) {
$_SPX_CONF['timeout'] = 5;
// seconds
}
if ($this->_verbose) {
SPAMX_log("Sending to SLV: {$links}");
}
$params = array(new XML_RPC_Value($links, 'string'));
$msg = new XML_RPC_Message('slv', $params);
$cli = new XML_RPC_Client('/slv.php', 'http://www.linksleeve.org');
if ($this->_debug) {
$cli->setDebug(1);
}
$resp = $cli->send($msg, $_SPX_CONF['timeout']);
if (!$resp) {
COM_errorLog('Error communicating with SLV: ' . $cli->getErrorString() . '; Message was ' . $msg->serialize());
} else {
if ($resp->faultCode()) {
COM_errorLog('Error communicating with SLV. Fault code: ' . $resp->faultCode() . ', Fault reason: ' . $resp->faultString() . '; Message was ' . $msg->serialize());
} else {
$val = $resp->value();
// note that SLV returns '1' for acceptable posts and '0' for spam
if ($val->scalarval() != '1') {
$retval = true;
SPAMX_log("SLV: spam detected");
} else {
if ($this->_verbose) {
SPAMX_log("SLV: no spam detected");
}
}
}
}
return $retval;
}
示例12: execute
/**
* Here we do the work
*/
function execute($comment)
{
global $_USER, $LANG_SX00;
$ans = 0;
if (isset($_USER['uid']) && $_USER['uid'] > 1) {
$uid = $_USER['uid'];
} else {
$uid = 1;
}
$slv = new SLVbase();
if ($slv->CheckForSpam($comment)) {
$ans = 1;
SPAMX_log($LANG_SX00['foundspam'] . 'Spam Link Verification (SLV)' . $LANG_SX00['foundspam2'] . $uid . $LANG_SX00['foundspam3'] . $_SERVER['REMOTE_ADDR']);
}
// tell the Action module that we've already been triggered
$GLOBALS['slv_triggered'] = true;
return $ans;
}
示例13: execute
/**
* Here we do the work
*/
function execute($comment)
{
global $_CONF, $_TABLES, $_USER, $LANG_SX00, $result;
if (isset($_USER['uid']) && $_USER['uid'] > 1) {
$uid = $_USER['uid'];
} else {
$uid = 1;
}
// get HTTP headers of the current request
if (function_exists('getallheaders')) {
$headers = getallheaders();
} else {
// if getallheaders() is not available, we have to fake it using
// the $_SERVER['HTTP_...'] values
$headers = array();
foreach ($_SERVER as $key => $content) {
if (substr($key, 0, 4) == 'HTTP') {
$name = str_replace('_', '-', substr($key, 5));
$headers[$name] = $content;
}
}
}
$result = DB_query("SELECT value FROM {$_TABLES['spamx']} WHERE name='HTTPHeader'", 1);
$nrows = DB_numRows($result);
$ans = 0;
for ($i = 0; $i < $nrows; $i++) {
list($entry) = DB_fetchArray($result);
$v = explode(':', $entry);
$name = trim($v[0]);
$value = trim($v[1]);
$value = str_replace('#', '\\#', $value);
foreach ($headers as $key => $content) {
if (strcasecmp($name, $key) == 0) {
if (preg_match("#{$value}#i", $content)) {
$ans = 1;
// quit on first positive match
SPAMX_log($LANG_SX00['foundspam'] . $entry . $LANG_SX00['foundspam2'] . $uid . $LANG_SX00['foundspam3'] . $_SERVER['REMOTE_ADDR']);
break;
}
}
}
}
return $ans;
}
示例14: execute
function execute($comment)
{
global $result, $_CONF, $_USER, $LANG_SX00, $_SPX_CONF;
if (isset($_USER['uid']) && $_USER['uid'] > 1) {
$uid = $_USER['uid'];
} else {
$uid = 1;
}
$uid .= '@' . $_SERVER['REMOTE_ADDR'];
$msg = sprintf($LANG_SX00['emailmsg'], $_CONF['site_name'], $uid, $comment);
// Add headers of the spam post to help track down the source.
// Function 'getallheaders' is not available when PHP is running as
// CGI. Print the HTTP_... headers from $_SERVER array instead then.
$msg .= "\n\n" . $LANG_SX00['headers'] . "\n";
if (function_exists('getallheaders')) {
$headers = getallheaders();
foreach ($headers as $key => $content) {
if (strcasecmp($key, 'Cookie') != 0) {
$msg .= $key . ': ' . $content . "\n";
}
}
} else {
foreach ($_SERVER as $key => $content) {
if (substr($key, 0, 4) == 'HTTP') {
if ($key != 'HTTP_COOKIE') {
$msg .= $key . ': ' . $content . "\n";
}
}
}
}
$subject = sprintf($LANG_SX00['emailsubject'], $_CONF['site_name']);
if (empty($_SPX_CONF['notification_email'])) {
$email_address = $_CONF['site_mail'];
} else {
$email_address = $_SPX_CONF['notification_email'];
}
$to = array();
$to = COM_formatEmailAddress('', $email_address);
COM_mail($to, $subject, $msg);
$result = 8;
SPAMX_log('Mail Sent to Admin');
return 0;
}
示例15: CheckForSpam
/**
* Check for spam links
*
* @param string $post post to check for spam
* @return boolean true = spam found, false = no spam
*
* Note: Also returns 'false' in case of problems communicating with SFS.
* Error messages are logged in glFusion's error.log
*
*/
function CheckForSpam($post)
{
global $_SPX_CONF, $REMOTE_ADDR;
$retval = false;
$ip = $REMOTE_ADDR;
if (empty($post) || $ip == '') {
return $retval;
}
$arguments = array();
$response = '';
$http = new http_class();
$http->timeout = 0;
$http->data_timeout = 0;
$http->debug = 0;
$http->html_debug = 0;
$http->user_agent = 'glFusion/' . GVERSION;
$url = "http://www.stopforumspam.com/api";
$requestArgs = '?f=serial&';
if ($ip != '') {
$requestArgs .= 'ip=' . $ip . '&';
}
$requestArgs .= 'cmd=display';
$url = $url . $requestArgs;
$error = $http->GetRequestArguments($url, $arguments);
$error = $http->Open($arguments);
$error = $http->SendRequest($arguments);
if ($error == "") {
$error = $http->ReadReplyBody($body, 1024);
if ($error == "" || strlen($body) > 0) {
$response = $response . $body;
$result = @unserialize($response);
if (!$result) {
return 0;
}
// invalid data, assume ok
if (isset($result['ip']) && $result['ip']['appears'] == 1 && $result['ip']['confidence'] > (double) 25) {
$retval = true;
SPAMX_log("SFS: spam detected");
}
}
}
return $retval;
}