Skip to content

Commit

Permalink
Fixed bug - token registration system was not checking survey setting…
Browse files Browse the repository at this point in the history
…s for token length, defaulting to 15. Fixed.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@10806 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Aug 22, 2011
1 parent 37e3313 commit 5cf4a37
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion register.php
Expand Up @@ -99,7 +99,13 @@
$mayinsert = false;
while ($mayinsert != true)
{
$newtoken = sRandomChars(15);
$tlquery = "SELECT tokenlength FROM ".db_table_name("surveys")." WHERE sid=$surveyid";
$tlresult = db_execute_assoc($tlquery);
while ($tlrow = $tlresult->FetchRow())
{
$tokenlength = $tlrow['tokenlength'];
}
$newtoken = sRandomChars($tokenlength);
$ntquery = "SELECT * FROM {$dbprefix}tokens_$surveyid WHERE token='$newtoken'";
$ntresult = $connect->Execute($ntquery); //Checked
if (!$ntresult->RecordCount()) {$mayinsert = true;}
Expand Down

0 comments on commit 5cf4a37

Please sign in to comment.