1. Ban Group doesn't work properly with characters of non-latin alphabets (tested with Russian). To fix it sub BanUser2 in Admin2.pl should be started as shown below:
|
Code
sub BanUser2 {
$URL{'g'} =~ s/%(..)/pack("C", hex($1))/eg; |
|
2. User can be banned by "IP Address, Username or E-Mail" but it works with IP and E-Mail only. That is because sub Ban in Load.pl checks if $banstring eq $username where $username is actually user id, not screen name that placed in BanList.txt. So $username there should be replaced with $memberid{$username}{'sn'}.
|
Code
sub Ban {
...
if($ipsearch =~ /\Q$banstring/i || $banstring eq $memberid{$username}{'sn'} || $banstring eq $memberid{$username}{'email'}) { CoreLoad('BoardLock'); Banned($banlimit,$bantime); }
...
} |
|
3. The problem - administrator can ban his own IP address. Seems like I have to say "good bye my board" if I have no FTP access. I don't think that my solution is good at all, but it is the only way I've found for now - it is to give administarator to log in anyway. Additional sub ShowEmergencyLoginForm in Routines.pl:
|
Code
sub ShowEmergencyLoginForm {
$ebout .= qq~<br />
<table cellpadding="4" cellspacing="1" class="border" width="350">
<tr> <td class="titlebg smalltext"><strong>$rtxt[35]</strong></td>
</tr><tr>
<td class="win">
<form action="$surl\lv-login/p-2/" method="post">
<table cellpadding="2" cellspacing="0" width="100%">
<tr>
<td class="smalltext"><strong>$rtxt[36]:</strong></td>
<td colspan="2"><input type="text" name="username" size="20" tabindex="56" /></td>
<td> </td>
</tr><tr>
<td class="smalltext"><strong>$rtxt[37]:</strong></td>
<td><input type="password" name="password" size="20" tabindex="57" /></td>
<td> <input type="hidden" name="days" value="forever" />
<input type="hidden" name="emergency" value="yes" />
<input type="hidden" name="redirect" value="$ENV{'QUERY_STRING'}" /><input type="submit" value=" $rtxt[38] " tabindex="58" /></td>
<td> </td>
</tr>
</table>
</form>
</td>
</tr>
</table><br />
~;
} |
|
sub error in Routines.pl ends with:
|
Code
...
</table>
~;
ShowEmergencyLoginForm();
if($adminsloaded) { footerA(); } else { footer(); }
exit;
} |
|
sub Ban in Load.pl
|
Code
sub Ban {
if(!$members{'Administrator',$username} && $FORM{'emergency'} ne "yes") {
fopen(BANL,"$prefs/BanList.txt");
while(<BANL>) {
chomp $_;
($banstring,$banlimit,$bantime) = split(/\|/,$_);
$length = length($banstring);
$ipsearch = substr($ENV{'REMOTE_ADDR'},0,$length);
if($ipsearch =~ /\Q$banstring/i || $banstring eq $memberid{$username}{'sn'} || $banstring eq $memberid{$username}{'email'}) { CoreLoad('BoardLock'); Banned($banlimit,$bantime); }
}
fclose(BANL);
}
} |
|
That is all for now. Sorry if the bugs listed above are not the bugs at all but just my seek imagination. |