Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
36 kaklik 1
<?php
2
 
3
/*************************************************************
4
*  TorrentFlux - PHP Torrent Manager
5
*  www.torrentflux.com
6
**************************************************************/
7
/*
8
    This file is part of TorrentFlux.
9
 
10
    TorrentFlux is free software; you can redistribute it and/or modify
11
    it under the terms of the GNU General Public License as published by
12
    the Free Software Foundation; either version 2 of the License, or
13
    (at your option) any later version.
14
 
15
    TorrentFlux is distributed in the hope that it will be useful,
16
    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
    GNU General Public License for more details.
19
 
20
    You should have received a copy of the GNU General Public License
21
    along with TorrentFlux; if not, write to the Free Software
22
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23
*/
24
 
25
include_once("config.php");
26
include_once("functions.php");
27
 
28
$to_user = getRequestVar('to_user');
29
if(empty($to_user) or empty($cfg['user']))
30
{
31
     // the user probably hit this page direct
32
    header("location: index.php");
33
    exit;
34
}
35
 
36
$message = getRequestVar('message');
37
if (!empty($message))
38
{
39
    $to_all = getRequestVar('to_all');
40
    if(!empty($to_all))
41
    {
42
        $to_all = 1;
43
    }
44
    else
45
    {
46
        $to_all = 0;
47
    }
48
 
49
    $force_read = getRequestVar('force_read');
50
    if(!empty($force_read) && IsAdmin())
51
    {
52
        $force_read = 1;
53
    }
54
    else
55
    {
56
        $force_read = 0;
57
    }
58
 
59
 
60
    $message = check_html($message, "nohtml");
61
    SaveMessage($to_user, $cfg['user'], $message, $to_all, $force_read);
62
 
63
    header("location: readmsg.php");
64
}
65
else
66
{
67
    $rmid = getRequestVar('rmid');
68
    if(!empty($rmid))
69
    {
70
        list($from_user, $message, $ip, $time) = GetMessage($rmid);
71
        $message = _DATE.": ".date(_DATETIMEFORMAT, $time)."\n".$from_user." "._WROTE.":\n\n".$message;
72
        $message = ">".str_replace("\n", "\n>", $message);
73
        $message = "\n\n\n".$message;
74
    }
75
 
76
    DisplayHead(_SENDMESSAGETITLE);
77
 
78
?>
79
 
80
<form name="theForm" method="post" action="message.php">
81
<table border="0" cellpadding="3" cellspacing="2" width="100%">
82
<tr>
83
    <td bgcolor="<?php echo $cfg["table_data_bg"] ?>" align="right"><font size=2 face=Arial><?php echo _TO ?>:</font></td>
84
    <td bgcolor="<?php echo $cfg["table_data_bg"] ?>"><font size=2 face=Arial><input type="Text" name="to_user" value="<?php echo $to_user ?>" size="20" readonly="true"></font></td>
85
</tr>
86
<tr>
87
    <td bgcolor="<?php echo $cfg["table_data_bg"] ?>" align="right"><font size=2 face=Arial><?php echo _FROM ?>:</font></td>
88
    <td bgcolor="<?php echo $cfg["table_data_bg"] ?>"><font size=2 face=Arial><input type="Text" name="from_user" value="<?php echo $cfg['user'] ?>" size="20" readonly="true"></font></td>
89
</tr>
90
<tr>
91
    <td bgcolor="<?php echo $cfg["table_data_bg"] ?>" colspan="2">
92
    <div align="center">
93
    <table border="0" cellpadding="0" cellspacing="0">
94
    <tr>
95
        <td>
96
        <font size=2 face=Arial>
97
        <?php echo _YOURMESSAGE ?>:<br>
98
          <textarea cols="72" rows="10" name="message" wrap="hard" tabindex="1"><?php echo $message ?></textarea><br>
99
        <input type="Checkbox" name="to_all" value=1><?php echo _SENDTOALLUSERS ?>
100
<?php
101
    if (IsAdmin())
102
    {
103
        echo "&nbsp;&nbsp;&nbsp;&nbsp;";
104
        echo "<input type=\"Checkbox\" name=\"force_read\" value=1>"._FORCEUSERSTOREAD."";
105
    }
106
?>
107
        <br>
108
        <div align="center">
109
        <input type="Submit" name="Submit" value="<?php echo _SEND ?>">
110
        </div>
111
        </font>
112
        </td>
113
    </tr>
114
    </table>
115
    </div>
116
    </td>
117
</tr>
118
</table>
119
</form>
120
<script>document.theForm.message.focus();</script>
121
 
122
<?php
123
 
124
    DisplayFoot();
125
 
126
} // end the else
127
 
128
?>