-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupdate_ticket.php
More file actions
57 lines (56 loc) · 1.23 KB
/
update_ticket.php
File metadata and controls
57 lines (56 loc) · 1.23 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
<?php
require_once('config.php');
if(!LOGGED_IN) {
header("Location: ".$system_url."login?error=restricted");
die();
}
if(isset($_POST['tid'])) {
if(isset($_POST['resolve'])) {
$tid = $core->EscapeString($_POST['tid']);
$check = $tickets->checkTicketOwner($user_id, $tid);
if(!$check) {
header("Location: ".$system_url."error?code=update_ownership");
die();
}
else
{
$update = $tickets->statusUpdate($tid, 3, $user_id);
if($update) {
header("Location: ".$system_url."tickets/".$tid);
die();
}
else
{
header("Location: ".$system_url."error?code=status_update_fail");
die();
}
}
}
else if(isset($_POST['reply'])) {
$tid = $core->EscapeString($_POST['tid']);
$message = $core->EscapeString($_POST['message']);
$check = $tickets->checkTicketOwner($user_id, $tid);
if(!$check) {
header("Location: ".$system_url."error?code=update_ownership");
die();
}
else
{
$update = $tickets->Reply($tid, $user_id, $message, NULL);
if($update) {
header("Location: ".$system_url."tickets/".$tid);
die();
}
else
{
header("Location: ".$system_url."error?code=ticket_reply_fail");
die();
}
}
}
}
else
{
header("Location: ".$system_url."error?code=no_tid");
die();
}