Skip to content

Commit

Permalink
Moved all survey database variables into array $thissurvey, and modif…
Browse files Browse the repository at this point in the history
…ied related references - including in functions, and global statements. Modified submission statements to check that the PHPSurveyor session variables actually exist before submitting data to responses table.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@1001 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Apr 25, 2004
1 parent 6fe88b1 commit 996e2a0
Show file tree
Hide file tree
Showing 4 changed files with 300 additions and 223 deletions.
18 changes: 9 additions & 9 deletions group.php
Expand Up @@ -78,10 +78,10 @@
}

//SUBMIT ###############################################################################
if (isset($_POST['move']) && $_POST['move'] == " "._SUBMIT." ")
if (isset($_POST['move']) && $_POST['move'] == " "._SUBMIT." " && isset($_SESSION['insertarray']))
{
//If survey has datestamp turned on, add $localtimedate to sessions
if ($surveydatestamp == "Y")
if ($thissurvey['datestamp'] == "Y")
{
$_SESSION['insertarray'][] = "datestamp";
$_SESSION['datestamp'] = $localtimedate;
Expand All @@ -91,7 +91,7 @@
$subquery = createinsertquery();

//COMMIT CHANGES TO DATABASE
if ($surveyactive != "Y")
if ($thissurvey['active'] != "Y")
{
sendcacheheaders();
echo "<html>\n";
Expand All @@ -111,7 +111,7 @@
//UPDATE COOKIE IF REQUIRED
$savedid=mysql_insert_id();

if ($surveyusecookie == "Y" && $tokensexist != 1)
if ($thissurvey['usecookie'] == "Y" && $tokensexist != 1)
{
$cookiename="PHPSID".returnglobal('sid')."STATUS";
setcookie("$cookiename", "COMPLETE", time() + 31536000);
Expand All @@ -137,9 +137,9 @@
}

//Send notification to survey administrator //Thanks to Jeff Clement http://jclement.ca
if ($sendnotification > 0 && $surveyadminemail)
if ($thissurvey['sendnotification'] > 0 && $thissurvey['adminemail'])
{
sendsubmitnotification($sendnotification);
sendsubmitnotification($thissurvey['sendnotification']);
}

session_unset();
Expand Down Expand Up @@ -169,7 +169,7 @@
if (isset($_POST['move']) && $_POST['move'] == " "._LAST." " && (!isset($notanswered) || !$notanswered))
{
//READ TEMPLATES, INSERT DATA AND PRESENT PAGE
if ($surveyprivate != "N")
if ($thissurvey['private'] != "N")
{
$privacy="";
foreach (file("$thistpl/privacy.pstpl") as $op)
Expand Down Expand Up @@ -254,7 +254,7 @@
{
echo templatereplace($op);
}
if ($surveyactive != "Y")
if ($thissurvey['active'] != "Y")
{
echo "\t\t<center><font color='red' size='2'>"._NOTACTIVE."</font></center>\n";
}
Expand Down Expand Up @@ -490,7 +490,7 @@
}
echo "\n";

if ($surveyactive != "Y")
if ($thissurvey['active'] != "Y")
{
echo "\t\t<center><font color='red' size='2'>"._NOTACTIVE."</font></center>\n";
}
Expand Down

0 comments on commit 996e2a0

Please sign in to comment.