<?php
-/* vim: set ts=4 tw=4 sw=4 noet: */
+/* vim: set ts=4 tw=0 sw=4 noet: */
require_once $CFG->root .'lib/db_implementation.php';
class DBMysqli extends DBImpl {
return $row;
}
+ public function getRecipient($id) {
+ $recipient = false;
+
+ $query = "SELECT recipient.email as recipient FROM quarantine q LEFT JOIN msgrcpt ";
+ $query .= "ON msgrcpt.mail_id = q.mail_id LEFT JOIN msgs ON ";
+ $query .= "msgs.mail_id = q.mail_id LEFT JOIN maddr AS recipient ";
+ $query .= "ON msgrcpt.rid = recipient.id LEFT JOIN maddr AS sender ON ";
+ $query .= "msgs.sid = sender.id WHERE q.mail_id = '$id'";
+
+ if ($result = $this->con->query($query, MYSQLI_USE_RESULT)) {
+ $obj = $result->fetch_object();
+ if ($obj) {
+ $recipient = $obj->recipient;
+ }
+ $result->free();
+ }
+
+ return $recipient;
+ }
+
}
?>