Skip to content

Commit

Permalink
Where survey is NOT private, activation now requires user to also ini…
Browse files Browse the repository at this point in the history
…tialise tokens (otherwise, survey will be active, but no tokens will exist)

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@194 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Apr 5, 2003
1 parent 771ab94 commit 365cfa5
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions admin/activate.php
Expand Up @@ -137,6 +137,7 @@
while($prow=mysql_fetch_array($presult))
{
if ($prow['private'] == "N") {$createsurvey .= " token VARCHAR(10),\n";}
$surveynotprivate="TRUE";
}
$aquery = "SELECT * FROM questions, groups WHERE questions.gid=groups.gid AND questions.sid={$_GET['sid']} ORDER BY group_name, title";
$aresult = mysql_query($aquery);
Expand Down Expand Up @@ -219,8 +220,18 @@
$acquery = "UPDATE surveys SET active='Y' WHERE sid={$_GET['sid']}";
$acresult = mysql_query($acquery);

echo "Survey is now active and data entry can proceed!<br /><br />\n";
echo "<a href='$scriptname?sid={$_GET['sid']}'>Return to administration</a></center>\n";
if ($surveynotprivate) //This survey is tracked, and therefore a tokens table MUST exist
{
echo "This survey is registered as NOT PRIVATE and therefore requires a tokens table\n";
echo "to be created.<br /><br />\n";
echo "<input type='submit' value='Create Tokens Table' $btstyle onClick=\"window.open('tokens.php?sid={$_GET['sid']}&createtable=Y', '_top')\">\n";

}
else
{
echo "Survey is now active and data entry can proceed!<br /><br />\n";
echo "<input type='submit' value='Return to Administration' $btstyle onClick=\"window.open('$scriptname?sid={$_GET['sid']}', '_top')\">\n";
}
echo "</body>\n</html>";
}
?>

0 comments on commit 365cfa5

Please sign in to comment.