moved deleting of emails to core
This commit is contained in:
parent
f62f3f56de
commit
af64723ed1
|
@ -41,13 +41,9 @@ switch($action)
|
|||
$o = array('status'=>'err','reason'=>'Invalid Email ID');
|
||||
else
|
||||
{
|
||||
if(unlink($dir.DS.$id.'.json'))
|
||||
{
|
||||
$attachments = listAttachmentsOfMailID($email,$id);
|
||||
foreach($attachments as $attachment)
|
||||
unlink($dir.DS.'attachments'.DS.$attachment);
|
||||
|
||||
if(deleteEmail($email,$id))
|
||||
$o = array('status'=>'ok');
|
||||
}
|
||||
else
|
||||
$o = array('status'=>'err','reason'=>'Could not delete email. Permission problem?');
|
||||
}
|
||||
|
|
|
@ -87,6 +87,15 @@ function listAttachmentsOfMailID($email,$id)
|
|||
return $o;
|
||||
}
|
||||
|
||||
function deleteEmail($email,$id)
|
||||
{
|
||||
$dir = getDirForEmail($email);
|
||||
$attachments = listAttachmentsOfMailID($email,$id);
|
||||
foreach($attachments as $attachment)
|
||||
unlink($dir.DS.'attachments'.DS.$attachment);
|
||||
unlink($dir.DS.$id.'.json');
|
||||
}
|
||||
|
||||
|
||||
function loadSettings()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue