Can't add credit to ticket
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- php
- Domain
- authorization, backend
Research direction
Start in ticket.form.php around line 62 and compare its entity check with the corresponding check in ticket.php. Reproduce adding credit to a ticket with the reported GLPI and plugin versions, then verify that authorized users can add credit while unauthorized users remain denied.
Written by the indexing model from the issue text.
Description
Code of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
GLPI Version
11.0.6
Plugin version
1.15.7
Bug description
Hi
I have an AccessDeniedHttpException when trying to add credit to a ticket, even with Super-Admin profile.
Bug is there since 1.15.5.
I think the problem is in ticket.form.php, line 62 (for 1.15.7) as the variable passed to Session::haveAccessToEntity should be the entity id of GLPI and not the voucher id.
if (!Session::haveAccessToEntity($_REQUEST['plugin_credit_entities_id'])) {
throw new AccessDeniedHttpException();
}
$_REQUEST['plugin_credit_entities_id'] contains plugin_credit_entities table "id" field and not "entities_id" field
If I remove this test, everything works.
The entity test in ticket.php is checking the correct field.
Best regards,
Relevant log output
Page URL
No response
Steps To reproduce
- Try to add credit to a ticket
Your GLPI setup information
No response
Anything else?
No response
- Dominant language
- PHP
- Stars
- 16
- Forks
- 25
- Avg merge
- 12h 47m
- Merged PRs (30d)
- 8
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
phpstan/phpstan-doctrine#794 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/static-site-importer#1767 ·