forked from Th3-822/rapidleech
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmail.php
More file actions
93 lines (92 loc) · 3.51 KB
/
Copy pathmail.php
File metadata and controls
93 lines (92 loc) · 3.51 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
<?php
function rl_mail() {
global $options, $list, $PHP_SELF;
?>
<form method="post" action="<?php echo $PHP_SELF; ?>"><input type="hidden" name="act" value="mail_go" />
<?php echo lang(104); ?>:
<?php
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(164); ?>: <input type="text" name="email"
value="<?php echo ($_COOKIE ["email"] ? $_COOKIE ["email"] : ""); ?>" />
</td>
<td><input type="submit" value="Send" /></td>
</tr>
<tr>
<td><input type="checkbox" name="del_ok"<?php echo $options['disable_deleting'] ? ' disabled="disabled"' : ' checked="checked"';?> /> <?php echo lang(165); ?></td>
</tr>
<tr>
<td></td>
</tr>
<tr><td>
<table>
<tr>
<td><input 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><?php echo lang(124); ?>: <select name="method">
<option value="tc"
<?php echo $_COOKIE ["method"] == "tc" ? " selected" : ""; ?>>Total Commander</option>
<option value="rfc"
<?php echo $_COOKIE ["method"] == "rfc" ? " 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 mail_go() {
global $list, $options, $fromaddr;
require_once (CLASS_DIR . "mail.php");
if (! checkmail ( $_POST ["email"] )) {
echo lang(166)."<br /><br />";
} else {
$_POST ["partSize"] = ((isset ( $_POST ["partSize"] ) & $_POST ["split"] == "on") ? $_POST ["partSize"] * 1024 * 1024 : FALSE);
for($i = 0; $i < count ( $_POST ["files"] ); $i ++) {
$file = $list [$_POST ["files"] [$i]];
if (file_exists ( $file ["name"] )) {
if (xmail ( "$fromaddr", $_POST ['email'], "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 deleted!</b>";
}
;
} else
$v_ads = " !";
echo '<script type="text/javascript">'."<!--\r\nmail('File <b>" . basename ( $file ["name"] ) . "</b> it is sent for the address <b>" . $_POST ["email"] . "</b>" . $v_ads . "', '" . md5 ( basename ( $file ["name"] ) ) . "');//-->\r\n</script>\r\n<br />";
} else {
echo lang(12)."<br />";
}
} else {
printf(lang(145),$file['name']);
echo "<br /><br />";
}
}
}
}
?>