How do I add a user as Admin using command line

Re: How do I add a user as Admin using command line

by Ken Task -
Number of replies: 0
Picture of Particularly helpful Moodlers
resetpassword script requires you to give a manual account login.

You could find all accounts on system that have manual auth using mysql client on the DB for your moodle:

select username,firstname,lastname,email from mdl_user where auth='manual';

Just because you create an account with username 'admin' doesn't make that account a moodle admin.

Suggest doing this:
You know your account ID - you can see it when you login.
Let's say that ID number is 25.

Add to config.php file the following line:

$CFG->siteadmins='2,25';

The 2 is there because that was the original admin account which might not have 'admin' as it's user name.   The 25 is your account.

Log out, then log back in.

Do you see the Site Administration menu?

'SoS', Ken

Average of ratings: Useful (1)