Access Denied upon accessing buddylist/requests

SteveK - April 3, 2008 - 06:11
Project:Buddylist2
Version:5.x-1.x-dev
Component:Buddy API
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Some users are complaining that they cannot access buddylist/requests and are brought to an "Access denied." page. Not all users are getting this error though. This error only happens when a user has requested them and try to access the buddylist/requests page. If there are no requests, they can access it properly.

Possible problems:
-problems with the node_access table?
-problems with duplicate usernodes that have been created?

might not be exclusive to buddylist itself. Any direction or suggestions would be helpful.

#1

nodestroy - April 3, 2008 - 06:33

hi,

is this error depending on the users roles? (have you set access restrictions to the used views?)

If I remember correctly, a missing usernode don´t throw an "Access denied." error, the view would be empty (or without the entries from users without usernode)

regards,
dominik

#2

SteveK - April 4, 2008 - 21:01

There aren't any restrictions and I have set access to manage buddylist for all user roles. It seems to only happen when specific users request to be a buddy of another user.

q #2: what about duplicate usernodes? would that return an error?

#3

radianceinside - April 8, 2008 - 13:12

#4

radianceinside - April 9, 2008 - 16:29

To avoid/circumvent this problem, we've created an own view and directed it to the path/url "/buddylist/requests" (This view is showind the buddylist's pending requests and could easily be created by using the views-api).

#5

criz - April 12, 2008 - 11:56

yes, that should be a possible workaround.

however, this seems to be a relevant issue...

#6

levonai - April 17, 2008 - 15:10

Hint to source of issue?
I'm encountering the same issue (running on the Jan build of buddylist2) and have found that if I 'empty cache' it releases the access denied behavior.
A wild guess - it might be related to the fact that the menu callback for 'buddylist' is placed within the 'may_cache' section of hook_menu, so access is determined sometime in the past. Does it make any sense?

#7

SteveK - April 17, 2008 - 21:36

I'm trying the 'empty cache' fix. I'll let you know if it works. Also going to try and mod the code for the hook_menu on a dev test site.

#8

SteveK - May 5, 2008 - 18:04

emptying the cache works, but only temporarily. Still havent tried modifying hook_menu callback.

#9

breakthematrix - May 5, 2008 - 18:25

I have the same problem - it's been driving me batty!!! It only affects certain users, and only some of the time. Clearing the cache does not work for me. Affected users are using different browsers, different operating systems. I'm using 5.7 on apache/mysql. I don't have any special roles, they are all authenticated users.

Shelly

#10

breakthematrix - May 5, 2008 - 18:26

Oh - and occasionally, the same thing happens when users try to access their private messages.

#11

nodestroy - May 7, 2008 - 07:42

@usernode: i don´t think, that _duplicate_ usernodes can cause this problem (i have no duplicate usernodes, and the probleme exists anyway)

@menustructure (maycache): if the views are empty, there is no access problem. -> menustructure should not be main matter

maybe we can exactly define in which situation the error accours:

* userA, userB -> authenticated users, no admins
* defaul installation of buddylist, usernode and views
* no changes in module code

i have a fresh drupal installation with:
buddy_api, buddylist_ui, token, usernode, views & workflow_ng

and can´t reproduce the problem. (i tried every combination of incomming/outgoing requests, and tried to access buddylist and request page without problems)

maybe there is a problem with another module

can you confirm this?

#12

gfaccinetto - May 19, 2008 - 22:19

I have the same problem when accesing /buddylist. It sends an "access denied" error. I set Spanish as the site's default language. A temporary solution for the problem is go to user account and set language to English, save and then set it back to Spanish. It works temporarily but the error comes back after a while.

Some suggestions, please?

#13

yngens - May 21, 2008 - 13:06

same problem here
for some of the users some occasional times

#14

SteveK - May 29, 2008 - 06:17

here is my module list:

abuse
advanced_forum
buddylist2
cck
comment_redirect
constant_contact
devel
faq
filter_default
guestbook
htmlcorrector
imagecache
imagefield
imce
invite
logintoboggan
nodewords
paging
panels
pathauto
poormanscron
premium
privatemsg
profile_csv
quicktabs
quote
similarterms
simplemenu
stockapi
tinymce
token
usernode
views
views_bookmark
vote_up_down
votingapi
workflow_ng
xmlsitemap

taxonomy_access was enabled before.. but was disabled. I cleared the node_access tables to see if that was causing it, but still persisted.

#15

SteveK - June 3, 2008 - 19:22

editing the hook_menu() in the buddylist_ui module:

  if (!$may_cache) {
   ....

then clearing the cache with devel/cache/clear seemed to fix the problem for the moment. I'm going to try this out for a week and see if anymore users continue to get the error.

#16

criz - June 10, 2008 - 20:39

And is it solving the problem?

I think I have to test the module on a new drupal installation, maybe I can help to fix the bug...

Anybody an idea?

#17

SteveK - June 13, 2008 - 20:05

This has not solved the problem. Still receiving this error intermittently and seemingly randomly.

#18

levonai - June 15, 2008 - 07:09

Actually for me it did seem to solve the problem. Just make sure you don't simply reverse the !may_cache 'if' since then all the original callbacks that were under the !may_cache (after the 'else') stop working. Once I placed all the menu items under !may_cache everything seems to work fine.

I think the original problem might be with the way $edit_access is evaluated in a cache situation, but I can't say I truely understand the drupal menu system to be able to debug/analyze it.

#19

nodestroy - June 18, 2008 - 09:29

i added the change to the menu hook to version control

http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/buddylist2/...

for me it solves the problem too, maybe you can test and report. if its really fixed, i could make a beta release and start developing for d6. would be a great step for the future of buddylist[2]

#20

nodestroy - June 30, 2008 - 11:15

any feedback? did that solve the problem at your sites?

#21

criz - June 30, 2008 - 11:45

Tested it on my site and it's working now. At least at the moment... :)

#22

SteveK - July 7, 2008 - 18:33

so far so good, I must have still had something under the else condition.

#23

Sam Dark - July 26, 2008 - 09:00

Seems that it works. Please update 5.x-1.x-dev to include this patch ;)

#24

nodestroy - August 1, 2008 - 15:11
Status:active» fixed

#25

Anonymous (not verified) - August 15, 2008 - 15:12
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.