My Cake Php project is redirecting to the wrong url after I did the full implementation of ACL by following this tutorial -> http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-controlled-application/simple-acl-controlled-application.html.
Problem -
Correct redirect -> localhost/appname/
Redirect after I implemented ACL -> localhost/appname/appname/
This is the redirect that occurs after login. The public pages (Login) work fine.
Below is Appcontroller code-
public $components = array( 'Acl',
'Auth' => array(
'authorize' => array(
'Actions' => array('actionPath' => 'controllers')
)
),
'Session'
);
public $helpers = array('Html', 'Form', 'Session');
// only allow the login controllers only
public function beforeFilter() {
parent::beforeFilter();
$this->Auth->allow('login');
}
Acos table screenshot
Aros table screenshot
Aros_Acos table screenshot
groups table
Routes.php
Router::connect('/dashboard', array('controller' => 'dashboards', 'action' => 'index'));
Router::connect('/login', array('controller' => 'users', 'action' => 'login'));
Router::connect('/logout', array('controller' => 'users', 'action' => 'logout'));
Router::connect('/', array('controller' => 'dashboards', 'action' => 'index'));
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
CakePlugin::routes();
require CAKE . 'Config' . DS . 'routes.php';
The right url was opening when I used only "Auth" instead of the following.
'Auth' => array(
'authorize' => array(
'Actions' => array('actionPath' => 'controllers')
)
),
BUT, then the ACL is not working.