Skip to content

Commit 926ea06

Browse files
committed
Security fix for invoice view.
1 parent 3eea3d0 commit 926ea06

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

WEB-INF/lib/ttInvoiceHelper.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ static function getInvoice($invoice_id) {
6969
global $user;
7070
$mdb2 = getConnection();
7171

72-
$sql = "select * from tt_invoices where id = $invoice_id and team_id = $user->team_id and status = 1";
72+
if ($user->isClient()) $client_part = " and client_id = $user->client_id";
73+
74+
$sql = "select * from tt_invoices where id = $invoice_id and team_id = $user->team_id $client_part and status = 1";
7375
$res = $mdb2->query($sql);
7476
if (!is_a($res, 'PEAR_Error')) {
7577
if ($val = $res->fetchRow())

WEB-INF/templates/footer.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<br>
1313
<table cellspacing="0" cellpadding="4" width="100%" border="0">
1414
<tr>
15-
<td align="center">&nbsp;Anuko Time Tracker 1.17.40.4064 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
15+
<td align="center">&nbsp;Anuko Time Tracker 1.17.41.4065 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
1616
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
1717
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
1818
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>

invoice_send.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import('ttSysConfig');
3333

3434
// Access check.
35-
if (!ttAccessAllowed('manage_invoices') || !$user->isPluginEnabled('iv')) {
35+
if (!(ttAccessAllowed('manage_invoices') || ttAccessAllowed('view_own_invoices')) || !$user->isPluginEnabled('iv')) {
3636
header('Location: access_denied.php');
3737
exit();
3838
}

invoice_view.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import('form.Form');
3434

3535
// Access check.
36-
if (!ttAccessCheck(right_view_invoices) || !$user->isPluginEnabled('iv')) {
36+
if (!(ttAccessAllowed('manage_invoices') || ttAccessAllowed('view_own_invoices')) || !$user->isPluginEnabled('iv')) {
3737
header('Location: access_denied.php');
3838
exit();
3939
}

0 commit comments

Comments
 (0)