fix: Don't require users to accept the terms and conditions if they are not set, fixes #1381

pull/1382/head
Iglocska 2016-07-22 11:16:00 +02:00
parent 42584de8c2
commit 4c186337e4
1 changed files with 1 additions and 1 deletions

View File

@ -278,7 +278,7 @@ class AppController extends Controller {
}
if ($this->Session->check(AuthComponent::$sessionKey)) {
if (!$this->Auth->user('termsaccepted') && (!in_array($this->request->here, array($base_dir.'/users/terms', $base_dir.'/users/logout', $base_dir.'/users/login')))) {
if (!empty(Configure::read('MISP.terms_file')) && !$this->Auth->user('termsaccepted') && (!in_array($this->request->here, array($base_dir.'/users/terms', $base_dir.'/users/logout', $base_dir.'/users/login')))) {
if ($this->_isRest()) throw new MethodNotAllowedException('You have not accepted the terms of use yet, please log in via the web interface and accept them.');
$this->redirect(array('controller' => 'users', 'action' => 'terms', 'admin' => false));
} else if ($this->Auth->user('change_pw') && (!in_array($this->request->here, array($base_dir.'/users/terms', $base_dir.'/users/change_pw', $base_dir.'/users/logout', $base_dir.'/users/login')))) {