1 | <?php |
||
54 | class BadRequest extends ActiveRecord |
||
55 | { |
||
56 | /** |
||
57 | * The HTTP user-agent client string. |
||
58 | * |
||
59 | * @var \Alpha\Model\Type\Text |
||
60 | * |
||
61 | * @since 1.0 |
||
62 | */ |
||
63 | protected $client; |
||
64 | |||
65 | /** |
||
66 | * The IP of the client. |
||
67 | * |
||
68 | * @var \Alpha\Model\Type\SmallText |
||
69 | * |
||
70 | * @since 1.0 |
||
71 | */ |
||
72 | protected $IP; |
||
73 | |||
74 | /** |
||
75 | * The resource that the client requested. |
||
76 | * |
||
77 | * @var \Alpha\Model\Type\SmallText |
||
78 | * |
||
79 | * @since 1.0 |
||
80 | */ |
||
81 | protected $requestedResource; |
||
82 | |||
83 | /** |
||
84 | * An array of data display labels for the class properties. |
||
85 | * |
||
86 | * @var array |
||
87 | * |
||
88 | * @since 1.0 |
||
89 | */ |
||
90 | protected $dataLabels = array('ID' => 'Bad request ID#', 'client' => 'Client string', 'IP' => 'IP', 'requestedResource' => 'Requested resource'); |
||
91 | |||
92 | /** |
||
93 | * The name of the database table for the class. |
||
94 | * |
||
95 | * @var string |
||
96 | * |
||
97 | * @since 1.0 |
||
98 | */ |
||
99 | const TABLE_NAME = 'BadRequest'; |
||
100 | |||
101 | /** |
||
102 | * Trace logger. |
||
103 | * |
||
104 | * @var \Alpha\Util\Logging\Logger |
||
105 | * |
||
106 | * @since 1.0 |
||
107 | */ |
||
108 | private static $logger = null; |
||
|
|||
109 | |||
110 | /** |
||
111 | * Constructor for the class. |
||
112 | * |
||
113 | * @since 1.0 |
||
114 | */ |
||
115 | public function __construct() |
||
129 | |||
130 | /** |
||
131 | * Gets the count of bad requests for the client with this IP and client string in the past |
||
132 | * configurable period (security.client.temp.blacklist.filter.period). |
||
133 | * |
||
134 | * @return int |
||
135 | * |
||
136 | * @since 1.0 |
||
137 | * |
||
138 | * @throws \Alpha\Exception\AlphaException |
||
139 | */ |
||
140 | public function getBadRequestCount() |
||
165 | } |
||
166 |