$this->loadComponent('RequestHandler');
-
-
-
-
$this->loadComponent('Flash');
-// $this->loadComponent('Auth', [
-// 'authenticate' => [
-// 'Form' => [
-// 'fields' => [
-// 'username' => 'username',
-// 'password' => 'password'
-// ]
-// ]
-// ],
-// 'loginAction' => [
-// 'controller' => 'Users',
-// 'action' => 'login'
-// ],
-// 'loginRedirect' => [
-// 'controller' => 'Softwares',
-// 'action' => 'index'
-// ],
-// 'logoutRedirect' => [
-// 'controller' => 'Pages',
-// 'action' => 'display',
-// 'home'
-// ]
-// ]);
-//
-// //Autorise l'action display pour que notre controller de pages
-// // continue de fonctionner.
-// $this->Auth->allow(['display']);
-
+
+ $this->loadComponent('Auth', [
+ 'authenticate' => [
+ 'Form' => [
+ 'fields' => ['username' => 'username', 'password' => 'password']
+ ]
+ ]
+ ,'logoutRedirect' => [
+ 'controller' => 'Pages',
+ 'action' => 'display',
+ 'home'
+ ]
+ ]);
}
public function isAuthorized($user)
}
// Par défaut refuser
- return false;
+ return true;
}
* @param Event $event
*/
public function beforeFilter(Event $event) {
+ $this->Auth->allow(['add', 'logout']);
parent::beforeFilter($event);
}