3 require( '../../config.php' );
4 require_once( $AMS_LIB . '/libinclude.php' );
5 $id = $_POST['PHPSESSID'];
10 if ( isset( $_SESSION['ticket_user'] ) ) {
11 $return['permission'] = unserialize( $_SESSION['ticket_user'] ) -> getPermission();
14 $return['permission'] = 0;
19 if(WebUsers
::isLoggedIn() && isset($_GET['id'])){
21 $ticket_id = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT
);
22 $target_ticket = new Ticket();
23 $target_ticket->load_With_TId($ticket_id);
24 if(($target_ticket->getAuthor() == unserialize($_SESSION['ticket_user'])->getTUserId()) || Ticket_User
::isMod(unserialize($_SESSION['ticket_user'])) ){
26 if (!empty($_FILES)) {
27 $tempFile = $_FILES['Filedata']['tmp_name'];
29 $fileParts = pathinfo($_FILES['Filedata']['name']);
30 Ticket
::add_Attachment($_GET['id'],$_FILES['Filedata']['name'],$_SESSION['id'],$tempFile);
31 echo "Uploaded :".$_FILES['Filedata']['name'];
33 echo "Upload Failed!";
35 echo "Upload Failed!";
37 echo "Upload Failed!";
39 echo "Upload Failed!";