forked from Th3-822/rapidleech
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboxes.php
More file actions
122 lines (120 loc) · 4.49 KB
/
Copy pathboxes.php
File metadata and controls
122 lines (120 loc) · 4.49 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
118
119
120
121
122
<?php
function boxes() {
global $list, $options, $PHP_SELF;
?>
<form method="post" action="<?php echo $PHP_SELF; ?>"><input type="hidden" name="act" value="boxes_go" />
<?php
echo count ( $_GET ["files"] ) . " file" . (count ( $_GET ["files"] ) > 1 ? "s" : "") . ":<br />";
for($i = 0; $i < count ( $_GET ["files"] ); $i ++) {
$file = $list [($_GET ["files"] [$i])];
?>
<input type="hidden" name="files[]" value="<?php echo $_GET ["files"] [$i]; ?>" /> <b><?php echo basename ( $file ["name"] ); ?></b><?php echo $i == count ( $_GET ["files"] ) - 1 ? "." : ", "; ?>
<?php
}
?><br />
<br />
<table align="center">
<tr>
<td><?php echo lang(139); ?>: <textarea name="emails" cols="30" rows="8"><?php
if ($_COOKIE ["email"])
echo $_COOKIE ["email"];
?></textarea>
</td>
<td><input type="submit" value="<?php echo lang(140); ?>" /></td>
</tr>
<tr>
<td><input type="checkbox" name="del_ok"
<?php if (!$options['disable_deleting']) echo 'checked="checked"'; ?> <?php if ($options['disable_deleting']) echo 'disabled="disabled"'; ?> /> <?php echo lang(141); ?></td>
</tr>
<tr>
<td></td>
</tr>
<tr><td>
<table>
<tr>
<td><input id="splitchkbox" type="checkbox" name="split"
onclick="javascript:var displ=this.checked?'':'none';document.getElementById('methodtd2').style.display=displ;"
<?php echo $_COOKIE ["split"] ? ' checked="checked"' : ''; ?> /> <?php echo lang(142); ?></td>
<td> </td>
<td id="methodtd2"
<?php echo $_COOKIE ["split"] ? '' : ' style="display: none;"'; ?>>
<table>
<tr>
<td>Method: <select name="method">
<option value="tc" <?php echo $_COOKIE ["method"] == "tc" ? ' selected="selected"' : ''; ?>>Total Commander</option>
<option value="rfc" <?php echo $_COOKIE ["method"] == "rfc" ? ' selected="selected"' : ''; ?>>RFC 2046</option>
</select></td>
</tr>
<tr>
<td><?php echo lang(143); ?>: <input type="text" name="partSize" size="2"
value="<?php echo ($_COOKIE ["partSize"] ? $_COOKIE ["partSize"] : 10); ?>" /> MB
</td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr>
</table>
</form>
<?php
}
function boxes_go() {
global $list, $options, $fromaddr;
require_once (CLASS_DIR . "mail.php");
$_POST ["partSize"] = ((isset ( $_POST ["partSize"] ) & $_POST ["split"] == "on") ? $_POST ["partSize"] * 1024 * 1024 : FALSE);
$v_mails = explode ( "\n", $_POST['emails'] );
$v_min = count ( (count ( $_POST ["files"] ) < count ( $v_mails )) ? $_POST ["files"] : $v_mails );
for($i = 0; $i < $v_min; $i ++) {
$file = $list [$_POST ["files"] [$i]];
$v_mail = trim ( $v_mails [$i] );
if (! checkmail ( $v_mail )) {
printf(lang(144),$v_mail);
echo "<br /><br />";
} elseif (file_exists ( $file ["name"] )) {
if (xmail ( "$fromaddr", $v_mail, "File " . basename ( $file ["name"] ), "File: " . basename ( $file ["name"] ) . "\r\n" . "Link: " . $file ["link"] . ($file ["comment"] ? "\r\nComments: " . str_replace ( "\\r\\n", "\r\n", $file ["comment"] ) : ""), $file ["name"], $_POST ["partSize"], $_POST ["method"] )) {
if ($_POST["del_ok"] && !$options['disable_deleting']) {
if (@unlink ( $file ["name"] )) {
$v_ads = " and deleted!";
unset ( $list [$_POST ["files"] [$i]] );
} else {
$v_ads = ", but <b>not</b> deleted!</b>";
}
;
} else
$v_ads = " !";
echo '<script type="text/javascript">'."mail('File <b>" . basename ( $file ["name"] ) . "</b> it is sent for the address <b>" . $v_mail . "</b>" . $v_ads . "', '" . md5 ( basename ( $file ["name"] ) ) . "');</script>\r\n<br />";
} else {
echo lang(12)."<br />";
}
} else {
printf(lang(145),$file['name']);
echo "<br /><br />";
}
}
if (count ( $_POST ["files"] ) < count ( $v_mails )) {
for($i = count ( $_POST ["files"] ); $i < count ( $v_mails ); $i ++) {
$v_mail = trim ( $v_mails [$i] );
echo "$v_mail.</b><br /><br />";
}
echo "</b><br />";
}
elseif (count ( $_POST ["files"] ) > count ( $v_mails )) {
for($i = count ( $v_mails ); $i < count ( $_POST ["files"] ); $i ++) {
$file = $list [$_POST ["files"] [$i]];
if (file_exists ( $file ["name"] )) {
echo $file ["name"] . "<br /><br />";
} else {
printf(lang(145),$file['name']);
echo "<br /><br />";
}
}
echo "<br />";
}
if ($_POST ["del_ok"]) {
if (! updateListInFile ( $list )) {
echo lang(146)."<br /><br />";
}
}
}
?>