Email Log: Database class integration.
This commit is contained in:
@@ -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;
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user