File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 22
33require_once "inc_all.php " ;
44
5+ enforceUserPermission ('module_financial ' , 2 );
6+
57// Fetch categories
68$ query = "SELECT category_id, category_name FROM categories WHERE category_type ='Expense' AND category_archived_at IS NULL " ;
79$ result = mysqli_query ($ mysqli , $ query );
5254 </form>
5355 <form id="budgetForm" method="POST" action="post.php">
5456 <input type="hidden" name="year" value="<?php echo $ currentYear ; ?> ">
57+ <input type="hidden" name="csrf_token" value="<?php echo $ _SESSION ['csrf_token ' ] ?> ">
58+
5559 <table class="table table-bordered table-striped">
5660 <thead>
5761 <tr>
Original file line number Diff line number Diff line change 55 */
66
77if (isset ($ _POST ['save_budget ' ])) {
8+
9+ enforceUserPermission ('module_financial ' , 2 );
10+
11+ validateCSRFToken ($ _POST ['csrf_token ' ]);
12+
813 $ budgets = $ _POST ['budget ' ];
914 $ year = intval ($ _POST ['year ' ]);
1015
3742}
3843
3944if (isset ($ _POST ['delete_budget ' ])) {
45+
46+ enforceUserPermission ('module_financial ' , 3 );
47+
48+ validateCSRFToken ($ _POST ['csrf_token ' ]);
49+
4050 $ year = intval ($ _POST ['year ' ]);
4151
4252 mysqli_query ($ mysqli ,"DELETE FROM budget WHERE budget_year = $ year " );
You can’t perform that action at this time.
0 commit comments