Hi,
I'm just checking if I'm missing something simple here. I have a user I'm trying to give the administrative ability of creating user domains to upon their creation of a new user. Creating user domains works if I'm add a new users as user/1 or if anonymous is given "create personal domain" permission. However, in my use case, I can't allow anonymous users ( as documented here-- http://drupal.org/node/709592#comment-2583686 ) or even just any authenticated user to be able to just create subdomains willy-nilly when registering to leave a comment on a blog post.
Looking at line 200 of domain_user.module, I see:
if (!empty($edit['domain_create_user']) && (user_access('create personal domain', $account) || !user_access('create user domains'))) {
Shouldn't this be:
if (!empty($edit['domain_create_user']) && (user_access('create personal domain', $account) || user_access('create user domains'))) {
The former evaluates to TRUE and creates a new subdomain only if they've selected the box to do so and they've either been given permission to create a personal domain or they are NOT allowed to create user domains, which seems odd since if they were given this permission, this is where it would happen. Thus, this seems like a typo or something causing the logic to be completely opposite to what is intended.
Perhaps I'm missing something? Or this has been fixed already in 6.x-2.9?
Comments
Comment #1
agentrickardI haven't touched Domain User in months. I don't actually use it, and in D7 it is a separate module in search of a maintainer.
I suspect you are correct, especially if you look at the IF statement (which should probably be an ELSE) on line 245.
The simple way around this (and why it was likely never caught) is for the admin user to also have 'create personal domain' as a permission.
Otherwise, patches welcome.
Comment #2
agentrickardThat whole code block really should be refactored to move the permission checks to the form element, and simply perform the creation here if the data is present.
Comment #3
digitalfrontiersmediaThanks, agentrickard. Will take a look if I have time in next week. Will provide patch.
Comment #4
dqdI'll close this issue due to inactivity for 14 years and even if I would move it to the next nearest core version which is 7, there is upcoming EOL of Drupal 7 in January 2025. While the project's version for Drupal 7 will surely keep providing support for security issues and website breaking bug fixes for Drupal 7, we should try to minimize the open issues for Drupal 7 in the queue as much as possible. A big thanks around for the report and all the efforts in here. Feel free to re-open if you can provide a fix or found an additional related problem which increases the issue priority.