Размер файла: 1.37Kb
<?php
include("include/head.php");
$folder = "address";
$users = @opendir($folder) or die("Error - $folder");
while ($user_ban = readdir($users)) {
if($user_ban == "." || $user_ban == ".." || $user_ban == ".htaccess")
continue;
if (!is_file($user_ban))
{
$user_ban = str_replace(".class","",$user_ban);
echo '<u>Baned IP address</u><br><br>';
echo "<form action=\"ban.php?deleteban=$user_ban\" method=\"post\">
IP($user_ban)<br/><input name=\"AdminPass\" type=\"text\" value=\"Admin paroli\"><br/>
<input type=\"submit\" value=\"Delete\" /></form>------------<br/>";
}
}
closedir($users);
if($AdminPass=="$Admin")
{
if(file_exists("address/$deleteban.class"))
{
unlink("address/$deleteban.class");
echo 'Baned IP deleted from ban list! (<a href="ban.php">Refresh</a>)<br/>';
}
else
{
echo 'This IP is not baned! (<a href="ban.php">Refresh</a>)<br/>';
}
}
echo '<br/><form action="ban.php?"><u>Browser\'s IP\'s ban</u><br/><br/>
IP address:<br /><input name="userban" maxlength=\'25\' type="text" /><br>
Admin Pass:<br /><input type=\'text\' name=\'Password\'><br/>
<input type="submit" value="Userban" /></form>';
if($Password=="$Admin")
{
$MyText = "$userban";
$fp = fopen("address/$userban.class", "w");
fputs ($fp,"$MyText");
fclose ($fp);
echo 'User\s IP successfully baned! (<a href="ban.php">Refresh</a>)';
}
include("include/foot.php");
?>