Skip to content

Commit

Permalink
Dev Fixed some minor notices - mostly better error handling
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@9514 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Nov 21, 2010
1 parent 94cd8f0 commit 4a1da57
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 21 deletions.
6 changes: 5 additions & 1 deletion admin/access_denied.php
Expand Up @@ -115,8 +115,12 @@
}
elseif($action == "CSRFwarn")
{
$sURLID='';
if (isset($sid)) {
$sURLID="?sid={$sid}";
}
$accesssummary .= "<p><span color='errortitle'>".$clang->gT("Security alert")."</span>: ".$clang->gT("Someone may be trying to use your LimeSurvey session (CSRF attack suspected). If you just clicked on a malicious link, please report this to your system administrator.").'<br>'.$clang->gT('Also this problem can occur when you are working/editing in LimeSurvey in several browser windows/tabs at the same time.')."</p>";
$accesssummary .= "<a href='$scriptname?sid={$sid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
$accesssummary .= "<a href='{$scriptname}{$sURLID}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "FakeGET")
{
Expand Down
1 change: 1 addition & 0 deletions admin/importgroup.php
Expand Up @@ -1022,6 +1022,7 @@ function XMLImportGroup($sFullFilepath, $newsid)
if (!isset($aGIDReplacements[$insertdata['gid']])) continue; // Skip questions with invalid group id
$insertdata['gid']=$aGIDReplacements[(int)$insertdata['gid']];;
$oldsqid=(int)$insertdata['qid']; unset($insertdata['qid']); // save the old qid
if (!isset($aQIDReplacements[(int)$insertdata['parent_qid']])) continue; // Skip subquestions with invalid parent_qids
$insertdata['parent_qid']=$aQIDReplacements[(int)$insertdata['parent_qid']]; // remap the parent_qid

// now translate any links
Expand Down
2 changes: 1 addition & 1 deletion admin/importquestion.php
Expand Up @@ -880,7 +880,7 @@ function XMLImportQuestion($sFullFilepath, $newsid, $newgid)
$insertdata[(string)$key]=(string)$value;
}
$insertdata['qid']=$aQIDReplacements[(int)$insertdata['qid']]; // remap the qid
$insertdata['sqid']=$aQIDReplacements[(int)$insertdata['sqid']]; // remap the subqeustion id
$insertdata['sqid']=$aSQIDReplacements[(int)$insertdata['sqid']]; // remap the subquestion id

// now translate any links
$query=$connect->GetInsertSQL($tablename,$insertdata);
Expand Down
5 changes: 3 additions & 2 deletions admin/importsurvey.php
Expand Up @@ -26,7 +26,8 @@
$aPathInfo = pathinfo($sFullFilepath);
$sExtension = $aPathInfo['extension'];
}


$bImportFailed=false;
if (isset($sExtension) && strtolower($sExtension)=='csv')
{
$aImportResults=CSVImportSurvey($sFullFilepath);
Expand All @@ -46,7 +47,7 @@
// Create old fieldnames


if ((isset($importingfrom) && $importingfrom == "http") || isset($copyfunction))
if ((!$bImportFailed && isset($importingfrom) && $importingfrom == "http") || isset($copyfunction))
{
$importsurvey .= "<br />\n<div class='successheader'>".$clang->gT("Success")."</div><br /><br />\n";
if (isset($copyfunction))
Expand Down
33 changes: 17 additions & 16 deletions admin/printablesurvey.php
Expand Up @@ -49,25 +49,26 @@ function try_debug($line)
// Setting the selected language for printout
$clang = new limesurvey_lang($surveyprintlang);

$desquery = "SELECT * FROM ".db_table_name('surveys')." inner join ".db_table_name('surveys_languagesettings')." on (surveyls_survey_id=sid) WHERE sid=$surveyid and surveyls_language=".$connect->qstr($surveyprintlang); //Getting data for this survey
$desquery = "SELECT * FROM ".db_table_name('surveys')." inner join ".db_table_name('surveys_languagesettings')." on (surveyls_survey_id=sid) WHERE sid={$surveyid} and surveyls_language=".$connect->qstr($surveyprintlang); //Getting data for this survey

$desresult = db_execute_assoc($desquery);
while ($desrow = $desresult->FetchRow())
$desrow = $connect->GetRow($desquery);
if ($desrow==false || count($desrow)==0)
{

//echo '<pre>'.print_r($desrow,true).'</pre>';
$template = $desrow['template'];
$welcome = $desrow['surveyls_welcometext'];
$end = $desrow['surveyls_endtext'];
$surveyname = $desrow['surveyls_title'];
$surveydesc = $desrow['surveyls_description'];
$surveyactive = $desrow['active'];
$surveytable = db_table_name("survey_".$desrow['sid']);
$surveyexpirydate = $desrow['expires'];
$surveystartdate = $desrow['startdate'];
$surveyfaxto = $desrow['faxto'];
$dateformattype = $desrow['surveyls_dateformat'];
safe_die('Invalid survey ID');
}
//echo '<pre>'.print_r($desrow,true).'</pre>';
$template = $desrow['template'];
$welcome = $desrow['surveyls_welcometext'];
$end = $desrow['surveyls_endtext'];
$surveyname = $desrow['surveyls_title'];
$surveydesc = $desrow['surveyls_description'];
$surveyactive = $desrow['active'];
$surveytable = db_table_name("survey_".$desrow['sid']);
$surveyexpirydate = $desrow['expires'];
$surveystartdate = $desrow['startdate'];
$surveyfaxto = $desrow['faxto'];
$dateformattype = $desrow['surveyls_dateformat'];

if(isset($_POST['printableexport'])){$pdf->titleintopdf($surveyname,$surveydesc);}


Expand Down
2 changes: 1 addition & 1 deletion admin/questiongrouphandling.php
Expand Up @@ -284,7 +284,7 @@
$lastnumber=$group['group_order'];
}
//Fix bad ordering
if($ogarray[0]['group_order'] > 0 || !$consecutive)
if((isset($ogarray[0]['group_order']) && $ogarray[0]['group_order'] > 0) || !$consecutive)
{
$i=0;
foreach($ogarray as $group)
Expand Down
1 change: 1 addition & 0 deletions qanda.php
Expand Up @@ -2860,6 +2860,7 @@ function excludeAllOthers$ia[1](value, doconditioncheck)
$colcounter = 1;
$startitem='';
$postrow = '';
$trbc='';
foreach ($ansresult as $ansrow)
{
$myfname = $ia[1].$ansrow['title'];
Expand Down

0 comments on commit 4a1da57

Please sign in to comment.