Site Admin unable to add new users
| Project: | Membership types and registration modification |
| Version: | 5.x-1.4 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | rconstantine |
| Status: | closed |
Jump to:
Hi,
Installed this module and got it working perfectly... almost.
I have set up a site_admin role who is to have limited admin access to the website but one of the key tasks of this role is to manage user accounts, including creating new users. However, upon clicking the 'Add User' link the site admin user is presented with an 'Access Denied' page. Now, knowing that this module inserts a new step in the create user process by sending the user to 'user/membership_select?destination=admin%2Fuser%2Fuser%2Fcreate' I thought it was to do with line 105:
$mem_select_access = ($user->uid == 0 ? TRUE : FALSE) || ($user->uid == 1? TRUE : FALSE);So I tried changing this to:
$mem_select_access = ($user->uid == 0 ? TRUE : FALSE) || ( user_access('administer users') );This still did not work, so thought I'd try something ridiculous (since I'm desperate for this to work right now) such as:
$mem_select_access = TRUE;But alas, still the 'Access Denied' page.
Could you please advise what may need to be done to allow anybody who is assigned the 'administer users' permission to complete this process. I have marked this as 'critical' as I imagine this is quite an important function for anyone else making use of this module.
Your time is very much appreciated. Thank you.

#1
Can you create new users as user 1? I can, so you should be able to. If you can confirm that, then we'll start from there.
#2
Sorry, yes user 1 can create new users. Which is why I didn't discover the problem until I started setting up 'proper' admin roles since it is recommended not to use user 1 for general management of your website.
Cheers.
#3
Okay then. Can you list for me the permissions that you've given your admin so I can duplicate it?
#4
I have a truck load of modules so hopefully the following are the relevant ones you need to know. Let me know if there is anything else specific you think is required.
nf_registration_mod module
- administer registration pageroutes
node module
- administer content types
- administer nodes
- edit content
refers to various content types I’ve created that general members are to complete. Admin has no need to enter such details so have not included the ‘create content’ and ‘edit own content’ options for each new content type. However, when I did assign these permissions to admin for testing this did not resolve the issue either.
pageroute_ui module
- administer pageroutes
system module
- access administration pages
user module
- access user profiles
- administer access control
- administer users
Thank you for looking into this.
Cheers.
#5
oops, should always preview before submit - sorry. The node module section should read as follows (used angle brackets in first post - duh!):
node module
- administer content types
- administer nodes
- edit [this] content
[this] refers to various content types I’ve created that general members are to complete. Admin has no need to enter such details so have not included the ‘create [this] content’ and ‘edit own [this] content’ options for each new content type. However, when I did assign these permissions to admin for testing this did not resolve the issue either.
#6
Will get around to this soon.
#7
Hi,
You might want to hold off on this - unless of course you find you can replicate the problem :)
We have just installed another website with the same configurations etc and this seems to be working, i.e. an admin user other than user 1 can add new users. Obviously something has gone wrong on the other website and goodness knows how we're going to find what that is.
Meanwhile, I thank you for your commitment so far and apologize sincerely if it seems I have raised a false alarm.
Should we discover what went wrong with our original website, I will certainly let you know.
Cheers.
#8
#9
Okay, I was able to duplicate the problem, so I'll investigate.
#10
Found the problem. It was this line:
$mem_select_access = ($user->uid == 0 ? TRUE : FALSE) || ($user->uid == 1? TRUE : FALSE);It should read:
$mem_select_access = ($user->uid == 0 ? TRUE : FALSE) || ($user->uid == 1? TRUE : FALSE) || user_access('administer users');Will be in the next release.
#11
Automatically closed -- issue fixed for two weeks with no activity.