Hey all,
I've got a client using this module and they've just asked me to hide the ad nodes from public view. The concern they have is that the Status, Statistics, Click History etc are visible for the world to see.
I've tried blocking this using node_access and content_access but this also blocks the ads from being available.
Looking through the code I'm seeing that it appears there is a permission system in place to block the display of this. I'm looking in ad.pages.inc at theme_node_ad(). There is a check for the 'access statistics' permission, but I'm not finding any way of assigning this to a user or role.
Am I missing something here or is this not implemented yet?
If it is, can someone point me at the path to set this (and show me where I should be able to see this link)?
If it's not implemented yet, I could edit here and attach a patch for it. I'm not sure of the reasoning behind the custom ad_permissions() function and in this case I would add the 'access statistics' to the hook_perm() and check via user_access().
Regards,
Gold
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | ad.module.patch | 478 bytes | lazly |
| #17 | ad.module.patch | 576 bytes | lazly |
Comments
Comment #1
MantasK commentedYou need to enable "Ad Owners" module.
But then not necessary tabs appears, I hide them in template.php
Comment #2
hanamizuki commentedEven when I enable "Ad Owner", the ad node is still public...
Could someone explain why?
Comment #3
cerup commentedI have the same issue.
The node that the ad is in is public. The statistics and other things are not. However, the node itself should not be made public and only accessibly to owners.
Comment #4
PeterEmanuel commentedI'm chiming in - and hope a fix will be made available.
Ad nodes should not be displayed as "pages", only using views and blocks. The recommended fix to add the no-index meta tag makes no sense. Only the owner and/or admin should be able to access the node, for everyone else: 404 (if they somehow find the url).
Peter
Comment #5
perforator commented+1
Comment #6
DynamicFred commentedunsubscribe please
Comment #7
maverick14 commented+1
Comment #8
cerup commentedA hacky way to do this is to set the ad node to unpublished, but the ad status to active. When you set it to unpublished, it'll auto set it to expired. Once it does that, go back in and set it to active which will leave it unpublished and unvieweable to other users. Not a good solution, but it worked in my tests.
Comment #9
Lowell commentedI agree, not a good solution. The not published/active state hides the node from ad owners as well.
I found that if I only display the $node->content['ad']['#value'] variable for that node through content templates, then I only lose the up front statistics and status messages, yet ad owners can still access the reports tab for the same statistics.
For non-ad-owners, all they get is the node title and image presented as an ad.
Satisfactory solution for now.
In the future, it would be nice to access these variables using views and then filter based on ad owner and other ad status values.
Comment #10
maverick14 commentedFor me, enabling the ad_owners module does it.
Comment #12
john franklin commentedThe Ad Owners module will remove the statistics, but the page remains. You can also get a list of all ads in a category by clicking the tag at the bottom. On a test site, I am able to do this as an anonymous user.
Comment #13
alcoder commentedI think you can solve this with the Rules module.
You add a triggered rule: Content is going to be viewed
Set the conditions: Content has type Advertisement, Acting user is not the same as content author, Acting user doesn't have the "Editor" role
Action: for example do a redirect to the front page
Comment #14
osopolarYou can also use ctools page_manager to redirect away from the ad node or display the access denied page.
Comment #15
skh commentedAnother alternative, also not 100% ideal.. could replace the goto with drupal_access_denied etc if preferred.
Comment #16
quinns commentedJust wanted to confirm that I was able to use the Rules module as outlined by #13. Good tip.
Comment #17
lazly commentedIts a huge problem for me, so i wrote a patch for it to ad.module file. Please check it and commit to source. Thx
Comment #18
lazly commentedComment #19
lazly commentedSorry, previously version was a little buggy, use this patch.
Comment #20
Riki_tiki_tavi commentedConfirm the problem. I don't use Ad Owners module, so ads on my site with all details (!!!) are in public.
It's a big problem.
I set the option which add "noindex" meta tag, but google bot ignores it and already gobbled up a lot of Ads and their details :(
I think the best way to resolve this is to split the "show advertisements" permission for showing ads and viewing nodes with all details.
Comment #21
lrwebks commentedDrupal 6 is EOL and no longer supported. Closing this as outdated for that reason. Thanks for your contribution!