Site Admin unable to add new users

webbasics - October 14, 2007 - 00:41
Project:Membership types and registration modification
Version:5.x-1.4
Component:Code
Category:bug report
Priority:normal
Assigned:rconstantine
Status:closed
Description

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

rconstantine - October 14, 2007 - 06:16

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

webbasics - October 15, 2007 - 01:08

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

rconstantine - October 15, 2007 - 21:17

Okay then. Can you list for me the permissions that you've given your admin so I can duplicate it?

#4

webbasics - October 16, 2007 - 04:30

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

webbasics - October 16, 2007 - 04:37

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

rconstantine - October 26, 2007 - 21:24

Will get around to this soon.

#7

webbasics - October 31, 2007 - 01:43

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

rconstantine - November 25, 2007 - 05:24
Priority:critical» minor

#9

rconstantine - December 3, 2007 - 20:38
Version:5.x-1.2» 5.x-1.4
Component:User interface» Code
Category:support request» bug report
Priority:minor» normal
Assigned to:Anonymous» rconstantine

Okay, I was able to duplicate the problem, so I'll investigate.

#10

rconstantine - December 3, 2007 - 20:55
Status:active» fixed

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

Anonymous - December 17, 2007 - 21:02
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.