YaWK  24.1
Yet another WebKit
message-spam.php
Go to the documentation of this file.
1 <?php
2 /*
3 if (!isset($_POST['token'])) {
4  die ('no direct access allowed.');
5 }
6 else if ($_POST['token'] != "U3E44ERG0H0M3") {
7  die ('no direct access allowed!');
8 }
9 */
10 include '../../../classes/db.php';
11 include '../../../classes/alert.php';
12 include '../classes/messages.php';
13 
14 /* set database object */
15 if (!isset($db))
16 { // create new db object
17  $db = new \YAWK\db();
18 }
19 
20 $msg_id = $_POST['msg_id'];
21 
22 // UPDATE STATEMENT
23 if ($db->query("UPDATE {plugin_msg} SET msg_read='1', spam='1' WHERE msg_id = '".$msg_id."'"))
24 {
25  echo "message trashed";
26 }
27 else
28 {
29  echo \YAWK\alert::draw("warning", "Ooops, Sorry!", "Could not move message to spamfolder, please try again.","",2000);
30 }
if(!isset($db)) $msg_id