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');
|
$o = array('status'=>'err','reason'=>'Invalid Email ID');
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(unlink($dir.DS.$id.'.json'))
|
|
||||||
{
|
if(deleteEmail($email,$id))
|
||||||
$attachments = listAttachmentsOfMailID($email,$id);
|
|
||||||
foreach($attachments as $attachment)
|
|
||||||
unlink($dir.DS.'attachments'.DS.$attachment);
|
|
||||||
$o = array('status'=>'ok');
|
$o = array('status'=>'ok');
|
||||||
}
|
|
||||||
else
|
else
|
||||||
$o = array('status'=>'err','reason'=>'Could not delete email. Permission problem?');
|
$o = array('status'=>'err','reason'=>'Could not delete email. Permission problem?');
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,6 +87,15 @@ function listAttachmentsOfMailID($email,$id)
|
||||||
return $o;
|
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()
|
function loadSettings()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue