<?php
/**
* File containing example 4(Ban cookie trick) use DefensiveAttack.
*
* @package DefensiveAttack
* @version 1.0.0
* @copyright Copyright (C)2006 TheLordOfWeb. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @filesource
*/
//Load class
//require("class.php4.DefensiveAttack.php");
require("class.php5.DefensiveAttack.php");
//Create object
$def_attack = new DefensiveAttack();
//Get option
$safe_option = (isset($_GET['op'])) ? intval($_GET['op']) : 0;
switch ($safe_option) {
//Check ban
case 1:
if ($def_attack->IsSetSmartCookieBan()) {
print "You are banned. <a href='example_4.php?op=2' >Delete ban</a>";
} else {
print "You are not banned. <a href='example_4.php' >Go for ban</a>";
}
break;
//Delete ban
case 2:
$def_attack->DelSmartCookieBan();
print "You are unbanned. <a href='example_4.php' >Go for ban</a>";
break;
//Set cookie ban
default:
$def_attack->SetSmartCookieBan();
print "You will be banned. <a href='example_4.php?op=1' >Check ban</a>";
break;
}
?>
|