Skip to content

Commit

Permalink
Fixed issue #17889: Setting to correct server time not taken into acc…
Browse files Browse the repository at this point in the history
…ount when sending email invitations (#2356)

Co-authored-by: encuestabizdevgit <devgit@encuesta.biz>
  • Loading branch information
gabrieljenik and encuestabizdevgit committed May 4, 2022
1 parent a5bcb4c commit d1983da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions application/controllers/admin/tokens.php
Expand Up @@ -1425,10 +1425,11 @@ public function email($iSurveyId)
$modsubject = Replacefields($modsubject, $fieldsarray);
$modmessage = Replacefields($modmessage, $fieldsarray);

if (!App()->request->getPost('bypassdatecontrol') == '1' && trim($emrow['validfrom']) != '' && convertDateTimeFormat($emrow['validfrom'], 'Y-m-d H:i:s', 'U') * 1 > date('U') * 1) {
$now = dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i", Yii::app()->getConfig('timeadjust'));
if (!App()->request->getPost('bypassdatecontrol') == '1' && trim($emrow['validfrom']) != '' && strtotime($emrow['validfrom']) > strtotime($now)) {
$tokenoutput .= $emrow['tid'] . " " . htmlspecialchars(ReplaceFields(gT("Email to {FIRSTNAME} {LASTNAME} ({EMAIL}) delayed: Token is not yet valid.", 'unescaped'), $fieldsarray)) . "<br />";
$bInvalidDate = true;
} elseif (!App()->request->getPost('bypassdatecontrol') == '1' && trim($emrow['validuntil']) != '' && convertDateTimeFormat($emrow['validuntil'], 'Y-m-d H:i:s', 'U') * 1 < date('U') * 1) {
} elseif (!App()->request->getPost('bypassdatecontrol') == '1' && trim($emrow['validuntil']) != '' && strtotime($emrow['validuntil']) < strtotime($now)) {
$tokenoutput .= $emrow['tid'] . " " . htmlspecialchars(ReplaceFields(gT("Email to {FIRSTNAME} {LASTNAME} ({EMAIL}) skipped: Token is not valid anymore.", 'unescaped'), $fieldsarray)) . "<br />";
$bInvalidDate = true;
} else {
Expand Down

0 comments on commit d1983da

Please sign in to comment.