Administering a users pay per node balance
| Project: | Pay-per-node |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | needs work |
Hello,
I think I have found a minor typo in the code of the paypernode_user_get_balance function. Line 688 says this:
$uid = user_access('administer pay per node system') ? ($uid ? $uid : $user->uid) : $user->uid;
$uid refers to which users pay per node balance will be retrieved.
In other words- if this is an administrator of the ppn system, set $uid to the 'client' user (if given) ; otherwise, set it to whatever user is requesting the page.
The bug is minor - it should read 'administer pay-per-node system' instead of 'administer pay per node system' (the dashes were missing).
This expressed itself this way: when an ppn administrator (but not uid=1) tried to look at (and edit) someone elses paypernode balance, his own pay per node balance was returned instead.
I will investigate writing a patch to correct this.

#1
Here is a patch for the above-mentioned problem. Note that the repository references are local cvs.
#2
#3