*/
public function isAuthorized($user)
{
+ if ($this->Auth->identify()){
+ return true ;
+ }
+
+
//If user is auth
if ($this->request->param('action') === 'register'){
- $user = $this->Auth->user();
if ($user){
return true;
}
}
-
-
return parent::isAuthorized($user);
}
public function initialize(){
parent::initialize();
-
- $this->paginate = [
- 'limit' => Configure::read('LIMIT'),
- 'order' => [
- 'Users.username' => Configure::read('ORDER'),
- ],
- 'contain' => ['UserTypes']
- ];
+ $this->paginate = [
+ 'limit' => Configure::read('LIMIT'),
+ 'order' => [
+ 'Users.username' => Configure::read('ORDER'),
+ ],
+ 'contain' => ['UserTypes']
+ ];
}
/**