This commit has been accessed 603 times via Git panel.
commit 16a0235344d18ee4ea6a7e67e6508d39cda64d54
tree 5d48f2192241e2786103cc9558d91060fcef2a05
parent c2d57ce32951bbfccf8697489c592af6744a4a54
author Engels Antonio <engels@majcms.org> 1300050531 +0800
committer Engels Antonio <engels@majcms.org> 1300050531 +0800
Add basic filedrop support in Compose
diff --git a/core.php b/core.php
index 927cc97..58d82a9 100644
--- a/core.php
+++ b/core.php
@@ -118,5 +118,4 @@ function extract_emails_from($string){
return $matches[0];
}
-
?>
diff --git a/filedrop.php b/filedrop.php
new file mode 100644
index 0000000..2d0513e
--- /dev/null
+++ b/filedrop.php
@@ -0,0 +1,60 @@
+<?php
+
+session_start();
+
+if (!isset($_SESSION['logged_uid']) or !isset($_SESSION['logged_lvl']) or !isset($_SESSION['logged_key']) or ($_SESSION['logged_lvl'] != "subscriber")) {
+ exit;
+}
+
+/*
+$server_upload_max_filesize = return_bytes(ini_get('upload_max_filesize'));
+$server_post_max_size = return_bytes(ini_get('post_max_size'));
+$server_memory_limit = return_bytes(ini_get('memory_limit'));
+
+$max_file_size = $server_upload_max_filesize;
+
+if ($server_upload_max_filesize > $server_post_max_size) {
+ $max_file_size = $server_post_max_size;
+}
+
+if ($server_post_max_size > $server_memory_limit) {
+ $max_file_size = $server_memory_limit;
+}
+*/
+
+if (isset($_FILES['filedrop_obj']) and !empty($_FILES['filedrop_obj']) and isset($_POST['filedrop_box']) and !empty($_POST['filedrop_box'])) {
+
+ if (is_uploaded_file($_FILES['filedrop_obj']['tmp_name'])) {
+
+ //if ($_FILES['filedrop_obj']['size'] <= $max_file_size) {
+
+ $filedrop_dir = sha1($_SESSION['logged_uid']);
+
+ $filedrop_box = $_POST['filedrop_box'];
+
+ $filedrop_nom = str_replace(" ", "_", $_FILES['filedrop_obj']['name']);
+
+ if (!file_exists(".tmp/$filedrop_dir/$filedrop_box")) {
+ mkdir(".tmp/$filedrop_dir/$filedrop_box",0700,1);
+ }
+
+ if (!file_exists(".tmp/$filedrop_dir/$filedrop_box/$filedrop_nom")) {
+
+ $res = copy($_FILES['filedrop_obj']['tmp_name'], ".tmp/$filedrop_dir/$filedrop_box/$filedrop_nom");
+ unlink($_FILES['filedrop_obj']['tmp_name']);
+ echo "<script>alert(\"{$_FILES['filedrop_obj']['name']} saved as $filedrop_nom\");</script>";
+ }
+ else {
+ unlink($_FILES['filedrop_obj']['tmp_name']);
+ }
+ //}
+ //else {
+ // unlink($_FILES['filedrop_obj']['tmp_name']);
+ //}
+ }
+ else {
+ unlink($_FILES['filedrop_obj']['tmp_name']);
+ }
+}
+
+?>
diff --git a/inbox.php b/inbox.php
index db9c5d8..bc7e5ac 100644
--- a/inbox.php
+++ b/inbox.php
@@ -12,7 +12,7 @@ if (!isset($_POST['box']) or empty($_POST['box'])) {
else {
$folder = trim(strip_tags($_POST['box']));
}
-
+
$host = "{127.0.0.1:143/imap/notls/norsh}";
$mbox = @imap_open("{$host}$folder", $_SESSION['logged_uid'], $_SESSION['logged_key']) or die("Connection to server failed");
diff --git a/index.php b/index.php
index fd5c90f..f38bdf7 100644
--- a/index.php
+++ b/index.php
@@ -13,6 +13,8 @@ $mail_root = "/var/spool/kartero";
session_start();
+include_once("core.php");
+
function rmdirr($recurse_dirname) {
if (!file_exists($recurse_dirname)) {
@@ -761,17 +763,47 @@ if (isset($_SESSION['logged_uid'])) {
if ($_SESSION['logged_lvl'] == "subscriber") {
+ $filedrop_box = date("YmdHis");
+
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
- if (isset($_POST['reply_from']) and isset($_POST['reply_to']) and isset($_POST['reply_subj']) and isset($_POST['reply_body'])) {
+ if (isset($_POST['reply_from']) and isset($_POST['reply_to']) and isset($_POST['reply_subj']) and isset($_POST['reply_body']) and !empty($_POST['reply_from']) and !empty($_POST['reply_to']) and !empty($_POST['reply_subj']) and !empty($_POST['reply_body'])) {
$reply_from = trim($_POST['reply_from']);
$reply_to = trim($_POST['reply_to']);
$reply_subj = trim($_POST['reply_subj']);
$reply_body = trim($_POST['reply_body']);
-
-
$reply_headers = "From: $reply_from\r\nX-Mailer: Kartero/1.0 (PHP/" . phpversion() . ")";
+
+ if (isset($_POST['filedrop_box']) and !empty($_POST['filedrop_box'])) {
+
+ $do_filedrop_dir = sha1($_SESSION['logged_uid']);
+ $do_filedrop_box = $_POST['filedrop_box'];
+
+ if (file_exists(".tmp/$do_filedrop_dir/$do_filedrop_box") and (count(glob(".tmp/$do_filedrop_dir/$do_filedrop_box/*")) > 0)) {
+
+ $do_filedrop_dom = sha1($_SERVER['SERVER_NAME']);
+ $do_filedrop_num = sha1($reply_subj);
+
+ if (!file_exists("filedrop/$do_filedrop_dom")) {
+ mkdir("filedrop/$do_filedrop_dom",0700,1);
+ }
+
+ rename(".tmp/$do_filedrop_dir/$do_filedrop_box","filedrop/$do_filedrop_dom/$do_filedrop_num");
+
+ rmdirr(".tmp/$do_filedrop_dir");
+
+ $do_filedrop_msg = glob("filedrop/$do_filedrop_dom/$do_filedrop_num/*");
+
+ sort($do_filedrop_msg);
+ reset($do_filedrop_msg);
+
+ foreach ($do_filedrop_msg as $do_filedrop_put) {
+
+ $reply_body = $reply_body . "\r\n\r\n" . str_replace("filedrop/$do_filedrop_dom/$do_filedrop_num/","",$do_filedrop_put) . " (" . HumanReadableFilesize(filesize($do_filedrop_put)) . ")\r\n" . "http://" . $_SERVER['SERVER_NAME'] . "/$do_filedrop_put";
+ }
+ }
+ }
if (isset($_POST['reply_cc']) and !empty($_POST['reply_cc'])) {
@@ -833,7 +865,7 @@ if (isset($_SESSION['logged_uid'])) {
imap_close($mbox, CL_EXPUNGE);
}
- echo "<tr><td valign=\"top\" width=\"700\"><div class=\"main\">";
+ echo "<tr><td valign=\"top\" width=\"700\"><div id=\"main\" class=\"main\">";
if (isset($_POST['get']) and !empty($_POST['get'])) {
include("read.php");
@@ -846,6 +878,10 @@ if (isset($_SESSION['logged_uid'])) {
}
else {
include("inbox.php");
+
+#echo "<script type=\"text/javascript\" src=\"jquery-1.3.2.min.js\"></script>";
+
+#echo "<script type=\"text/javascript\"> $(document).ready(function() { setInterval(function() { $('#main').fadeOut(\"fast\").load('inbox.php').fadeIn(\"slow\"); }, 5000); }); </script>";
}
echo "</div></td>";
diff --git a/post.php b/post.php
index e60e410..6e52baf 100644
--- a/post.php
+++ b/post.php
@@ -42,6 +42,8 @@ if (isset($_POST['new']) and !empty($_POST['new']) and is_numeric($_POST['new'])
echo "</td></tr>";
+ mysql_free_result($post_alias_query);
+
echo "<tr><td><b>To:</b></td><td><input class=\"input\" type=\"text\" name=\"reply_to\"></td></tr>";
echo "<tr><td><b>Cc:</b></td><td><input class=\"input\" type=\"text\" name=\"reply_cc\"></td></tr>";
echo "<tr><td><b>Bcc:</b></td><td><input class=\"input\" type=\"text\" name=\"reply_bcc\"></td></tr>";
@@ -51,6 +53,8 @@ if (isset($_POST['new']) and !empty($_POST['new']) and is_numeric($_POST['new'])
echo "</textarea></td></tr>";
+ echo "<input type=\"hidden\" name=\"filedrop_box\" value=\"$filedrop_box\">";
+
echo "<tr><td></td><td align=\"right\"><div class=\"label\"><input type=\"image\" src=\"images/mail-reply.png\"></div><div class=\"label\">send</div></td></tr>";
echo "</table>";
@@ -63,3 +67,19 @@ if (isset($_POST['new']) and !empty($_POST['new']) and is_numeric($_POST['new'])
}
?>
+
+<div class="message">
+
+<iframe name="filedrop" src="filedrop.php" frameborder="0" scrolling="0" width="0" height="0"></iframe>
+
+<table border="0" cellspcaing="0" cellpadding="0">
+<form enctype="multipart/form-data" action="filedrop.php" method="post" target="filedrop">
+<tr><td>
+<input type="hidden" name="filedrop_box" value="<?php echo $filedrop_box; ?>">
+<input type="file" name="filedrop_obj">
+<input type="submit">
+</td></tr>
+</form>
+</table>
+
+</div>
diff --git a/read.php b/read.php
index 2a3c9d6..c502958 100644
--- a/read.php
+++ b/read.php
@@ -271,11 +271,9 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
*/
reset($attachDisplay);
- if (sizeof($attachDisplay) > 0) {
-
- $filePath = "attachments/" . sha1($_SERVER['SERVER_NAME']) ."/" . sha1($header->subject);
+ $filePath = "filedrop/" . sha1($_SERVER['SERVER_NAME']) ."/" . sha1($header->subject);
- $fileAttachments = "";
+ if (sizeof($attachDisplay) > 0) {
for ($j=0;$j<sizeof($attachDisplay);$j++) {
@@ -295,17 +293,21 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
$fileSize = filesize("$filePath/$fileName");
- if ($fileSize > 0) {
- $fileSize = HumanReadableFilesize($fileSize);
- $fileAttachments = $fileAttachments . "\r\n<tr><td><a href=\"$filePath/$fileName\"><img src=\"images/file.png\" border=\"0\" width=\"36\" height=\"36\"></a></td><td><a href=\"$filePath/$fileName\">$fileName</a><br>$fileSize</td></tr>\r\n";
- }
- else {
+ if ($fileSize <= 0) {
unlink("$filePath/$fileName");
}
}
}
+ }
+
+ if (file_exists("$filePath")) {
+
+ $fileAttachments = glob("$filePath/*");
- if ($fileAttachments != "") {
+ if (count($fileAttachments) > 0) {
+
+ sort($fileAttachments);
+ reset($fileAttachments);
echo "<div class=\"spacer\"></div>";
@@ -315,11 +317,22 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\">";
- echo "$fileAttachments";
+ foreach ($fileAttachments as $fileAttachment) {
+
+ $fileName = str_replace("$filePath/","",$fileAttachment);
+
+ $fileSize = filesize($fileAttachment);
+ $fileSize = HumanReadableFilesize($fileSize);
+
+ echo "\r\n<tr><td><a href=\"$fileAttachment\"><img src=\"images/file.png\" border=\"0\" width=\"36\" height=\"36\"></a></td><td><a href=\"$fileAttachment\">$fileName</a><br>$fileSize</td></tr>\r\n";
+ }
echo "</table>";
echo "</div>";
}
+ else {
+ rmdirr($filePath);
+ }
}
echo "</td></tr></table>";
diff --git a/send.php b/send.php
index 84b602a..7e42598 100644
--- a/send.php
+++ b/send.php
@@ -162,7 +162,7 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
echo $reply_quote;
- $filePath = "attachments/" . sha1($_SERVER['SERVER_NAME']) ."/" . sha1($header->subject);
+ $filePath = "filedrop/" . sha1($_SERVER['SERVER_NAME']) ."/" . sha1($header->subject);
if (file_exists("$filePath")) {
tree 5d48f2192241e2786103cc9558d91060fcef2a05
parent c2d57ce32951bbfccf8697489c592af6744a4a54
author Engels Antonio <engels@majcms.org> 1300050531 +0800
committer Engels Antonio <engels@majcms.org> 1300050531 +0800
Add basic filedrop support in Compose
diff --git a/core.php b/core.php
index 927cc97..58d82a9 100644
--- a/core.php
+++ b/core.php
@@ -118,5 +118,4 @@ function extract_emails_from($string){
return $matches[0];
}
-
?>
diff --git a/filedrop.php b/filedrop.php
new file mode 100644
index 0000000..2d0513e
--- /dev/null
+++ b/filedrop.php
@@ -0,0 +1,60 @@
+<?php
+
+session_start();
+
+if (!isset($_SESSION['logged_uid']) or !isset($_SESSION['logged_lvl']) or !isset($_SESSION['logged_key']) or ($_SESSION['logged_lvl'] != "subscriber")) {
+ exit;
+}
+
+/*
+$server_upload_max_filesize = return_bytes(ini_get('upload_max_filesize'));
+$server_post_max_size = return_bytes(ini_get('post_max_size'));
+$server_memory_limit = return_bytes(ini_get('memory_limit'));
+
+$max_file_size = $server_upload_max_filesize;
+
+if ($server_upload_max_filesize > $server_post_max_size) {
+ $max_file_size = $server_post_max_size;
+}
+
+if ($server_post_max_size > $server_memory_limit) {
+ $max_file_size = $server_memory_limit;
+}
+*/
+
+if (isset($_FILES['filedrop_obj']) and !empty($_FILES['filedrop_obj']) and isset($_POST['filedrop_box']) and !empty($_POST['filedrop_box'])) {
+
+ if (is_uploaded_file($_FILES['filedrop_obj']['tmp_name'])) {
+
+ //if ($_FILES['filedrop_obj']['size'] <= $max_file_size) {
+
+ $filedrop_dir = sha1($_SESSION['logged_uid']);
+
+ $filedrop_box = $_POST['filedrop_box'];
+
+ $filedrop_nom = str_replace(" ", "_", $_FILES['filedrop_obj']['name']);
+
+ if (!file_exists(".tmp/$filedrop_dir/$filedrop_box")) {
+ mkdir(".tmp/$filedrop_dir/$filedrop_box",0700,1);
+ }
+
+ if (!file_exists(".tmp/$filedrop_dir/$filedrop_box/$filedrop_nom")) {
+
+ $res = copy($_FILES['filedrop_obj']['tmp_name'], ".tmp/$filedrop_dir/$filedrop_box/$filedrop_nom");
+ unlink($_FILES['filedrop_obj']['tmp_name']);
+ echo "<script>alert(\"{$_FILES['filedrop_obj']['name']} saved as $filedrop_nom\");</script>";
+ }
+ else {
+ unlink($_FILES['filedrop_obj']['tmp_name']);
+ }
+ //}
+ //else {
+ // unlink($_FILES['filedrop_obj']['tmp_name']);
+ //}
+ }
+ else {
+ unlink($_FILES['filedrop_obj']['tmp_name']);
+ }
+}
+
+?>
diff --git a/inbox.php b/inbox.php
index db9c5d8..bc7e5ac 100644
--- a/inbox.php
+++ b/inbox.php
@@ -12,7 +12,7 @@ if (!isset($_POST['box']) or empty($_POST['box'])) {
else {
$folder = trim(strip_tags($_POST['box']));
}
-
+
$host = "{127.0.0.1:143/imap/notls/norsh}";
$mbox = @imap_open("{$host}$folder", $_SESSION['logged_uid'], $_SESSION['logged_key']) or die("Connection to server failed");
diff --git a/index.php b/index.php
index fd5c90f..f38bdf7 100644
--- a/index.php
+++ b/index.php
@@ -13,6 +13,8 @@ $mail_root = "/var/spool/kartero";
session_start();
+include_once("core.php");
+
function rmdirr($recurse_dirname) {
if (!file_exists($recurse_dirname)) {
@@ -761,17 +763,47 @@ if (isset($_SESSION['logged_uid'])) {
if ($_SESSION['logged_lvl'] == "subscriber") {
+ $filedrop_box = date("YmdHis");
+
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
- if (isset($_POST['reply_from']) and isset($_POST['reply_to']) and isset($_POST['reply_subj']) and isset($_POST['reply_body'])) {
+ if (isset($_POST['reply_from']) and isset($_POST['reply_to']) and isset($_POST['reply_subj']) and isset($_POST['reply_body']) and !empty($_POST['reply_from']) and !empty($_POST['reply_to']) and !empty($_POST['reply_subj']) and !empty($_POST['reply_body'])) {
$reply_from = trim($_POST['reply_from']);
$reply_to = trim($_POST['reply_to']);
$reply_subj = trim($_POST['reply_subj']);
$reply_body = trim($_POST['reply_body']);
-
-
$reply_headers = "From: $reply_from\r\nX-Mailer: Kartero/1.0 (PHP/" . phpversion() . ")";
+
+ if (isset($_POST['filedrop_box']) and !empty($_POST['filedrop_box'])) {
+
+ $do_filedrop_dir = sha1($_SESSION['logged_uid']);
+ $do_filedrop_box = $_POST['filedrop_box'];
+
+ if (file_exists(".tmp/$do_filedrop_dir/$do_filedrop_box") and (count(glob(".tmp/$do_filedrop_dir/$do_filedrop_box/*")) > 0)) {
+
+ $do_filedrop_dom = sha1($_SERVER['SERVER_NAME']);
+ $do_filedrop_num = sha1($reply_subj);
+
+ if (!file_exists("filedrop/$do_filedrop_dom")) {
+ mkdir("filedrop/$do_filedrop_dom",0700,1);
+ }
+
+ rename(".tmp/$do_filedrop_dir/$do_filedrop_box","filedrop/$do_filedrop_dom/$do_filedrop_num");
+
+ rmdirr(".tmp/$do_filedrop_dir");
+
+ $do_filedrop_msg = glob("filedrop/$do_filedrop_dom/$do_filedrop_num/*");
+
+ sort($do_filedrop_msg);
+ reset($do_filedrop_msg);
+
+ foreach ($do_filedrop_msg as $do_filedrop_put) {
+
+ $reply_body = $reply_body . "\r\n\r\n" . str_replace("filedrop/$do_filedrop_dom/$do_filedrop_num/","",$do_filedrop_put) . " (" . HumanReadableFilesize(filesize($do_filedrop_put)) . ")\r\n" . "http://" . $_SERVER['SERVER_NAME'] . "/$do_filedrop_put";
+ }
+ }
+ }
if (isset($_POST['reply_cc']) and !empty($_POST['reply_cc'])) {
@@ -833,7 +865,7 @@ if (isset($_SESSION['logged_uid'])) {
imap_close($mbox, CL_EXPUNGE);
}
- echo "<tr><td valign=\"top\" width=\"700\"><div class=\"main\">";
+ echo "<tr><td valign=\"top\" width=\"700\"><div id=\"main\" class=\"main\">";
if (isset($_POST['get']) and !empty($_POST['get'])) {
include("read.php");
@@ -846,6 +878,10 @@ if (isset($_SESSION['logged_uid'])) {
}
else {
include("inbox.php");
+
+#echo "<script type=\"text/javascript\" src=\"jquery-1.3.2.min.js\"></script>";
+
+#echo "<script type=\"text/javascript\"> $(document).ready(function() { setInterval(function() { $('#main').fadeOut(\"fast\").load('inbox.php').fadeIn(\"slow\"); }, 5000); }); </script>";
}
echo "</div></td>";
diff --git a/post.php b/post.php
index e60e410..6e52baf 100644
--- a/post.php
+++ b/post.php
@@ -42,6 +42,8 @@ if (isset($_POST['new']) and !empty($_POST['new']) and is_numeric($_POST['new'])
echo "</td></tr>";
+ mysql_free_result($post_alias_query);
+
echo "<tr><td><b>To:</b></td><td><input class=\"input\" type=\"text\" name=\"reply_to\"></td></tr>";
echo "<tr><td><b>Cc:</b></td><td><input class=\"input\" type=\"text\" name=\"reply_cc\"></td></tr>";
echo "<tr><td><b>Bcc:</b></td><td><input class=\"input\" type=\"text\" name=\"reply_bcc\"></td></tr>";
@@ -51,6 +53,8 @@ if (isset($_POST['new']) and !empty($_POST['new']) and is_numeric($_POST['new'])
echo "</textarea></td></tr>";
+ echo "<input type=\"hidden\" name=\"filedrop_box\" value=\"$filedrop_box\">";
+
echo "<tr><td></td><td align=\"right\"><div class=\"label\"><input type=\"image\" src=\"images/mail-reply.png\"></div><div class=\"label\">send</div></td></tr>";
echo "</table>";
@@ -63,3 +67,19 @@ if (isset($_POST['new']) and !empty($_POST['new']) and is_numeric($_POST['new'])
}
?>
+
+<div class="message">
+
+<iframe name="filedrop" src="filedrop.php" frameborder="0" scrolling="0" width="0" height="0"></iframe>
+
+<table border="0" cellspcaing="0" cellpadding="0">
+<form enctype="multipart/form-data" action="filedrop.php" method="post" target="filedrop">
+<tr><td>
+<input type="hidden" name="filedrop_box" value="<?php echo $filedrop_box; ?>">
+<input type="file" name="filedrop_obj">
+<input type="submit">
+</td></tr>
+</form>
+</table>
+
+</div>
diff --git a/read.php b/read.php
index 2a3c9d6..c502958 100644
--- a/read.php
+++ b/read.php
@@ -271,11 +271,9 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
*/
reset($attachDisplay);
- if (sizeof($attachDisplay) > 0) {
-
- $filePath = "attachments/" . sha1($_SERVER['SERVER_NAME']) ."/" . sha1($header->subject);
+ $filePath = "filedrop/" . sha1($_SERVER['SERVER_NAME']) ."/" . sha1($header->subject);
- $fileAttachments = "";
+ if (sizeof($attachDisplay) > 0) {
for ($j=0;$j<sizeof($attachDisplay);$j++) {
@@ -295,17 +293,21 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
$fileSize = filesize("$filePath/$fileName");
- if ($fileSize > 0) {
- $fileSize = HumanReadableFilesize($fileSize);
- $fileAttachments = $fileAttachments . "\r\n<tr><td><a href=\"$filePath/$fileName\"><img src=\"images/file.png\" border=\"0\" width=\"36\" height=\"36\"></a></td><td><a href=\"$filePath/$fileName\">$fileName</a><br>$fileSize</td></tr>\r\n";
- }
- else {
+ if ($fileSize <= 0) {
unlink("$filePath/$fileName");
}
}
}
+ }
+
+ if (file_exists("$filePath")) {
+
+ $fileAttachments = glob("$filePath/*");
- if ($fileAttachments != "") {
+ if (count($fileAttachments) > 0) {
+
+ sort($fileAttachments);
+ reset($fileAttachments);
echo "<div class=\"spacer\"></div>";
@@ -315,11 +317,22 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\">";
- echo "$fileAttachments";
+ foreach ($fileAttachments as $fileAttachment) {
+
+ $fileName = str_replace("$filePath/","",$fileAttachment);
+
+ $fileSize = filesize($fileAttachment);
+ $fileSize = HumanReadableFilesize($fileSize);
+
+ echo "\r\n<tr><td><a href=\"$fileAttachment\"><img src=\"images/file.png\" border=\"0\" width=\"36\" height=\"36\"></a></td><td><a href=\"$fileAttachment\">$fileName</a><br>$fileSize</td></tr>\r\n";
+ }
echo "</table>";
echo "</div>";
}
+ else {
+ rmdirr($filePath);
+ }
}
echo "</td></tr></table>";
diff --git a/send.php b/send.php
index 84b602a..7e42598 100644
--- a/send.php
+++ b/send.php
@@ -162,7 +162,7 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
echo $reply_quote;
- $filePath = "attachments/" . sha1($_SERVER['SERVER_NAME']) ."/" . sha1($header->subject);
+ $filePath = "filedrop/" . sha1($_SERVER['SERVER_NAME']) ."/" . sha1($header->subject);
if (file_exists("$filePath")) {