Email Log: Database class integration.

This commit is contained in:
Nate
2019-08-05 21:22:26 -06:00
parent b47615c389
commit 72ae5998a3
4 changed files with 91 additions and 81 deletions
+13 -10
View File
@@ -44,22 +44,25 @@
//get posted values, if any
$email_log_uuid = $_REQUEST["id"];
$showall = $_REQUEST['showall'];
if (is_uuid($email_log_uuid)) {
$sql = "delete from v_email_logs ";
$sql .= "where email_log_uuid = '".$email_log_uuid."' ";
if (permission_exists('email_log_all') && $_REQUEST['showall'] == 'true') {
$sql .= '';
} else {
$sql .= "and domain_uuid = '".$_SESSION['domain_uuid']."' ";
$array['email_logs'][0]['email_log_uuid'] = $email_log_uuid;
if (!permission_exists('email_log_all') || $_REQUEST['showall'] != 'true') {
$array['email_logs'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
}
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql, $prep_statement);
$database = new database;
$database->app_name = 'email_logs';
$database->app_uuid = 'bd64f590-9a24-468d-951f-6639ac728694';
$database->delete($array);
unset($array);
message::add($text['message-delete']);
}
//redirect user
header("Location: email_logs.php");
header("Location: email_logs.php".($showall == 'true' ? '?showall=true' : null));
exit;
?>