fix: Removed redirect to the news page if no user is logged on

pull/1150/head
Iglocska 2016-05-20 01:20:45 +02:00
parent d02adf2085
commit eb788366c9
1 changed files with 1 additions and 1 deletions

View File

@ -282,7 +282,7 @@ class AppController extends Controller {
$newsread = $this->User->field('newsread', array('User.id' => $this->Auth->user('id')));
$this->loadModel('News');
$latest_news = $this->News->field('date_created', array(), 'date_created DESC');
if (!$this->_isRest() && ($this->params['controller'] != 'news' || $this->params['action'] != 'index') && $latest_news && $newsread < $latest_news) $this->redirect(array('controller' => 'news', 'action' => 'index', 'admin' => false));
if ($this->Session->check(AuthComponent::$sessionKey) && !$this->_isRest() && ($this->params['controller'] != 'news' || $this->params['action'] != 'index') && $latest_news && $newsread < $latest_news) $this->redirect(array('controller' => 'news', 'action' => 'index', 'admin' => false));
unset($base_dir);
// We don't want to run these role checks before the user is logged in, but we want them available for every view once the user is logged on