Skip to content

Commit

Permalink
Fixed issue #6808: Inconsistent access to information from the token …
Browse files Browse the repository at this point in the history
…table

Fixed issue: Testing from token table does not force a new session
  • Loading branch information
c-schmitz committed Nov 6, 2012
1 parent aca8481 commit d2b48ab
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions application/controllers/admin/tokens.php
Expand Up @@ -380,6 +380,7 @@ function getTokens_json($iSurveyId)
{
self::_newtokentable($iSurveyId);
}
$clang = $this->getController()->lang;
$page = Yii::app()->request->getPost('page');
$sidx = Yii::app()->request->getPost('sidx');
$sidx = !empty($sidx) ? $sidx : "lastname";
Expand All @@ -399,11 +400,24 @@ function getTokens_json($iSurveyId)
}
$aData->total = ceil($aData->records / $limit);

Yii::app()->loadHelper("surveytranslator");

$format = getDateFormatData(Yii::app()->session['dateformat']);

for ($i = 0, $j = 0; $i < $limit && $j < $limit; $i++, $j++)
{
$token = $tokens[$j];
if ((int) $token['validfrom'])
$token['validfrom'] = date($format['phpdate'] . ' H:i', strtotime(trim($token['validfrom'])));
else
$token['validfrom'] = '';
if ((int) $token['validuntil'])
$token['validuntil'] = date($format['phpdate'] . ' H:i', strtotime(trim($token['validuntil'])));
else
$token['validuntil'] = '';

$aData->rows[$i]['id'] = $token['tid'];
$prow = Survey::model()->findByPk($iSurveyId)->getAttributes(); //Get survey settings

$action = $this->_tokenToActionRow($token, $iSurveyId);
$aData->rows[$i]['cell'] = array($token['tid'], $action, $token['firstname'], $token['lastname'], $token['email'], $token['emailstatus'], $token['token'], $token['language'], $token['sent'], $token['remindersent'], $token['remindercount'], $token['completed'], $token['usesleft'], $token['validfrom'], $token['validuntil']);
Expand Down
2 changes: 2 additions & 0 deletions application/helpers/frontend_helper.php
Expand Up @@ -2578,6 +2578,8 @@ function killSurveySession($iSurveyID)
{
// Unset the session
unset($_SESSION['survey_'.$iSurveyID]);
// Force EM to refresh
LimeExpressionManager::SetDirtyFlag();
}


Expand Down

0 comments on commit d2b48ab

Please sign in to comment.