http://moodle.org/mod/forum/discuss.php?d=103995
My script...
http://moodle.org/file.php/5/moddata/forum/941/459809/adminfix.php
...can get you out of trouble quite often (it resets everything to do with roles)
I'm glad it worked! thanks for your help.
I've looked at the SQL database, but I'm not sure what attribute needs to be restored.
Thanks for your help.
The instructions are in the comments at the top.
If it is unclear to others how to use this file, here is a short explanation.
- Drop this file (ftp, etc.) in the root directory of your server
- Direct your browser to http://yourserver/adminfix.php
Note: The admin password is changed to 'moodle' and all of the roles are reset. The file must be removed after it is used. This new version of adminfix.php tries to remove itself. If it reports that it cannot remove it, you need to remove it manually. If the removal went ok, you are redirected to login and to reset your password.
The modified file is located at http://moodle.org/file.php/5/moddata/forum/941/466477/adminfix.php
Jack Briner
http://jacksjots.com

Thanks to the above was finally able to get the admin rights back for the course.
So again to all those so will to offer help and advice thanks!!!!
Michael Mc S
-Max
All I got when I ran this file was:
"RESETING DEFAULT ROLES
RELOADING CONTEXT"
The page status said "done". No error message about not being able to remove itself, and adminfix.php remains on the server... My password hadn't changed, either.
I took a quick look at the script and it certainly appears that I should get more mesages than I am getting.
Please help!
I am tryign to run the adminfix.php.
I get the 404 error. I know the server is working because I can go to standard login ok. I placed the file in the Moodle root which in our case is http://myschool/moodle/ My school is a psuedonym.
I use a simular http://myschool/moodle/adminfix.php and get the 404 error.
Any ideas why it can find the file.
Ivan
Hello anybody,
Do I need to compile the PHP file to get it to be recognized. I am new to PHP.
Ivan
Hi Tim,
I did make sure it was under the moodle folder in the place where our config.php is located.
Ivan
I could reallu use some help. I know I messed up by reseting authenticated role to be pretty much everything as prohit. I can not get in to do any administration. We are starting a new class in October and I have to get back in.
I have uploaded the adminfix.php using WS-FTP to the server under the root which is /moodle. It is in the same areas as the config.php.
All I get is the 404 page not found. I don't know PHP and how to get it to recognize the file is there.
Ivan
Just updated ubuntu and my moodle to 1.9.4.
Everything seemed fine, but I have one course where I am missing the centre and right side blocks. Most importantly I am missing the Admin block. When I change roles to Student things appear as normal. I can turn editing on and off, but I cannot add blocks.
The rest of my courses are good. I tried creating a new course and everything worked.
I tried the adminfix.php script with no improvement.
Hope someone has an idea for me.
mydomainname/path_to_moodle/admin/index.php
If you can get an error use it as a search term on google, or post here.
If no error go into Server -> Debugging and enable. See if you get any error output now on the screens not displaying properly.
Direct path to debug screen is
admin/settings.php?section=debugging
Again you can try entering directly into your browser location if navigation is broken.
If you get debugging on repeat the process of putting the errors into Google or the forums to see if it finds solution to the exact error you are getting.
Thinks are working now, thanks.
Anyone know where I can get this admin_fix.php? I'm locked out of 1.7