*
*
* ACH is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ACH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Open Source ACH. If not, see .
protected function getView($template = null) { if (empty($template)) { $template = $this->template; } $settings = ['title' => Setting::get('ex_title'), 'customer' => Setting::get('ex_customer'), 'date' => Setting::get('ex_date'), 'version' => Setting::get('ex_version'), 'disclaimer' => Setting::get('ex_disclaimer_html')]; return View::make($template, ['project_name' => Setting::get('project_name'), 'generated_at' => date('d-m-Y H:i'), 'users' => static::getUsers(), 'logbooks' => static::getLogbooks($this->logbooks), 'logbooksAll' => static::getLogbooks('all'), 'entriesAll' => Entry::all(), 'attachments' => static::getAttachments($this->logbooks), 'attachmentsAll' => Attachment::all(), 'evidences' => Evidence::all(), 'custody' => Custody::all(), 'suspects' => Suspect::all(), 'legals' => Legal::where('active', 1)->get(), 'settings' => $settings]); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($logbook_id, $entry_id) { try { $logbook = Logbook::findOrFail($logbook_id); $entry = Entry::findOrFail($entry_id); return View::make('entries.edit', ['logbook' => $logbook, 'entry' => $entry, 'evidences' => Evidence::all(), 'choices' => $this->getEvidenceChoices()]); } catch (ModelNotFoundException $e) { return Redirect::to(route('logbooks.index'))->with('message', ['content' => 'Entry niet gevonden!', 'class' => 'danger']); } }
public function getEvidence($evidence_id) { $evidence = NULL; try { $evidence = Evidence::findOrFail($evidence_id); return $evidence; } catch (Exception $e) { return $evidence; } }
public function getDiagsCompare($user_1, $user_2) { // Load up diags for the evidence array. for ($i = 0; $i < count($this->evidence); $i++) { $this_evidence = new Evidence(); $this_evidence->populateFromId($this->evidence[$i]); $this_evidence->diag = Evidence::getDiagCompare($this_evidence->id, $this, $user_1, $user_2); //$this_evidence->update(); } }
** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** ACH is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with Open Source ACH. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// */ ?> <?php $active_evidence = new Evidence(); $active_evidence->populateFromId($_REQUEST['evidence_id']); $this_user = new User(); $this_user->populateFromId($active_evidence->user_id); ?> <div id="nonEdit"> <p><a onClick="document.getElementById('edit').style.display='block'; document.getElementById('nonEdit').style.display='none';">Edit evidence information</a><?php if ($active_project->user_id == $active_user->id) { ?> |<a style="color: #FF0000; padding-left: 10px;" onclick="javascript:confirm_delete_evidence(<?php echo $active_evidence->id; ?> );">Delete evidence record</a><?php } ?>
$active_project->populateFromId($project_id); $active_project->id = ""; $active_project->title .= " (Copy)"; //DEFAULT TITLE FOR DUPLICATED PROJECTS IS "[ORIGINAL PROJECT NAME] (Copy)" $active_project->user_id = $active_user->id; $active_project->insertNew(); $new_project_id = $active_project->id; $old_evidence = array(); $old_hypotheses = array(); $new_evidence = array(); $new_hypotheses = array(); //GET ALL OF THE EVIDENCE FROM THIS MATRIX AND DUPLICATE IT $result = mysql_do("SELECT id, deleted FROM evidence WHERE project_id='{$project_id}'"); while ($query_data = mysql_fetch_array($result)) { if ($query_data['deleted'] != "y") { $this_evidence = new Evidence(); $this_evidence->populateFromId($query_data['id']); $this_evidence->project_id = $active_project->id; $this_evidence->user_id = $active_user->id; //this makes the duplicating user the creator of the new evidence, regardless of who originally created it $this_evidence->insertNew(); $new_evidence[] = $this_evidence->id; $old_evidence[] = $query_data['id']; } } //GET ALL OF THE HYPOTHESES FROM THIS MATRIX AND DUPLICATE THEM $result = mysql_do("SELECT id, deleted FROM hypotheses WHERE project_id='{$project_id}'"); while ($query_data = mysql_fetch_array($result)) { if ($query_data['deleted'] != "y") { $this_hypothesis = new Hypothesis(); $this_hypothesis->populateFromId($query_data['id']);
** This software is part of the Open Source ACH Project (ACH). You'll find ** all current information about project contributors, installation, updates, ** bugs and more at http://competinghypotheses.org. ** ** ** ACH is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** ACH is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with Open Source ACH. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// */ include "code/includes.php"; include "parts/includes.php"; $active_evidence = new Evidence(); $active_evidence->populateFromId($_REQUEST['evidence_id']); $active_evidence->id = $_REQUEST['evidence_id']; if ($active_evidence->flag == "y") { $active_evidence->flag = "n"; echo "<img src='" . $base_URL . "images/icons/bullet_add.png' />"; } else { $active_evidence->flag = "y"; echo "<img src='" . $base_URL . "images/icons/flag_red.png' />"; } $active_evidence->update();
<div class="mainContainer"> <div class="ydsf left"> <div class="inner"> <div class="main"> <h2>Projects using evidence with serial number "<?php echo $display_evidence->serial_number; ?> ":</h2> <?php $result = mysql_do("SELECT * FROM evidence WHERE serial_number='{$display_evidence->serial_number}';"); while ($query_data = mysql_fetch_array($result)) { $this_evidence = new Evidence(); $this_evidence->populateFromId($query_data['id']); $this_project = new Project(); $this_project->populateFromId($this_evidence->project_id); if ($this_evidence->name != "" && $this_project->title != "") { ?> <p>Project <a href="<?php echo $base_URL; ?> project/<?php echo $this_project->id; ?> "><?php echo $this_project->title; ?>
public function getEvidence($evidence_id) { $evidence = Evidence::findOrFail($evidence_id); return $evidence; }
/** * Sets the evidence data for the passed in loc var ID * */ function doSetEvidence($geneName, $name, $type, $value) { // init a evidence data element $evidence = null; // init a index $i = 0; // get the user info object from the session $userObj = getUserSessionObj(); // do we have a evidence object if (isset($userObj->Evidence)) { // find the evidence if it exists foreach ($userObj->Evidence as $item) { // is this the one we are looking for if ($item->geneName == $geneName) { // save the evidence $evidence = $item; // no need to continue break; } //increment the index counter $i++; } } // does the evidence already exist if (isset($evidence)) { // overwrite the current value $userObj->Evidence[$i]->value = $value; echo '{"error": "doSetEvidence(' . $geneName . ') - Data overwritten"}'; } else { // create a new evidence object $evidence = new Evidence(); // save the data in the object $evidence->setData($geneName, $name, $value, $type); // and save it to the user object $userObj->Evidence[] = $evidence; // encode and send the data echo '{"data":' . json_encode($evidence) . '}'; } // terminate the data stream die; }
/** * @return \yii\db\ActiveQuery */ public function getRecord() { return $this->hasOne(Evidence::className(), ['id' => 'record_id']); }
** ** ACH is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** ACH is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with Open Source ACH. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// */ include "code/includes.php"; $active_evidence = new Evidence(); foreach ($_REQUEST as $field => $value) { $active_evidence->{$field} = addslashes($value); } $active_evidence->user_id = $active_user->id; $active_evidence->insertNew(); $cred = $_REQUEST['credibility']; if ($cred == "credible") { mysql_do("INSERT INTO credibility (value, evidence_id, user_id, weight) VALUES ('y', '{$active_evidence->id}', '{$active_user->id}', '1')"); } else { if ($cred == "suspect") { mysql_do("INSERT INTO credibility (value, evidence_id, user_id, weight) VALUES ('n', '{$active_evidence->id}', '{$active_user->id}', '1')"); } } setStatusMessage("Added!"); ?>
public function switchCred($toValue) { // Use this to change credibility. global $active_user; $return_value = ""; $this_evidence = new Evidence(); $this_evidence->populateFromId($this->evidence_id); if ($toValue == "y") { $return_value = "Credible"; } else { $return_value = "Suspect"; } if ($this_evidence->serial_number != "") { $result = mysql_do("SELECT id FROM evidence WHERE serial_number='{$this_evidence->serial_number}'"); while ($query_data = mysql_fetch_array($result)) { $exists = FALSE; $this_evidence_id = $query_data['id']; $result2 = mysql_do("SELECT id FROM credibility WHERE user_id='{$active_user->id}' AND evidence_id='{$this_evidence_id}' LIMIT 1"); while ($query_data2 = mysql_fetch_array($result2)) { $exists = TRUE; } if (!$exists) { mysql_do("INSERT INTO credibility (value, evidence_id, user_id, weight) VALUES ('{$toValue}', '{$this_evidence_id}', '{$active_user->id}', '1')"); } } mysql_do("UPDATE credibility SET value='{$toValue}' WHERE user_id='{$active_user->id}' AND evidence_id IN (SELECT id FROM evidence WHERE serial_number='{$this_evidence->serial_number}')"); } else { mysql_do("UPDATE credibility SET value='{$toValue}' WHERE user_id='{$active_user->id}' AND evidence_id='{$this_evidence->id}'"); } return $return_value; }
if (strtolower($achz->CLASSIFICATION) == "top-secret") { $this_project->classification = "TS"; } $this_project->open = "n"; $this_project->user_id = $active_user->id; $this_project->insertNew(); $this_hypothesis = array(); for ($i = 0; $i < count($achz->MATRIX->HYPOTHESIS); $i++) { $this_hypothesis[$i] = new Hypothesis(); $this_hypothesis[$i]->label = $achz->MATRIX->HYPOTHESIS[$i]->NAME; $this_hypothesis[$i]->user_id = $active_user->id; $this_hypothesis[$i]->project_id = $this_project->id; $this_hypothesis[$i]->insertNew(); } for ($i = 0; $i < count($achz->MATRIX->EVIDENCE); $i++) { $this_evidence = new Evidence(); $this_evidence->name = $achz->MATRIX->EVIDENCE[$i]->NAME[0]; $this_evidence->details = $achz->MATRIX->EVIDENCE[$i]->NOTES[0]; if ($achz->MATRIX->EVIDENCE[$i]->LINK[0] != "") { if ($this_evidence->details != "") { $this_evidence->details .= " "; } $this_evidence->details .= "Link: " . $achz->MATRIX->EVIDENCE[$i]->LINK[0]; } if (strtolower($achz->MATRIX->EVIDENCE[$i]->TYPE[0]) == "open source") { $this_evidence->type = "OSINT"; } if (strtolower($achz->MATRIX->EVIDENCE[$i]->TYPE[0]) == "osint") { $this_evidence->type = "OSINT"; } if (strtolower($achz->MATRIX->EVIDENCE[$i]->TYPE[0]) == "press") {
$counter = 0; //RETRIEVE ALL NEW MESSAGE BOARD COMMENTS ADDED TO USER'S PROJECTS IN THE LAST SEVEN DAYS $result = mysql_do("SELECT * FROM comments WHERE project_id IN ({$project_list}) AND created > DATE_SUB(CURDATE(),INTERVAL 7 DAY) ORDER BY `created` DESC LIMIT 20;"); while ($query_data = mysql_fetch_array($result)) { if ($counter == 0) { ?> <h3>Comments in Your Projects</h3> <div class="recentComments"> <?php } // Probably needs optimizing. $this_project = new Project(); $this_project->get($query_data['project_id']); if ($query_data['evidence_id'] > 0) { $this_evidence = new Evidence(); $this_evidence->get($query_data['evidence_id']); } if ($query_data['hypothesis_id'] > 0) { $this_hypothesis = new Hypothesis(); $this_hypothesis->get($query_data['hypothesis_id']); } $this_user = new User(); $this_user->get($query_data['user_id']); $counter++; ?> <div class="recentComment"> <p class="comment"><a href="<?php echo $base_URL;
for ($j = 0; $j < count($active_project->hypotheses); $j++) { $this_hypothesis = new Hypothesis(); $this_hypothesis->populateFromId($active_project->hypotheses[$j]); echo '<th class="hypothesis" onmouseover="return overlib(\'' . cleanForDisplay($this_hypothesis->description) . '\', CAPTION, \'Hypothesis\');" onmouseout="return nd();"><a href="' . $base_URL . 'project/' . $active_project->id . '/hypothesis/' . $this_hypothesis->id . '">' . $this_hypothesis->label . '</a> '; $rating_score = 0; for ($i = 0; $i < count($active_project->evidence); $i++) { $rating = $compare_user_2->getRating($active_project->evidence[$i], $active_project->hypotheses[$j]); $rating_score += getHypoRatingScore($rating); $rating = $compare_user->getRating($active_project->evidence[$i], $active_project->hypotheses[$j]); $rating_score += getHypoRatingScore($rating); } echo '<br><i>' . $rating_score . '</i></th>'; } echo '</tr></thead><tbody>'; for ($i = 0; $i < count($active_project->evidence); $i++) { $this_evidence = new Evidence(); $this_evidence->populateFromId($active_project->evidence[$i]); echo '<tr><td class="evidence" onmouseover="return overlib(\'' . cleanForDisplay($this_evidence->details) . '\', CAPTION, \'Evidence\');" onmouseout="return nd();"><a href="' . $base_URL . 'project/' . $active_project->id . '/evidence/' . $this_evidence->id . '">' . $this_evidence->name . '</a></td>'; ?> <td class="dcDateAdded" style="display: none;"><?php echo $this_evidence->created; ?> </td> <td class="dcDateOfSource" style="display: none;"><?php echo substr($this_evidence->date_of_source, 0, 10); ?> </td> <td class="dcType" style="display: none;"><?php echo $this_evidence->type; ?>
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $evidence = Evidence::findOrFail($id); $evidence->delete(); return Redirect::to(route('evidences.index'))->with('message', ['content' => 'Bewijs met succes verwijderd!', 'class' => 'success']); }
** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** ACH is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with Open Source ACH. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// */ header("Content-type: application/xml"); echo '<?xml version="1.0" encoding="ISO-8859-1"?>'; include "code/includes.php"; $active_evidence = new Evidence(); $active_evidence->populateFromId($_REQUEST['evidence_id']); $this_user = new User(); $this_user->populateFromId($active_evidence->user_id); $active_project = new Project(); $active_project->populateFromId($active_evidence->project_id); $active_project->getEandH(); $active_project->getUsers(); $this_group_diag = Evidence::getDiagGroup($active_evidence, $active_project); ?> <evidence> <id><?php echo $active_evidence->id; ?> </id>