Fixed that every support ticket could be accessed by every customer and admin, fixes #1037
Signed-off-by: Andreas Burchert (scarya) <scarya@froxlor.org>
This commit is contained in:
@@ -32,6 +32,19 @@ if(isset($_POST['id']))
|
||||
elseif(isset($_GET['id']))
|
||||
{
|
||||
$id = intval($_GET['id']);
|
||||
|
||||
if (!$userinfo['customers_see_all']) {
|
||||
/*
|
||||
* Check if the current user is allowed to see the current ticket.
|
||||
*/
|
||||
$sql = "SELECT `id` FROM `panel_tickets` WHERE `id` = '".$id."' AND `adminid` = '".$userinfo['admindid']."'";
|
||||
|
||||
$result = $db->query_first($sql);
|
||||
if ($result == null) {
|
||||
// no rights to see the requested ticket
|
||||
standard_error(array('ticketnotaccessible'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($page == 'tickets'
|
||||
@@ -681,7 +694,7 @@ elseif($page == 'archive'
|
||||
break;
|
||||
case 3: $ticket['display'] = 'low';
|
||||
break;
|
||||
default: $ticket['display'] = 'unknown';
|
||||
default: $ticket['display'] = 'unknown';
|
||||
}
|
||||
$ticket['priority'] = ticket::getPriorityText($lng, $ticket['priority']);
|
||||
|
||||
|
||||
@@ -28,6 +28,17 @@ require ("./lib/init.php");
|
||||
if(isset($_POST['id']))
|
||||
{
|
||||
$id = intval($_POST['id']);
|
||||
|
||||
/*
|
||||
* Check if the current user is allowed to see the current ticket.
|
||||
*/
|
||||
$sql = "SELECT `id` FROM `panel_tickets` WHERE `id` = '".$id."' AND `customerid` = '".$userinfo['customerid']."'";
|
||||
|
||||
$result = $db->query_first($sql);
|
||||
if ($result == null) {
|
||||
// no rights to see the requested ticket
|
||||
standard_error(array('ticketnotaccessible'));
|
||||
}
|
||||
}
|
||||
elseif(isset($_GET['id']))
|
||||
{
|
||||
|
||||
@@ -235,6 +235,7 @@ $lng['error']['destinationalreadyexistasmail'] = 'The forwarder to %s already ex
|
||||
$lng['error']['destinationalreadyexist'] = 'You have already defined a forwarder to %s .';
|
||||
$lng['error']['destinationiswrong'] = 'The forwarder %s contains invalid character(s) or is incomplete.';
|
||||
$lng['error']['domainname'] = $lng['domains']['domainname'];
|
||||
$lng['error']['ticketnotaccessible'] = 'You cannot access this ticket.';
|
||||
|
||||
/**
|
||||
* Questions
|
||||
|
||||
@@ -235,6 +235,7 @@ $lng['error']['destinationalreadyexistasmail'] = 'Die Weiterleitung zu %s exisit
|
||||
$lng['error']['destinationalreadyexist'] = 'Es gibt bereits eine Weiterleitung nach %s .';
|
||||
$lng['error']['destinationiswrong'] = 'Die Weiterleitungsadresse-Adresse %s enthält ungültige Zeichen oder ist nicht vollständig.';
|
||||
$lng['error']['domainname'] = $lng['domains']['domainname'];
|
||||
$lng['error']['ticketnotaccessible'] = 'Sie können sich das Ticket nicht ansehen.';
|
||||
|
||||
/**
|
||||
* Questions
|
||||
|
||||
Reference in New Issue
Block a user