-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbbsmailact.php
More file actions
117 lines (104 loc) · 2.36 KB
/
Copy pathbbsmailact.php
File metadata and controls
117 lines (104 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
require("www2-funcs.php");
login_init();
assert_login();
$act = $_GET["act"];
$dirname = isset($_GET["dir"])?$_GET["dir"]:false;
$title = isset($_GET["title"])?$_GET["title"]:false;
$act2 = isset($_POST["act2"])?$_POST["act2"]:false;
if($act == "clear" )
{
$dirname = ".DELETED";
$title = "垃圾箱";
}
if(!isset($_POST["mailnum"]) || $_POST["mailnum"] == 0)
$mail_num = 19;
else
$mail_num = $_POST["mailnum"];
if (strstr($dirname,'..'))
{
html_error_quit("读取邮件数据失败!");
}
if($act == "del")
{
$filename = $_GET["file"];
$ret = bbs_delmail($dirname,$filename);
if($ret != 0)
{
html_error_quit("信件不存在或参数错误, 无法删除");
}
}
elseif($act == "move")
{
for($i=0;$i < $mail_num;$i++)
{
if(!isset($_POST["file".$i])||$_POST["file".$i]=="")
continue;
$filename = $_POST["file".$i];
if( $act2 == "delarea" )
$ret = bbs_delmail($dirname,$filename);
}
}
elseif($act == "clear")
{
$mail_fullpath = bbs_setmailfile($currentuser["userid"],".DELETED");
$mail_num = bbs_getmailnum2($mail_fullpath);
$maildata = bbs_getmails($mail_fullpath,0,$mail_num);
for($i=0; $i < $mail_num; $i++ )
{
bbs_delmail(".DELETED",$maildata[$i]["FILENAME"]);
}
?>
<script type="text/javascript"><!--
alert('共删除<?php echo $mail_num; ?>封垃圾邮件');
if(top.window['f4'])
top.window['f4'].location.reload();
window.location='bbsmail.php';
//-->
</script>
<?php
die();
}
/*
elseif($act == "delarea" )
{
$mail_fullpath = bbs_setmailfile($currentuser["userid"],$dirname);
$mail_num = bbs_getmailnum2($mail_fullpath);
$dstart = $_POST["dstart"];
$dend = $_POST["dend"];
$dtype = $_POST["dtype"];
if( $dstart < 1 || $dstart > $mail_num || $dend < 1 || $dend > $mail_num || $dstart > $dend )
{
html_init("gb2312");
html_error_quit("区段删信起始、结束序号有误,请重新输入!");
die();
}
$dnum = $dend - $dstart + 1;
$dstart-- ;
$maildata = bbs_getmails($mail_fullpath,$dstart,$dnum);
if($dtype == 1)
{
foreach( $maildata as $mail )
{
bbs_delmail($dirname,$mail["FILENAME"]);
}
}
else
{
foreach( $maildata as $mail )
{
if(stristr($mail["FLAGS"],"m"))
continue;
else
{
bbs_delmail($dirname,$mail["FILENAME"]);
}
}
}
}
*/
else
{
}
header("Location:bbsmailbox.php?path=".urlencode($dirname)."&title=".urlencode($title));
?>