Hi,
I'm new to Domain Access, it's seems to be exactly what I'm looking for from looking at the doc. Here's my problem:
After "local editor" create a new node from a subdomain (ie. one.example.com). The new node is showing up on ALL of the subdomain (*.example.com).
Here are my settings for the local editor:
check Use access control for editors
clear administer domains
clear edit domain nodes
clear set domain access
I tried to track down what could be the problem, and hack up the debug display on domain_nodeapi to show the following var:
$_domain
* domain_id:4
* subdomain:xn--btvn2d.xn--74qu15c.tw
* sitename:shunlin
* scheme:http
* valid:1
* path:http://xn--btvn2d.xn--74qu15c.tw
* site_grant:1
$node->domains
* 0:1
I'm using Drupal 5.3, no OG, and don't have either of the 2 patch installed right now (but installing them didn't make a difference). Added the line for domain_conf.inc to settings.php. Got all of domain* modules enabled except for domain_prefix.
So I'm at a lost on where to go from here. It looks like the logic on whether to display the node is not working correctly. Most likely it's an installation problem on my side... but where do I go from here? Thanks!
Comments
Comment #1
agentrickardCheck your "New content settings' on the domain settings page.
From the README:
Comment #2
agentrickardTurning on the 'debug' option will help you test your configuration.
Comment #3
agentrickardAlso remember that if you view your site as user 1 or as a user with 'administer node' permissions, then node access checks are ignored. This is a core Drupal behavior.
You need to test your site as a non-privileged user. The Devel module's user switching block is good for this.
Comment #4
fseto commentedThanks for the quick response!
- I've confirm that it's set to "Only show on selected sites".
- viewing from a VM that's not logged in to any sites (anonymous).
- "administer node" is clear for everyone.
- already enabled the debugging, and the setting looks right... it only shows 1 subdomain. But the content is still showing up on all
Where to go from here? Perhaps I should sparkle some debug statements on the hook where it determines whether to display the node or not? Thanks again.
Comment #5
fseto commentedOk... to eliminate potential conflicts, I did a clean install of 5.3 with only domain access module enabled.
Still the same problem. (As a side note, to view the debug info, the user needs to have "set domain access" as oppose to "administer domain" in the help text in admin/build/domain).
I can clearly see that the subdomain is correct..., but the node is still showing on all the subdomains. =/
Subdomains
* 板橋.杜克.tw
Editors
* 板橋.杜克.tw
Is there some sort of apache rewrite rules that needs to be done? The only other possible difference is that instead of using wildcard DNS, I actually have a CNAME for each subdomain to my dynamic DNS host. ie:
www.example.com => CNAME: realhost.dyndns.com
one.example.com => CNAME: realhost.dyndns.com
two.example.com => CNAME: realhost.dyndns.com
Argggh.. this is mind-blogging. =P
Comment #6
agentrickardActually, it may be related to http://drupal.org/node/197757.
Make sure the following is _not_ in your {node_access} table.
Where * is a domain_id.
Comment #7
fseto commentedthis looks alright, doesn't it?
Comment #8
fseto commentedhooray! I deleted nid =0, realm = all entry, and things seems to be working as it's suppose to.
Looking at the source, it looks like it might be set by node_access_acquire_grants()?!? But I don't know enough about drupal to know the interworkings of node_access stuff. Is deleting that entry, the right solution? or just a bandaid?
Thanks for your help and guidance, as always!
Comment #9
derjochenmeyer commentedIn order to track this down: I had a similar Problem (http://drupal.org/node/197757).
fseto, did you use the batch node access editing options? Maybe i can relate my Error (chronologically) to having used this feature.
Comment #10
fseto commentedderjochenmeyer: Probably not... I don't even know where is the "batch node access editing options". =)
Comment #11
agentrickardBatch node editing options are part of the Domain Content module.
When installing the module, this row should have been deleted:
This would cause all nodes to be viewable on all domains. It should have been deleted when you enabled the Domain Access module.
Comment #12
fseto commentedI'm pretty sure I didn't run into batch node editing.
In the last run (when I dump the node_access), it was a clean drupal install plus the domain access mod. Now, one thing that I didn't do (but maybe should have), is run update.php. I figure that it was the first install, I wouldn't need to do that....
Comment #13
agentrickardYou should not need to run update.php.
There may be an issue with the module enable routine for Domain Access. I'll have to do some testing.
One other question:
-- Did you edit any of the defined variables -- DOMAIN_INSTALL_RULE, DOMAIN_EDITOR_RULE -- before installing the module?
Comment #14
fseto commentedThe first time I did the installation, I did not initially, but still have the "all" entry in the realm. (I enabled the module before noticing the instruction to modify setting.php & possibly domain.module).
The 2nd and last install, I edit the .module as follows:
define('DOMAIN_INSTALL_RULE', FALSE);
define('DOMAIN_EDITOR_RULE', TRUE);
define('DOMAIN_SITE_GRANT', TRUE);
Thanks!
Comment #15
agentrickardThanks, I'll try to run a few tests.
For your use, if you delete that 'all' grant, you should be fine.
Comment #16
agentrickardOK, I have cleaned up domain_enable() and domain_disable() to account for this issue.
Fix committed to HEAD.