Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit df6d12d

Browse files
author
Charles Marion
committed
BUG: fixed recent items check
1 parent 2ec0a23 commit df6d12d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

core/AppController.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,16 @@ public function preDispatch()
110110
}
111111
$this->logged = true;
112112
$this->view->logged = true;
113-
$user->Dao->lastAction = date('c');
113+
114114
$this->view->userDao = $user->Dao;
115115
$cookieData = $this->getRequest()->getCookie('recentItems'.$this->userSession->Dao->user_id);
116116
$this->view->recentItems = array();
117117
if(isset($cookieData))
118118
{
119119
$this->view->recentItems = unserialize($cookieData);
120120
$check = $this->_getParam('checkRecentItem');
121-
// check if recent items exit (every 10 minutes)
122-
if(isset($check) || strtotime($user->Dao->lastAction) < strtotime("-1 minute"))
121+
// check if recent items exit (every 2 minutes)
122+
if(isset($check) || !isset($user->Dao->lastAction) || strtotime($user->Dao->lastAction) < strtotime("-2 minute"))
123123
{
124124
$modelLoad = new MIDAS_ModelLoader();
125125
$itemModel = $modelLoad->loadModel('Item');
@@ -139,6 +139,7 @@ public function preDispatch()
139139
setcookie('recentItems'.$this->userSession->Dao->getKey(), serialize($this->view->recentItems), time() + 60 * 60 * 24 * 30, '/'); //30 days
140140
}
141141
}
142+
$user->Dao->lastAction = date('c');
142143
}
143144
else
144145
{

core/controllers/InstallController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ function step3Action()
265265
$applicationConfig['global']['processing'] = $form->getValue('process');
266266

267267
$this->Component->Utility->createInitFile(BASE_PATH.'/core/configs/application.local.ini', $applicationConfig);
268-
$this->_redirect("/admin#tabs-modules");
268+
$this->_redirect("/admin?checkRecentItem=true#tabs-modules");
269269
}
270270
} // end method step2Action
271271

0 commit comments

Comments
 (0)