fclose($passwd);
            verify_and_update();
            $current_num = 0;
        }
        $hash_states = array();
        $current_hashtype = $row->hashtype;
        if (($wordlist = fopen($hash_verification_jtr_root . "wordlist", "w")) === FALSE) {
            die("Failed to open {$hash_verification_jtr_root}" . "wordlist for writing.\n");
        }
        if (($passwd = fopen($hash_verification_jtr_root . "passwd", "w")) === FALSE) {
            die("Failed to open {$hash_verification_jtr_root}" . "passwd for writing.\n");
        }
    }
    if ($row->hashtype == $current_hashtype) {
        $current_num++;
        fprintf($wordlist, "%s\n", $row->plaintext);
        fprintf($passwd, "%d=%d:%s\n", $row->id, $unique_counter, $row->hash);
        // Default to invalid
        $hash_states[$row->id] = FALSE;
    }
}
if ($r->num_rows) {
    if ($wordlist != NULL) {
        fclose($wordlist);
    }
    if ($password != NULL) {
        fclose($passwd);
    }
    verify_and_update();
}
$r->close();
Example #2
0
$specimen_id_list = $_REQUEST['specimen_id'];
$comments_list = $_REQUEST['comments'];
$measure_list = array();
for ($i = 1; $i <= $num_measures; $i++) {
    $field_name = "measure_{$i}";
    $measure_list[] = $_REQUEST[$field_name];
}
for ($i = 0; $i < count($specimen_id_list); $i++) {
    if (isset($_REQUEST['verify_flag_' . ($i + 1)]) === false) {
        # Verify flag is unset. Skip.
        continue;
    }
    $test_entry = new Test();
    $test_entry->specimenId = $specimen_id_list[$i];
    $specimen = Specimen::getById($specimen_id_list[$i]);
    $patient = Patient::getById($specimen->patientId);
    $result_values = array();
    for ($j = 0; $j < $num_measures; $j++) {
        $result_values[] = $measure_list[$j][$i];
    }
    $test_entry->result = implode(",", $result_values) . ",";
    $test_entry->comments = $comments_list[$i];
    $test_entry->verifiedBy = $_SESSION['user_id'];
    $test_entry->dateVerified = date("Y-m-d H:i:s");
    # TODO: Add checking of valid ranges before committing verification
    verify_and_update($test_type_id, $test_entry, $patient->getHashValue());
}
?>
<div class='sidetip_nopos'>
Results marked a verified
</div>