I'm using the Drupal Access Control to limit anonymous users to certain paths. I have modules/ad/* and modules/ad/adserve.php* enabled but ads aren't consistently displayed to anonymous users. Removing the restrictions for anonymous users entirely results in ads displaying correctly. I get errors like: "1 denied access." when ads are NOT shown to anonymous users, and the offending path shows "http://xxx.domain.com/modules/ad/adserve.php?q=1&c=file&t=85" or similar. The 'view' link for the message points to http://xxx.domain.com/modules/ad/1 which does not exist for my domain. I have a suspicion that the inconstancy of this error is somehow related to caching but I can't figure out how. The problem temporarily disappears when caching is disabled for the ad module. Page caching is disabled at the drupal level, and its setting has no apparent effect on the display of ads.

In short, I guess my question is if there is some ad-related path I am missing or if this is a larger issue?

CommentFileSizeAuthor
#10 authenticated.JPG101.46 KBkiranb
#9 anonymous.JPG117.3 KBkiranb

Comments

casconed’s picture

additionally, it seems to be delivering bad TIDs for ads - logged-in users get an ad TID of 85 for path x, but logged-out users (who miss the ad) result in an error from a TID of 67 or 69 (which aren't valid ad TIDs).

jeremy’s picture

I do not know what you mean by "Drupal Access Control". Are you referring to a contrib module? Please provide more specific information on how to duplicate the problem you are having.

Ads are served from modules/ad/*. If using image ads, note that the images themselves are stored in your files/ directory -- I don't know if that's relevant to your problem.

I'm also unclear if your follow up comment is a totally separate issue, or if you feel it is related? If separate, please open a separate issue to not cause confusion.

casconed’s picture

The follow-up seems related - somehow the collusion of bad TIDs and caching seems to be restricting the ability of my installation to serve ads to anonymous users. Also, the access control (i though) is part of drupal core (admin/access) but I may be wrong.

jeremy’s picture

I'm not understanding your bug report. Please offer a step-by-step example of how to duplicate the problem you are experiencing.

casconed’s picture

Pages which are visible to anonymous users AND which have ads set to display are not displaying those ads. When an anonymous user visits those pages, an entry appears in the error log which notes 'http://xxx.domain.com/modules/ad/adserve.php?q=1&c=file&t=67' as the path which was attempted access. In this case, 67 is an invalid TID, and the TID which is supposed to be displayed on that particular page is 85.

jeremy’s picture

I am unable to duplicate this. I'm using the ad module at http://kerneltrap.org/ and they display fine for anonymous users -- this is with both Drupal's cache and the ad module's file cache enabled. I'm not understanding what you're doing different to cause the wrong tid to be displayed.

Are you saying that when you're logged out, you see a different adserve.php path in the html source than when you're logged in? Have you tried flushing the drupal page cache?

casconed’s picture

Exactly - sorry to be unclear. I've flushed the cache (and even disabled it entirely) and the adserve path for anonymous users differs from logged in users on the same page.

casconed’s picture

Status: Active » Closed (fixed)

I seem to have fixed this issue by switching the path access urls from "Access only the following pages" to a much more open "Access every page but the following". I am marking this closed, as my problem is solved, but if you'd like to re-open i'd be happy to help you try to discover if this is, in fact, an ad module problem.

kiranb’s picture

StatusFileSize
new117.3 KB

I am having DRUPAL 5.0 installed on my server and using ad module for advertisement but ads aren't displayed to anonymous users though I have assign the permission of 'show advertisements' to all the users. Can sombody tell me what is the problem?
Here I am attaching the print screen of my webpage for anonymous and authenticated users. YOur help will be greatly appriciated. Thank you.

kiranb’s picture

StatusFileSize
new101.46 KB

Here I am attaching screenshot of authenticated user

mnasarudin’s picture

Faced with the same problem and solved by changing Access Control for Anonymous user.

Check : ad module -> show advertisements
Check : upload module -> view uploaded files

That's how I solved my problem.
Hope this info helps.

kiranb’s picture

I have checked my permissions again but still its not showing the adds to anonymous user.
Actually we have done a lot customization on the site but still I have not mad any changes to ad module. Can sombody tell me how to debug this. Your help will be appriciated. Thank you.

kbird2’s picture

I'm having the same problem....Acess Control looks fine too