Désolé, je n'ai pas de facebook.
Par contre je peux installer teanviwewer sans pb.
voici mon appcontroller
y'a pas mal de commentaires car j'ai essayé différentes configuration.
public $helpers = array(
'Html'
,'Text'
,'Form'
,'Session'
,'Cache'
,'Js'
//,'Media.Media'
//,'Bs3Helpers.Bs3Form' //https://github.com/Codaxis/cakephp-bootstrap3-helpers
//,'TinyMCE.TinyMCE'
);
public $components = array(
'Session'
,'Cookie'
,'Auth' => array(
'loginRedirect' => array(
'controller' => 'posts',
'action' => 'index'
),
'logoutRedirect' => array(
'controller' => 'Users',
'action' => 'login', 'index'
),
'authenticate' => array(
'Form' => array(
//'fields' => array('username'=>'username','password'=>'username'),
'scope' => array('User.active' =>1)
)
)
)
);
public function beforeFilter() {
//debug($this->request);
//$this->Auth->loginAction = array('controller'=>'users','action'=>'login','admin'=>false);
$this->Auth->authorize = array('Controller');
$this->Auth->allow('index', 'show');
//$this->Auth->allow();
if(!isset($this->request->params'prefix'])){
$this->Auth->allow('index', 'show', 'edit');
}
if(isset($this->request->params'prefix']) && $this->request->params'prefix'] == 'admin'){
$this->Auth->allow();
$this->layout = 'admin';
}
// AuthComponent de ne pas exiger un login pour toutes les actions
// }
//debug($this->request);
// Controller autorization is the simplest form.
$this->Auth->authorize = 'controller';
}
public function isAuthorized($user) {
/* $roles = array(
'admin' => 15,
'bureau' => 10,
'user' => 5
);
if(isset($roles$this->request->params'prefix']])){
$lvlAction = $roles$this->request->params'prefix']];
$lvlUser = $roles$user'role']];
if($lvlUser >= $lvlAction){
return true;
}else{
return false;
}
}
return false;
*/ return true;
}