Administering a users pay per node balance

jimurl - October 3, 2008 - 20:57
Project:Pay-per-node
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:needs work
Description

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

jimurl - October 22, 2008 - 22:47

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

AttachmentSize
paypernode.module.5.x.access-dashes.patch 693 bytes

#2

jimurl - October 22, 2008 - 22:47
Status:active» needs review

#3

jimurl - October 22, 2008 - 23:18
Status:needs review» needs work
 
 

Drupal is a registered trademark of Dries Buytaert.