Ban by Username
1.0
this adds an option to ban users on your forum by their username in the ban members section of your admin center.
killa-b
http://www.killa-b.com
Sources/Admin.pl
fopen(FILE, "$vardir/ban_email.txt");
@emailban = ;
fclose(FILE);
fopen(FILE, "$vardir/ban_memname.txt");
@memnameban = ;
fclose(FILE);
$txt{'725'}
$txt{'725a'}
$FORM{'ban_email'} =~ tr/\r//d;
$FORM{'ban_email'} =~ s~\A[\s\n]+~~;
$FORM{'ban_email'} =~ s~[\s\n]+\Z~~;
$FORM{'ban_email'} =~ s~\n\s*\n~\n~g;
$FORM{'ban_memname'} =~ tr/\r//d;
$FORM{'ban_memname'} =~ s~\A[\s\n]+~~;
$FORM{'ban_memname'} =~ s~[\s\n]+\Z~~;
$FORM{'ban_memname'} =~ s~\n\s*\n~\n~g;
fopen(FILE, ">$vardir/ban_email.txt", 1);
print FILE "$FORM{'ban_email'}";
fclose(FILE);
fopen(FILE, ">$vardir/ban_memname.txt", 1);
print FILE "$FORM{'ban_memname'}";
fclose(FILE);
Sources/Security.pl
}
}
# EMAIL BANNING
if ($username ne 'Guest') {
$remote_ip = "$ENV{'REMOTE_ADDR'}";
fopen(BAN, "$vardir/ban_email.txt" );
@entries = ;
fclose(BAN);
foreach $ban_email (@entries) {
if (lc $ban_email eq lc $settings[2]) {
fopen(LOG, ">>$vardir/ban_log.txt" );
print LOG "$ban_email ($remote_ip)\n";
fclose(LOG);
$username = "Guest";
&fatal_error("$txt{'678'}$txt{'430'}!");
exit;
}
}
# USERNAME BANNING
if ($username ne 'Guest') {
$remote_ip = "$ENV{'REMOTE_ADDR'}";
fopen(BAN, "$vardir/ban_memname.txt" );
@entries = ;
fclose(BAN);
foreach $ban_memname (@entries) {
if (lc $ban_memname eq lc $settings[1]) {
fopen(LOG, ">>$vardir/ban_log.txt" );
print LOG "$ban_memname ($remote_ip)\n";
fclose(LOG);
$username = "Guest";
&fatal_error("$txt{'678'}$txt{'430'}!");
exit;
}
english.lng
$txt{'725'} = "Email banning: (e.g. badguy\@somewhere.com) - one entry per line";
$txt{'725a'} = "Username banning: (e.g. super_dude13) - one entry per line";