How can i create another user with the same privileges as the user you create right after installation? I want to have 2 or 3 of those users for a single site.

Do I need to create a new access role and check off every box? Is there an easier way?

Thanks

Comments

venkat-rk’s picture

Do I need to create a new access role and check off every box? Is there an easier way?

Unfortunately, no other way. Of course, the code wizards may have some ideas, but generally, this is the only way:-)

rszrama’s picture

If you wanted, in user.module there is a function called user_access. Here you can find an if check resembling this:


  // User #1 has all privileges:
  if ($account->uid == 1) {
    return 1;
  }

You can change the condition statement to:


  if ($account->uid == 1 || $account->uid == x) {

where x is the id number of the other person you want the hack to apply to. The problem here is of course that this is a hack. ^_^ It will always give them access, and you can't forget it's there. Especially if you're running multiple sites where user ID's might be different and you could inadvertently give some random dude complete control of the site. I recommend creating the access role, as it's really not that much work for better security and useability.

magnusprime’s picture

Thanks for the answers. I think the hack is a bad way to go, so I will create the access role. It will be better in the long run.