Skip to content

Commit 4963fe4

Browse files
authored
portal fixes (#1795)
1 parent a9bc357 commit 4963fe4

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

portal/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ function validate_new_pass() {
349349

350350
<?php // if something went wrong
351351
if (isset($_GET['requestNew'])) {
352-
$_SESSION['patient_portal_onsite_two'] = true;
352+
$_SESSION['register'] = true;
353353
$_SESSION['authUser'] = 'portal-user';
354354
$_SESSION['pid'] = true;
355355
?>

portal/lib/appsql.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public function portalAudit($type = 'insert', $rec = '', array $auditvals, $oelo
169169
$logsql = "update onsite_portal_activity set date=?, patient_id=?, activity=?, require_audit=?,".
170170
" pending_action=?, action_taken=?,status=?, narrative=?, table_action=?, table_args=?,".
171171
"action_user=?, action_taken_time=?, checksum=? ";
172-
$logsql .= "where id=".$rec ." And patient_id=".$audit['patient_id'];
172+
$logsql .= "where id='" . add_escape_custom($rec) . "' And patient_id='" . add_escape_custom($audit['patient_id']) . "'";
173173
}
174174

175175
$return = sqlStatementNoLog($logsql, $audit);

portal/lib/download_template.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ function doSubs($s)
128128
$nextLocation = 0;
129129
$groupLevel = 0;
130130
$groupCount = 0;
131-
131+
132132
while (($keyLocation = strpos($s, '{', $nextLocation)) !== false) {
133133
$nextLocation = $keyLocation + 1;
134-
134+
135135
if (keySearch($s, '{PatientSignature}')) {
136136
$fn = $GLOBALS['web_root'] . '/portal/sign/assets/signhere.png';
137137
$sigfld = '<span>';
@@ -231,7 +231,7 @@ function doSubs($s)
231231
$patientid = $ptrow['pid'];
232232
$DOS = substr($enrow['date'], 0, 10);
233233
// Prefer appointment comment if one is present.
234-
$evlist = fetchEvents($DOS, $DOS, " AND pc_pid = '$patientid' ");
234+
$evlist = fetchEvents($DOS, $DOS, " AND pc_pid = ? ", null, false, 0, array($patientid));
235235
foreach ($evlist as $tmp) {
236236
if ($tmp['pc_pid'] == $pid && ! empty($tmp['pc_hometext'])) {
237237
$cc = $tmp['pc_hometext'];
@@ -345,7 +345,7 @@ function doSubs($s)
345345
$s = keyReplace($s, dataFixup($data, $title));
346346
}
347347
} // End if { character found.
348-
348+
349349
return $s;
350350
}
351351
// Get patient demographic info.
@@ -368,9 +368,12 @@ function doSubs($s)
368368
}
369369

370370
$templatedir = $GLOBALS['OE_SITE_DIR'] . '/documents/onsite_portal_documents/templates';
371+
372+
check_file_dir_name($form_filename);
371373
$templatepath = "$templatedir/$form_filename";
372374
// test if this is folder with template, if not, must be for a specific patient
373375
if (! file_exists($templatepath)) {
376+
check_file_dir_name($pid);
374377
$templatepath = "$templatedir/" . $pid . "/$form_filename";
375378
}
376379

0 commit comments

Comments
 (0)