Skip to content

Commit c44af1f

Browse files
committed
not logging blocked ips requests
1 parent d1dd304 commit c44af1f

File tree

14 files changed

+29
-26
lines changed

14 files changed

+29
-26
lines changed

app/App.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,12 @@ public function bootstrap()
184184
switch ($routeInfo->getStatus()) {
185185
case Dispatcher::NOT_FOUND:
186186
// ... 404 Not Found
187-
$this->getUtils()->errorPage(404)->send();
187+
$this->getUtils()->errorPage(404, $request)->send();
188188
break;
189189
case Dispatcher::METHOD_NOT_ALLOWED:
190190
$allowedMethods = $this->getRouteInfo()->getAllowedMethods();
191191
// ... 405 Method Not Allowed
192-
$this->getUtils()->errorPage(405, ['allowedMethods' => $allowedMethods])->send();
192+
$this->getUtils()->errorPage(405, $request, ['allowedMethods' => $allowedMethods])->send();
193193
break;
194194
case Dispatcher::FOUND:
195195
$handler = $this->getRouteInfo()->getHandler();
@@ -222,11 +222,11 @@ public function bootstrap()
222222
break;
223223
}
224224
} catch (OfflineException $e) {
225-
$response = $this->getUtils()->offlinePage();
225+
$response = $this->getUtils()->offlinePage($request);
226226
} catch (BlockedIpException $e) {
227227
$response = $this->getUtils()->blockedIpPage($request);
228228
} catch (Exception $e) {
229-
$response = $this->getUtils()->exceptionPage($e);
229+
$response = $this->getUtils()->exceptionPage($e, $request);
230230
}
231231

232232
// dispatch "before_send" event
@@ -257,7 +257,7 @@ protected function isSiteOffline()
257257
*
258258
* @return boolean
259259
*/
260-
protected function isBlocked($ip_address)
260+
public function isBlocked($ip_address)
261261
{
262262
return in_array($ip_address, $this->blocked_ips);
263263
}

app/base/abstracts/Controllers/AdminFormPage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected function getFormId()
5959
private function processFormSubmit()
6060
{
6161
if (!$this->checkCredentials()) {
62-
$this->templateData['form']->setSubmitResults(get_class($this).'::formSubmitted', $this->getUtils()->errorPage(403));
62+
$this->templateData['form']->setSubmitResults(get_class($this).'::formSubmitted', $this->getUtils()->errorPage(403, $this->getRequest()));
6363
} else {
6464
$this->getApp()->event('before_form_process', ['form' => $this->templateData['form']]);
6565
$this->templateData['form']->process();

app/base/abstracts/Controllers/AdminJsonPage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ abstract class AdminJsonPage extends BaseJsonPage
2828
protected function beforeRender()
2929
{
3030
if (!$this->checkCredentials() || !$this->checkPermission($this->getAccessPermission())) {
31-
return $this->getUtils()->errorPage(403);
31+
return $this->getUtils()->errorPage(403, $this->getRequest());
3232
}
3333

3434
return parent::beforeRender();

app/base/abstracts/Controllers/AdminPage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static function getRouteVerbs()
7474
protected function beforeRender()
7575
{
7676
if (!$this->checkCredentials() || !$this->checkPermission($this->getAccessPermission())) {
77-
return $this->getUtils()->errorPage(403);
77+
return $this->getUtils()->errorPage(403, $this->getRequest());
7878
}
7979

8080
return parent::beforeRender();

app/base/abstracts/Controllers/AdminRestPage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ abstract class AdminRestPage extends BaseRestPage
3737
protected function beforeRender()
3838
{
3939
if (!$this->checkCredentials() || !$this->checkPermission($this->getAccessPermission())) {
40-
return $this->getUtils()->errorPage(403);
40+
return $this->getUtils()->errorPage(403, $this->getRequest());
4141
}
4242

4343
return parent::beforeRender();

app/base/abstracts/Controllers/BaseHtmlPage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function process(RouteInfo $route_info = null, $route_data = [])
103103
->prepare($this->getRequest())
104104
->setContent($template_html);
105105
} catch (Exception $e) {
106-
return $this->getUtils()->exceptionPage($e);
106+
return $this->getUtils()->exceptionPage($e, $this->getRequest());
107107
}
108108
}
109109

app/base/abstracts/Controllers/BasePage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ protected function beforeRender()
151151
if (method_exists($this, 'getAccessPermission') && method_exists($this, 'getCurrentUser')) {
152152
try {
153153
if (!$this->checkPermission($this->getAccessPermission())) {
154-
return $this->getUtils()->errorPage(403);
154+
return $this->getUtils()->errorPage(403, $this->getRequest());
155155
}
156156
} catch (\Exception $e) {
157157
$this->getUtils()->logException($e);

app/base/abstracts/Controllers/BaseRestPage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected function beforeRender()
6161
if ($this->getRequest()->headers->get('Content-Type') != 'application/json' &&
6262
$this->getRequest()->getContentType() != 'json'
6363
) {
64-
return $this->getUtils()->errorPage(403);
64+
return $this->getUtils()->errorPage(403, $this->getRequest());
6565
}
6666

6767
return $this;

app/base/abstracts/Controllers/FrontendPage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ protected function prepareTemplate()
168168
protected function beforeRender()
169169
{
170170
if (!$this->getRouteInfo()->isAdminRoute() && !$this->checkPermission('view_site')) {
171-
return $this->getUtils()->errorPage(403);
171+
return $this->getUtils()->errorPage(403, $this->getRequest());
172172
}
173173

174174
return parent::beforeRender();

app/base/abstracts/Controllers/FrontendPageWithObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function process(RouteInfo $route_info = null, $route_data = [])
4545
is_a($this->getObject(), $this->getObjectClass()) &&
4646
$this->getObject()->isLoaded())
4747
) {
48-
return $this->getUtils()->errorPage(404);
48+
return $this->getUtils()->errorPage(404, $this->getRequest());
4949
}
5050

5151
return $return;

0 commit comments

Comments
 (0)