Closed (fixed)
Project:
User Points
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
22 Oct 2009 at 12:31 UTC
Updated:
3 Jan 2014 at 00:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
braindrift commentedI think this patch fixes it
Comment #2
braindrift commentedComment #3
kbahey commentedActually, I think this part is not needed:
Because a user only needs the "view own" permission to view their own points.
So, the code would look like the patch which I am attaching a patch for you to test.
Please see if that works, and if it does, I will create a new stable release with it.
Comment #4
braindrift commentedWith your patch only the owner can see the points. As admin I want also be able to see the points of other user. Furthermore I would like to give the permission to see all points to a specific role.
So I think the
ist needed, but not at this place.
Comment #5
braindrift commentedComment #6
braindrift commentedThe other thing is the code on line 178:
I thik it should be:
without the quotes.
Comment #7
braindrift commentedActually I think the points of an other user shold not be accessible threw the path 'myuserpoints'. A better way would be the path 'user/%user/userpoints' or somthink like that.
Thanks
dendie
Comment #8
kbahey commentedHere is another patch. I fixed the single quote issue, and more importantly allowed access to *my* to only the user himself, or a user that has admin userpoints permission.
Please test this and let me know.
Comment #9
braindrift commentedHello, thanks for the work. Unfortunately I will be able to test it only on wednesday but the code looks good.
Comment #10
kbahey commentedPost here when you test it. We can wait a few days.
Comment #11
braindrift commentedHello kbahey,
I have tested it and discovered that the user needs to have the 'view userpoints' permissen when he wants to view only the own points.
Why don't you like my patch from comment #1. I think the access control should be like this:
'view own userpoints' - to view own userpoints
'view userpoints' - to view userpoints of other users
this two permissions should (could) be independent form each other.
userpoints_access_my_points should look like this:
Furthermore I do not understand why you perform access-checks in the function userpoints_list_my_userpoints. At this point all the access-checks shoud allready be checked by the userpoints_access_my_points-function.
I suggest to use this patch.
Thanks
dendie
Comment #12
kmillecam commenteduserpoints-02.patch restores functionality that I need.
I need users (administrators) with the "view userpoints" permission to be able to view other user's transaction history for auditing purposes.
This patch worked for me.
Kevin
Comment #13
Pedro J. Fernandez commented#11 works for me too.
Comment #14
Chad_Dupuis commented+1 for the patch in #11 works as expected.....
Comment #15
lagerassassin commentedThis is what hacks me off a bit about Drupal if I'm honest, NO ONE EVER puts things in laymens terms to help users that aren't familiar with things like php etc, now its totally great that this has a fix and I really want to use it but simply cant as I have no idea where to paste that code into my existing module due to a lack of knowledge with php.
Maybe someone with a bit of understanding can help us PHP "noobs" out a bit
Comment #16
braindrift commentedHello lagerassassin,
the patch in #11 is nothing you can simply paste in the code. You have to apply this patch with a tool like eclipse. But it sounds like you are not a developer so I suggest to follow this http://drupal.org/patch/apply instuctions.
Regards,
dendie
Comment #17
braindrift commentedHere is the patched userpoints.module file which you can paste into the userpoints directory and test the patch (don't forget to rename it from userpoints.module.txt to userpoints.module)
Comment #18
lagerassassin commentedThanks for your quick reply Dendie, no you are right I am not a developer and struggle with php, I just think its a shame because people like myself end up turning our backs on some great modules because it's so difficult to understand.
I will take a look at the video attached to the instruction link you provided but I dare say that this looks and sound just as difficult and I will probably just end up deleting a another module that I really wanted to use because I cant get it to work correctly :(
Comment #19
lagerassassin commentedWOW thanks, thats so much more the kind of thing us noobs need lol, thanks ever so much for your help and I will give it a try :)
Comment #20
lagerassassin commentedOk, I don't know what I'm doing wrong, Ive enabled permissions for all users to see userpoints/list/all and added your patched userpoints.module and a fixed zip of userpoints_top_contributors and Im still getting the same damned page when an anon or registered user tries to access it
ACCESS DENIED
any ideas what I'm doing wrong?
Comment #21
braindrift commentedis it possible that the user has no points yet? I just tried it and got the access denied. Now I gave the user some points and now it works
Comment #22
lagerassassin commentedThats not working, but to be honest all I need is the page userpoints/list/all to be accessible to everyone as I'm running a kind of league scoreboard thing, is there not a way to give permissions to every user? I just automatically assumed that would be possible when I downloaded this module :s
Comment #23
braindrift commentedYou have to give the user the permission "view userpoints".
Comment #24
lagerassassin commentedThis has been enabled all along :s
Thats why I don't understand
Comment #25
braindrift commentedJust for better understanding:
You gave the permission view userpoints to the authenticated user (not only the annonymous user) and a loged in user is not yet able to access the userpoints/list/all page?
Comment #26
Ela commentedI had the same problem, users need to have a point to access: http://site.com/myuserpoints ... thank you for the patch!
Comment #27
kerberos commentedI am not sure if this is related to this or a different bug:
In Userpoints 1.1, on a user's profile page, the 'View' link under the 'User points' section contains a link of the form:
[site url]/myuserpoints/[uid]
where [uid] is the user id of the user whose profile you are viewing. The issue is that this link is visible to everyone visiting a user's profile, but the myuserpoints link only works for the user whose profile it is. So even uid 1 gets an access denied error when they follow that link on someone else's profile.
I think this link should either only be shown for the user viewing his own profile (and should just go to myuserpoints) since it is not accessible to other users. Or maybe there should be a permission for seeing someone else's userpoint details and only show the link if its either their own profile or they have that permission?
Comment #28
CarbonPig commented#17 - Thank Dendie - That makes things really easy! Works Great - Only problem is that I don't see a userpoints tab in the user accounts, but this might be a different issue.
Comment #29
kbahey commentedI committed the patch in #30 here #362119: "Access denied" for userpoint details. Please wait for about 12 hours before downloading and then testing it.
Please report back if we still need this one, or we just mark it as duplicate.
Comment #30
smokrisThe committed patch solves the problem for me. I think we can call this issue a duplicate.
Comment #31
mstef commentedNot sure if this is a duplicate. The patch is about viewing point details.
Why do I get an access denied when trying to view my own points (/myuserpoints) if I don't have any points let. It seems very pointless and annoying because menu items won't show. The page should just say 'you dont have any points yet'...
Has that been addressed yet?
Comment #32
berdirThis is something that has been addressed in the 7.x-1.x port, I'll try to create a patch to backport this soon.
Comment #33
BenK commented@Berdir: I'm not sure if we actually fixed this yet in the D7 port (although you would know better than me). I pointed out the issue here:
http://drupal.org/node/637584#comment-3184730
(See item C)
And you responded to it here:
http://drupal.org/node/637584#comment-3216396
So unless you fixed it later (which you might have done), it looks like we may have postponed the issue since it was an existing issue in the 6.x version and we were focused on porting the existing code.
That being said, this thread might be a great opportunity to finally fix this (both in D7 and D6).
Let me know if I'm right or wrong about all of this. As always, I'm happy to test! ;-)
--Ben
Comment #34
berdirYou are right of course, I confused user_relationships and userpoints.
Anyway, here is a patch for D7.
Comment #35
BenK commentedThanks, Berdir! The patch in #34 works great. This is ready to be committed! :-)
Comment #36
mstef commentedAnything for D6?
Comment #37
berdirCommited the patch against 7.x-1.x, attaching a backport for D6.
Comment #38
berdirForgot to change the version.
Comment #39
Bilmar commentedHello,
The patch fixes the issue of 'Access denied' for /myuserpoints when the user has no points.
Tested with an authenticated user on my site who has no userpoints.
/myuserpoints before the patch screengrab
/myuserpoints after the patch screengrab
permissions page screengrab
It would be nice to have "Points for username" at /myuserpoints to show the themed username, but that is a feature request different from this issue =)
Thanks Berdir!
Comment #40
berdirThanks for testing, I agree that would be useful, can you open a feature request and postpone it on #556910: Menu router items: Allow to pass PASS_THROUGH to t()? Because that issue will allow to set the title through a title callback function.
Comment #41
berdirTagging to make it easier to find patches like this one.
Comment #42
dmetzcher commentedI can confirm that the patch for the Drupal 6 version of this module (comment #37) works. Thanks!
Comment #43
ionmedia commentedi have no ssh for patch it in my hosting, can anyone put here patched file ?
Comment #44
mile23The patch in #37 didn't apply cleanly to 6.x-1.1, so here are two things:
1) userpoints.module with the patch applied (file extension set to .txt so it can be uploaded...)
2) A patch generated against 6.x-1.1 that should apply cleanly. This patch should also work against dev.
Comment #45
mile23Oops... Doesn't play well with dev.
Comment #46
berdir#45: userpoints-access-6x-dev-611604.patch queued for re-testing.
Comment #47
berdirThanks, commited.