Incorrect domain access check
mindgame - June 1, 2009 - 07:51
| Project: | Domain Access Advanced |
| Version: | 6.x-1.0-rc1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I found that if the "Domain access options" of a node are set to the default domain (ID=0) only and "Send to all affiliates" is unchecked, the node will also be visible on any affiliate site other than the default domain.
In access callback function "domain_adv_node_access" there is the line
if (!isset($node->domains[$GLOBALS['_domain']['domain_id']]) && !isset($node->domains[-1])) {What is the second condition supposed to do? Actually it checks whether a node has grants for the default domain (ID=0), but I think it should check for "all affiliates". Hence I replaced the line above by
$domain_id = $GLOBALS['_domain']['domain_id'];
if ($domain_id == 0) $domain_id = -1;
if (!isset($node->domains[$domain_id]) && !$node->domain_site) {Note: $node->domains and $node->domain_site are set in function "domain_nodeapi".

#1
mindgame -- thanks for providing a patch for this. I ran into this exact same issue on my 2 sites; your patch does the trick.
After changing the code in /modules/domain_adv/domain_adv.module, I tested it and works fine. Rebuilding content access permissions (admin/content/node-settings) didn't seen to be necessary after the code change but I did it just to make sure.
#2
thanks for this patch :-)
just played around with domain acccess and had the same problem. now i've applied your small patch and ... it works! great work!
thanks and greetz from hamburg
#3
I have applied this patch to the dev version. Please let me know if it all works, and I will create a new RC
#4
Automatically closed -- issue fixed for 2 weeks with no activity.