function CUSTOM_MOBILE_debug($msg) { global $CUSTOM_MOBILE_CONF; if ($CUSTOM_MOBILE_CONF['debug']) { COM_ErrorLog($msg, 1); } }
function bb2_ban($ip, $type = 1, $reason = '') { global $_CONF, $LANG_BAD_BEHAVIOR; if ($type != 0 && (!isset($_CONF['bb2_ban_enabled']) || $_CONF['bb2_ban_enabled'] != 1)) { return; } switch ($type) { case 0: COM_errorLog("Banning " . $ip . " " . $LANG_BAD_BEHAVIOR['manually_added']); break; case 2: COM_errorLog("Banning " . $ip . " " . $LANG_BAD_BEHAVIOR['automatic_captcha']); break; case 3: COM_ErrorLog("Banning " . $ip . " " . $LANG_BAD_BEHAVIOR['automatic_token']); break; default: COM_errorLog("Banning " . $ip . " for type " . $type); break; } $settings = bb2_read_settings(); $timestamp = time(); $sql = "INSERT INTO {$settings['ban_table']}\n (ip,type,reason,timestamp) VALUE (INET_ATON('" . DB_escapeString($ip) . "')," . $type . ",'" . DB_escapeString($reason) . "', " . $timestamp . ")"; DB_query($sql, 1); if ($type != 0) { echo COM_refresh($_CONF['site_url']); } return true; }