Commit 63c2cc69 authored by Luc Didry's avatar Luc Didry
Browse files

Trad : scp/attachment.php

parent 01951278
......@@ -20,11 +20,11 @@ require_once(INCLUDE_DIR.'class.attachment.php');
if(!$thisstaff || !$_GET['id'] || !$_GET['h']
|| !($attachment=Attachment::lookup($_GET['id']))
|| !($file=$attachment->getFile()))
die('Unknown attachment!');
die('Attachement inconnu !');
//Validate session access hash - we want to make sure the link is FRESH! and the user has access to the parent ticket!!
$vhash=md5($attachment->getFileId().session_id().strtolower($file->getKey()));
if(strcasecmp(trim($_GET['h']),$vhash) || !($ticket=$attachment->getTicket()) || !$ticket->checkStaffAccess($thisstaff)) die('Access Denied');
if(strcasecmp(trim($_GET['h']),$vhash) || !($ticket=$attachment->getTicket()) || !$ticket->checkStaffAccess($thisstaff)) die('Accès refusé');
//Download the file..
$file->download();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment