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

agentrickard’s picture

Status: Active » Postponed (maintainer needs more info)

Check your "New content settings' on the domain settings page.

From the README:

Defines the default behavior for content added to your site. By design, the
module automatically assigns all content to the currently active subdomain.
If this value is set to 'Show on all sites,' then all new content will be
assigned to all sites _in addition to_ the active subdomain.

agentrickard’s picture

Turning on the 'debug' option will help you test your configuration.

agentrickard’s picture

Also 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.

fseto’s picture

Thanks 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.

fseto’s picture

Ok... 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

agentrickard’s picture

Actually, it may be related to http://drupal.org/node/197757.

Make sure the following is _not_ in your {node_access} table.

nid       gid       realm         grant_view   grant_update   grant_delete
0         *         domain_site    1            0              0

Where * is a domain_id.

fseto’s picture

this looks alright, doesn't it?

mysql> select * from node_access ;
+-----+-----+---------------+------------+--------------+--------------+
| nid | gid | realm         | grant_view | grant_update | grant_delete |
+-----+-----+---------------+------------+--------------+--------------+
|   0 |   0 | all           |          1 |            0 |            0 | 
|   0 |   0 | domain_all    |          1 |            0 |            0 | 
|   2 |   4 | domain_id     |          1 |            0 |            0 | 
|   1 |   1 | domain_id     |          1 |            0 |            0 | 
|   1 |   1 | domain_editor |          0 |            1 |            1 | 
|   2 |   4 | domain_editor |          0 |            1 |            1 | 
+-----+-----+---------------+------------+--------------+--------------+
fseto’s picture

hooray! 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!

derjochenmeyer’s picture

In 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.

fseto’s picture

derjochenmeyer: Probably not... I don't even know where is the "batch node access editing options". =)

agentrickard’s picture

Batch node editing options are part of the Domain Content module.

When installing the module, this row should have been deleted:

+-----+-----+---------------+------------+--------------+--------------+
| nid | gid | realm         | grant_view | grant_update | grant_delete |
+-----+-----+---------------+------------+--------------+--------------+
|   0 |   0 | all           |          1 |            0 |            0 | 

This would cause all nodes to be viewable on all domains. It should have been deleted when you enabled the Domain Access module.

fseto’s picture

I'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....

agentrickard’s picture

Category: support » bug
Status: Postponed (maintainer needs more info) » Active

You 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?

fseto’s picture

The 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!

agentrickard’s picture

Thanks, I'll try to run a few tests.

For your use, if you delete that 'all' grant, you should be fine.

agentrickard’s picture

Status: Active » Closed (fixed)

OK, I have cleaned up domain_enable() and domain_disable() to account for this issue.

Fix committed to HEAD.