-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathattachments.php
executable file
·55 lines (46 loc) · 1.18 KB
/
attachments.php
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
<?php
/****
*
* @author: [email protected]
* @SVN: $Id: attachments.php 6 2010-04-23 16:33:21Z jake $
* @Copyright 2009,2010 Litwicki Media LLC
*
***/
define('MY_DASHBOARD', true);
$root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($root_path . 'common.' . $phpEx);
//setup user
$user->setup();
$user_id = (int) $user->data['user_id'];
$username = $user->data['user_realname'];
if( !$user_id )
{
login_box("$base_url");
}
//setup user permissions
$auth->setup($user_id);
//build user dashboard
$dashboard = new dashboard();
$dashboard->setup($user_id);
$today = time();
if( isset($_POST['remove_file']) )
{
$message_id = $_POST['message_id'];
$attachment_id = $_POST['attachment_id'];
$sql = "UPDATE ".ATTACHMENTS_TABLE." SET status=0, status_date=$today WHERE attachment_id=$attachment_id";
$db->sql_query($sql);
}
elseif( isset($_POST['add_file']) )
{
$message_id = $_POST['message_id'];
$attachment_id = $_POST['attachment_id'];
$sql = "UPDATE ".ATTACHMENTS_TABLE." SET status=1, status_date=$today WHERE attachment_id=$attachment_id";
$db->sql_query($sql);
}
else
{
//get out of here!
exit;
}
?>