hi tedsmith.
Thank you for suggestion.
I've just applied it.
Thanks GIJOE - I came here looking for the answer to that question too. It would definately be a good idea to just have a single line of text saying something like "Seperate each IP address with a '|' deliminator". I am using Version 2.4 - maybe you have already applied it to 2.52?
Thanks
Ted
hi karedokx.
I'm sorry that I misunderstood your question.
As Dave wrote, the delimiter is | .
It is same as the preferences of the xoops core.
The delimiter must be "|".
Here's the code that parses that field, from modules/protector/admin/index.php:
$criteria = new CriteriaCompo(new Criteria('conf_modid', 0));
$criteria->add(new Criteria('conf_name', 'bad_ips'));
list( $config ) = $config_handler->getConfigs( $criteria );
$config->setVar( 'conf_value' , serialize( explode( '|' , trim( $_POST['bad_ips'] ) ) ) ) ;
$config_handler->insertConfig( $config ) ;
i'm really sorry gijoe, if i didn't make myself clear. language limitiation
my question is actually the similar question raise by macelee. should it be something like xxx|xxx| and so on? can i just us xxx (space) xxx or xxx,xxx, and so on.
what i mean with more descriptive is to put a description/note on the admin screen, what should we use as the delimiter.
sorry once again for not making myself clear.
I am still not clear what delimiter to use to separate bad IPs.
Should it be something like xxx.xxx.xxx.xxx|xxx.xxx.xxx.xxx?
An example with multiple IPs in the admin will definitely help beginners like me. Thanks
hi karedokx
Quote:
what kind of delimiters can we use for the banned ip list? only "|"?
gijoe, it will be more descriptive for new users too i think if we can put these delimiters in the protector admin screen.
Which interfaces do you think good ?
Without delimiter, many textbox can be used.
Or you mean the other delimiter like ',' ?
Anyway, the banned IP is a pattern for preg_match().
Thus, it is important to select the delimiter properly.
You can find the code like this in include/common.php or class/xoopssecurity.php.
foreach ($xoopsConfig['bad_ips'] as $bi) {
if (!empty($bi) && preg_match("/".$bi."/", $_SERVER['REMOTE_ADDR'])) {
exit();
}
}