Initial commit
[2ch-be.git] / dev-test / old_dev / dev-test / message_proc.php
blob51610476ffa38b4b9de55b96f3116521f8ad04e9
1 <?php
3 if (!isset($_COOKIE['DMDM']) && !isset($_COOKIE['MDMD'])) {
4 header('location:index.php');
5 exit;
7 include('encrypt.php');
9 $id = strip_tags(addslashes(trim($_POST['zxcvbnm'])));
10 $subj = addslashes(trim($_POST['subj']));
11 $inf = addslashes(trim($_POST['msg']));
13 $message = new Message;
14 $subj = $message->BeSanitize($subj);
15 $sanitize = $message->BeSanitize($inf);
17 if ($sanitize<>false) {
18 $user = $message->FindUser($id,$id_mail_path);
19 $sender = $message->GetID($_COOKIE['DMDM'],$id_mail_path);
20 $ckp = $message->CheckPostLimit($sender,$plimit_path,TRUE);
21 if (($ckp >= 60) && ($ckp != false)) {
22 echo "Post limit reached, Please wait for next minute";
23 exit;
25 $ckp = $message->CheckPostLimit($sender,$plimit_hpath,FALSE);
26 if (($ckp >= 600) && ($ckp != false)) {
27 echo "Post limit reached, Please wait for next hour";
28 exit;
30 $write = $message->WriteMDB($user,$sanitize,$sender,$subj,$id);
32 if ($write) {
33 $message->AddPostLimit($sender,$plimit_path,TRUE);
34 $message->AddPostLimit($sender,$plimit_hpath,FALSE);
35 echo "Message Sent";
36 } else {
37 echo "Error, please try again later";
39 } else {
40 echo "Content too long!";