Skip to content

Commit 0ba1d1d

Browse files
committed
[skip ci][auth] useAjax usage in AuthController constructor
1 parent 06811b3 commit 0ba1d1d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Ubiquity/controllers/auth/AuthController.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,15 @@ public function __construct($instance = null) {
4646
$this->_controller = Startup::getController ();
4747
$this->_action = Startup::getAction ();
4848
$this->_actionParams = Startup::getActionParams ();
49-
$this->_noAccessMsg = new FlashMessage ( 'You are not authorized to access the page <b>{url}</b> !', "Forbidden access", 'error', 'warning circle' );
49+
$this->_noAccessMsg = new FlashMessage ( 'You are not authorized to access the page <b>{url}</b> !', 'Forbidden access', 'error', 'warning circle' );
5050
$this->_loginCaption = 'Log in';
5151
$this->_controllerInstance = $instance;
52-
if (isset ( $instance ))
52+
if (isset ( $instance )){
5353
Startup::injectDependences ( $instance );
54+
}
55+
if($this->useAjax() && !URequest::isAjax()) {
56+
$this->_addAjaxBehavior($instance->jquery??$this->jquery);
57+
}
5458
}
5559

5660
public function index() {

0 commit comments

Comments
 (0)