user must accept terms.
pull/63/head
noud 2012-11-14 10:52:53 +01:00
parent b99d568433
commit 3a84ffb59f
1 changed files with 6 additions and 0 deletions

View File

@ -61,6 +61,12 @@ class AppController extends Controller {
}
public function beforeFilter() {
// user must accept terms
if (!$this->Auth->user('termsaccepted') && ($this->request->here != '/users/terms') && ($this->request->here != '/users/logout') && ($this->request->here != '/users/login')) {
$this->redirect(array('controller' => 'users', 'action' => 'terms'));
}
// REST things
if ($this->_isRest()) {
// disable CSRF for REST access