Skip to content

Commit

Permalink
Merge branch 'master' into bug/16068-permission-roles-XSS
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Apr 2, 2020
2 parents 2aada33 + c7ae4ef commit 6e96d03
Show file tree
Hide file tree
Showing 4 changed files with 972 additions and 913 deletions.
4 changes: 2 additions & 2 deletions application/controllers/OptinController.php
Expand Up @@ -61,14 +61,14 @@ function actiontokens($surveyid, $token, $langcode = '')
$oToken = Token::model($iSurveyID)->findByAttributes(array('token' => $sToken));

if (!isset($oToken)) {
$sMessage = gT('You are not a participant in this survey.');
$sMessage = gT('You are not a participant of this survey.');
} else {
if ($oToken->emailstatus == 'OptOut') {
$oToken->emailstatus = 'OK';
$oToken->save();
$sMessage = gT('You have been successfully added back to this survey.');
} elseif ($oToken->emailstatus == 'OK') {
$sMessage = gT('You are already a part of this survey.');
$sMessage = gT('You are already a participant of this survey.');
} else {
$sMessage = gT('You have been already removed from this survey.');
}
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/admin/UserManagement.php
Expand Up @@ -767,7 +767,7 @@ public function batchAddGroup()
$aResults[$sItem]['result'] = $oUserGroup->addUser($sItem);
} else {
$aResults[$sItem]['result'] = false;
$aResults[$sItem]['error'] = gT('User is already a part of the group.');
$aResults[$sItem]['error'] = gT('User is already a member of the group.');
}
}
} else {
Expand Down
3 changes: 2 additions & 1 deletion application/controllers/admin/surveyadmin.php
Expand Up @@ -786,7 +786,8 @@ public function deactivate($iSurveyID = null)
$toldtable = Yii::app()->db->tablePrefix."tokens_{$iSurveyID}";
$tnewtable = Yii::app()->db->tablePrefix."old_tokens_{$iSurveyID}_{$date}";
if (Yii::app()->db->getDriverName() == 'pgsql') {
$tidDefault = Yii::app()->db->createCommand("SELECT pg_attrdef.adsrc FROM pg_attribute JOIN pg_class ON (pg_attribute.attrelid=pg_class.oid) JOIN pg_attrdef ON(pg_attribute.attrelid=pg_attrdef.adrelid AND pg_attribute.attnum=pg_attrdef.adnum) WHERE pg_class.relname='$toldtable' and pg_attribute.attname='tid'")->queryScalar();
// Find out the trigger name for tid column
$tidDefault = Yii::app()->db->createCommand("SELECT pg_get_expr(adbin, adrelid) as adsrc FROM pg_attribute JOIN pg_class ON (pg_attribute.attrelid=pg_class.oid) JOIN pg_attrdef ON(pg_attribute.attrelid=pg_attrdef.adrelid AND pg_attribute.attnum=pg_attrdef.adnum) WHERE pg_class.relname='$toldtable' and pg_attribute.attname='tid'")->queryScalar();
if (preg_match("/nextval\('(tokens_\d+_tid_seq\d*)'::regclass\)/", $tidDefault, $matches)) {
$oldSeq = $matches[1];
Yii::app()->db->createCommand()->renameTable($oldSeq, $tnewtable.'_tid_seq');
Expand Down

0 comments on commit 6e96d03

Please sign in to comment.