Index: branches/RC/core/units/users/users_event_handler.php =================================================================== diff -u -N -r10941 -r10955 --- branches/RC/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 10941) +++ branches/RC/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 10955) @@ -1662,21 +1662,30 @@ */ function checkBanRules(&$object) { - $sql = 'SELECT * FROM '.TABLE_PREFIX.'BanRules WHERE ItemType=6 AND Status=1 ORDER BY Priority DESC'; + $table = $this->Application->getUnitOption('ban-rule', 'TableName'); + if (!$this->Conn->TableFound($table)) { + return 1; + } + $sql = 'SELECT * + FROM '.$table.' + WHERE + ItemType=6 + AND Status=1 + ORDER BY Priority DESC'; $a_rules = $this->Conn->Query($sql); $found = FALSE; foreach($a_rules as $a_rule) { $field = $a_rule['ItemField']; if(isset($object->Fields[$field])) { - $ThisValue = strtolower($object->GetDBField($field)); - $TestValue = strtolower($a_rule['ItemValue']); + $this_value = strtolower($object->GetDBField($field)); + $test_value = strtolower($a_rule['ItemValue']); switch($a_rule['ItemVerb']) { // case 0: /* any */ // $found = TRUE; // break; case 1: /* is */ - if ($ThisValue==$TestValue) { + if ($this_value == $test_value) { $found = TRUE; } break; @@ -1685,7 +1694,7 @@ // $found = TRUE; // break; case 3: /* contains */ - if(strstr($ThisValue,$TestValue)) { + if(strstr($this_value, $test_value)) { $found = TRUE; } break;