How do you change the primary admin

How do you change the primary admin

by Gary Attwood -
Number of replies: 15
I am moving on from the company I work for and need to hand the moodle site over to the new administrator.

How do we change the primary admin?

Gary
Average of ratings: Useful (1)
In reply to Gary Attwood

Re: How do you change the primary admin

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
As far as I remember: the admin with the lowest usernumber is the primary admin. Can someone confirm this (and write it in the documentation big grin)?
In reply to koen roggemans

Re: How do you change the primary admin

by Ray Lawrence -
Hi Gary,

If you assign another Admin to the site you will then be able to remove yourself as the primary Admin. See:

Home » Administration » Users » Assign admins

On numbers: it appears that Guest is number one, initial Admin is number 2. I just changed the Primary Admin to user number 4 and the initial Admin to an ordinary user without difficulty (other than trying to remember the new Admin's password so that I could log in to revert to the original Admin).

I think that's enough Admins for one post.

Ray
Average of ratings: Useful (1)
In reply to Ray Lawrence

Re: How do you change the primary admin

by Gary Attwood -
Thanks very much. Very useful and well explained.

Gary
In reply to Ray Lawrence

Re: How do you change the primary admin

by A. H. -
How can i have 2 primary admins at the same time? I really need to do this .
Thank you for your help
Average of ratings: Useful (1)
In reply to A. H.

Re: How do you change the primary admin

by Chris Lamb -

The way I've handled the problem of multiple Primary Admins is to not allocate the Primary Admin to an individual.  I'm not the Primary, I'm an ordinary Admin.  The Primary is a dummy account to which three members of staff have the username and password, in case they need it.

As far as I'm aware, the only thing which the Primary can do which other Admins can't is create new Admins (though I might be wrong) so I don't really see why you'd need multiple Primaries.

HTH

Chris

Average of ratings: Useful (1)
In reply to Chris Lamb

Re: How do you change the primary admin

by A. H. -
Chris,
You can edit the code such that any admin can add other admins. This was the only option missing to the secondary admin.

1- But can the primary admin "login as" your username (you being the secondary admin) and post things under ur name?

2- You can not edit the Profile of the primary admin, but can edit urs

I need to understand what differentiates the primary admin from the secondary (from within the code). Is it that the admin who has the lowest id number is the primary?

amer
Average of ratings: Useful (1)
In reply to A. H.

Re: How do you change the primary admin

by Chris Lamb -

You can edit the code such that any admin can add other admins. This was the only option missing to the secondary admin.

That could be useful to do - perhaps as an option in a future release, so you don't have to re-write code.

1- But can the primary admin "login as" your username (you being the secondary admin) and post things under ur name?

I've just tried on one of our Moodles, and the Primary can't log in as a Secondary, though he can log in as a lesser user.  Presumably their levels are too close to be allowed to log in as each other.  (Creators can't log in as Teachers either, presumably for the same reason.)

2- You can not edit the Profile of the primary admin, but can edit urs

I don't think anyone can edit the profile of someone on the same or higher level as themselves.  This seems like a reasonable security measure.

I need to understand what differentiates the primary admin from the secondary (from within the code). Is it that the admin who has the lowest id number is the primary?

I don't know how it works, to be honest - hopefully someone else can tell you that.

Chris

In reply to Chris Lamb

Re: How do you change the primary admin

by Owen Stephens -
The Primary admin does seem to be the lowest numbered admin. You can make an alternative account the primary admin by removing admin privileges from the original primary admin - this will promote the next admin listed to 'primary'.

However, I can't see any way of having several 'primary' admins (except by hacking the code possibly)
In reply to Chris Lamb

Re: How do you change the primary admin

by A. H. -
2- You can not edit the Profile of the primary admin, but can edit urs

The primary admin can edit any one's profile including the secondary admin's.
The secondary admin can also edit any one's profile including other secondary admins except the primary admin's profile.

I am able to edit the code and allow ALL admins to edit the primary admin profile and ALL admins to add other admins smile. But I dont want this because the others will be editing mine too big grin.

My Target:
I am searching for a way such that only I and the primary admin be able to add other admins and neither I nor him can edit each other's profile
In reply to A. H.

Re: How do you change the primary admin

by Dave Solon -
So if you delete the primary admin account, will it automatically roll to the next lowest-numbered admin account?
In reply to Ray Lawrence

Re: How do you change the primary admin

by Jacob Lee -
This thread looked really helpful, but looking at our data I see that it doesn't follow the same logis as is layed out in you here.

Here is our data in the mdl_user_admin table (note I added the "users" column for clarity):
users
id
userid
General Admin
1
2
Chris
2
3
Jake
5
8
John
8
36
Johnathan
7
297

Ok, so here is he problem. I am "Jake", somehow I am also the Primary Admin. I need the Primary Admin to be Chris. How do I make that happen?

By what you described above the Primary Admin should be Chris, but it is not. I am leaving in 2 weeks from this job and need to turn it over but I can't seem to find a post that makes sense of this topic. Please help. Thanks.
In reply to Jacob Lee

Re: How do you change the primary admin

by Deleted user -

For lack of a better solution, give Chris your account, and have him change the name!!!

Example:

Edit Chris' profile, and change his EMAIL address to anything@whatever.com (since this has to be unique), and change his USERNAME to something like ChrisOldAdmin .

Edit Jakes profile, and change the Firstname=Chris, Lastname=Chris' Lastname, Email=Chris' Email Address, Username=Chris' Username, and Password=12345678 or whatever.

Now tell Chris to login into Jakes old account (which now has Chris' username), using password=12345678, and change the password to whatever Chris wants.

Make sure Jakes old account is working for Chris, and then delete Chris' old account (ChrisOldAdmin).

In reply to Deleted user

Re: How do you change the primary admin

by Jacob Lee -
Thanks for the suggestion Jeff. Do you think that will work when using LDAP accounts?

The real question is why is it such a mystery about how the primary admin is set? This seems fairly dangerous and as an administrator I would be very worried that I don't have access to key functionality (that being absolute control over user roles).
In reply to Jacob Lee

Re: How do you change the primary admin

by Chris Martin -

Anyone have any updates on how Primary Admin is flagged?  Is there a bit in the DB we can use?

This seems to be problematic when you can't control the primary admin designation.

In reply to Jacob Lee

Re: How do you change the primary admin

by Niklas Thrane -
I have the same problem with a moodle 1.8 installation.

I have to give my primary admin rights to the new webmaster.

I am not the webmaster any more but still a member of the site with many roles in many courses so i can not just change the name i my primary admin account in order to give my rights to the new webmaster.

I can not delete my account and create a new. I own to much content to do that.

So: How do i change the primay admin from me id=2 to the new webmaster id=1020 ?

I still can't find an up to date answer any where...

Regards,
Niklas Thrane