06-Jun-2011, 05:48 PM
Ok that's strange because the script only uses two methods to check if you are banned:
The function which does this is cmtx_check_if_banned(), in comments/includes/functions/processor.php, line 1164.
- It checks to see if your IP Address matches with any of the bans in the database table 'banned'.
- It checks to see if you have a browser cookie called 'Commentics-Ban'.
The function which does this is cmtx_check_if_banned(), in comments/includes/functions/processor.php, line 1164.
PHP Code:
<?php
function cmtx_check_if_banned() { //check if user is banned
global $mysql_table_prefix, $ip_address; //globalise variables
$ban_found = false; //initialise flag as false
if (mysql_num_rows(mysql_query("SELECT * FROM `".$mysql_table_prefix."banned` WHERE ip_address = '$ip_address'"))) { //if user's IP address is found in 'banned' database table
$ban_found = true; //set flag as true
}
if (isset($_COOKIE['Commentics-Ban']) && $_COOKIE['Commentics-Ban'] == "Banned") { //if a banning-cookie is found
$ban_found = true; //set flag as true
}
if ($ban_found) { //if a ban was found
die(CMTX_BAN_MESSAGE_BANNED_PREVIOUSLY); //end scripting and output message to user explaining they were previously banned
}
} //end of check-if-banned function
What you could do is replace it with this so that you can determine which method is detecting the ban:
PHP Code:
<?php
function cmtx_check_if_banned() { //check if user is banned
global $mysql_table_prefix, $ip_address; //globalise variables
$ban_found = false; //initialise flag as false
if (mysql_num_rows(mysql_query("SELECT * FROM `".$mysql_table_prefix."banned` WHERE ip_address = '$ip_address'"))) { //if user's IP address is found in 'banned' database table
$ban_found = true; //set flag as true
echo "<b>IP Address found.</b>";
}
if (isset($_COOKIE['Commentics-Ban']) && $_COOKIE['Commentics-Ban'] == "Banned") { //if a banning-cookie is found
$ban_found = true; //set flag as true
echo "<b>Cookie found.</b>";
}
if ($ban_found) { //if a ban was found
die(CMTX_BAN_MESSAGE_BANNED_PREVIOUSLY); //end scripting and output message to user explaining they were previously banned
}
} //end of check-if-banned function