Skip to content

Commit

Permalink
Lazy check for results table, incase they were messing with their db.
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/phpsurveyor@2687 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
David Olivier committed Apr 3, 2007
1 parent 23ca5a0 commit d3695fc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions admin/browse.php
Expand Up @@ -45,6 +45,15 @@
//Ensure script is not run directly, avoid path disclosure
if (empty($surveyid)) {die("No SID provided.");}

//Check if results table exists
$tablelist = $connect->MetaTables() or die ("Error getting tokens<br />".htmlspecialchars($connect->ErrorMsg()));
foreach ($tablelist as $tbl)
{
if (db_quote_id($tbl) == db_table_name('survey_'.$surveyid)) $resultsexist = 1;
}

if (!isset($resultsexist)) die("Your results table is missing!");

$sumquery5 = "SELECT b.* FROM {$dbprefix}surveys AS a INNER JOIN {$dbprefix}surveys_rights AS b ON a.sid = b.sid WHERE a.sid=$surveyid AND b.uid = ".$_SESSION['loginID']; //Getting rights for this survey and user
$sumresult5 = db_execute_assoc($sumquery5);
$sumrows5 = $sumresult5->FetchRow();
Expand Down

0 comments on commit d3695fc

Please sign in to comment.