mirror of
https://github.com/cytopia/devilbox.git
synced 2025-03-10 22:44:11 +00:00
Fixes #754 Be able to delete emails from control center
This commit is contained in:
parent
2ea5ff59e0
commit
bbc6a661ed
@ -24,6 +24,17 @@ require $VEN_DIR . DIRECTORY_SEPARATOR . 'Mail' . DIRECTORY_SEPARATOR .'mimeDeco
|
|||||||
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Mail.php';
|
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Mail.php';
|
||||||
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Sort.php';
|
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Sort.php';
|
||||||
|
|
||||||
|
|
||||||
|
if (isset($_GET['delete']) && is_numeric($_GET['delete'])) {
|
||||||
|
$message = $_GET['delete'];
|
||||||
|
$MyMbox = new \devilbox\Mail('/var/mail/devilbox');
|
||||||
|
$MyMbox->delete($message);
|
||||||
|
header('Location: /mail.php');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Setup Sort/Order
|
// Setup Sort/Order
|
||||||
//
|
//
|
||||||
@ -152,6 +163,7 @@ $messages = $MyMbox->get($sortOrderArr);
|
|||||||
<th>From <?php echo $orderFrom;?></th>
|
<th>From <?php echo $orderFrom;?></th>
|
||||||
<th>To <?php echo $orderTo;?></th>
|
<th>To <?php echo $orderTo;?></th>
|
||||||
<th>Subject <?php echo $orderSubj;?></th>
|
<th>Subject <?php echo $orderSubj;?></th>
|
||||||
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -180,11 +192,12 @@ $messages = $MyMbox->get($sortOrderArr);
|
|||||||
<td><?php echo htmlentities($structure->headers['from']);?></td>
|
<td><?php echo htmlentities($structure->headers['from']);?></td>
|
||||||
<td><?php echo htmlentities($structure->headers['x-original-to']);?></td>
|
<td><?php echo htmlentities($structure->headers['x-original-to']);?></td>
|
||||||
<td><?php echo htmlentities($structure->headers['subject']);?></td>
|
<td><?php echo htmlentities($structure->headers['subject']);?></td>
|
||||||
|
<td><a href="/mail.php?delete=<?php echo $data['num']-1;?>" title="Delete Email"><i class="fa fa-trash"></i></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr></tr>
|
<tr></tr>
|
||||||
<tr id="mail-<?php echo $data['num'];?>" style="display:none">
|
<tr id="mail-<?php echo $data['num'];?>" style="display:none">
|
||||||
<td></td>
|
<td></td>
|
||||||
<td colspan="4">
|
<td colspan="5">
|
||||||
<?php if ($body !== null): ?>
|
<?php if ($body !== null): ?>
|
||||||
<template id="mail-body-<?=$data['num']?>"><?=$body?></template>
|
<template id="mail-body-<?=$data['num']?>"><?=$body?></template>
|
||||||
<html-email data-template-id="mail-body-<?=$data['num']?>"></html-email>
|
<html-email data-template-id="mail-body-<?=$data['num']?>"></html-email>
|
||||||
|
@ -58,6 +58,18 @@ class Mail
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes an emails
|
||||||
|
*
|
||||||
|
* Note: messages start with 0.
|
||||||
|
*
|
||||||
|
* @param int $message The number of the message to remove, or array of message ids to remove
|
||||||
|
*/
|
||||||
|
public function delete($message) {
|
||||||
|
$this->_Mbox->remove($message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve emails.
|
* Retrieve emails.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user