2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Ensure only one data record per token. Applies to newly activated surveys

This commit is contained in:
Adam Zammit
2022-06-02 11:38:09 +10:00
parent 93238bde44
commit 73fcb96bb4
3 changed files with 66 additions and 55 deletions

View File

@@ -408,8 +408,8 @@ function activateSurvey($postsid,$surveyid, $scriptname='admin.php')
$execresult=$dict->ExecuteSQLArray($sqlarray,1);
//queXS Addition - add an index on the token
$createtokenindex = $dict->CreateIndexSQL("{$tabname}_idx", $tabname, array('token'));
//queXS Addition - add a UNIQUE index on the token
$createtokenindex = $dict->CreateIndexSQL("{$tabname}_idx", $tabname, array('token'),array('UNIQUE'));
$dict->ExecuteSQLArray($createtokenindex, false) or safe_die ("Failed to create token index<br />$createtokenindex<br /><br />".$connect->ErrorMsg());
if ($execresult==0 || $execresult==1)