Unable to Login, possible corrupt install?

Unable to Login, possible corrupt install?

by Evan Brunken -
Number of replies: 8

Good Evening everyone,

I am trying to help a customer of mine get access to their website that was setup on moodle.  Unfortunately, the individual who set it up left town and did not give any details of the site to the owner.  Enter me, I am trying to access the information and piece it all together.

From what I can tell, the person who set it up loaded moodle to the site and it is running the following:

Running version  = 2013111801.09, release  = '2.6.1+ (Build: 20140220)

When I try to access the admin site for the page, it does not display the test site in the same fashion as what I see on youtube and in screenshots.  Phpmyadmin is setup, and I have tried changing the user passwords in it under the user entries (there were 2 different locations and set them to MD5) and unfortunately it hasn’t let me in.  Is it an issue with the build of moodle or the install?

Bonus: The person who built the database uploaded all the files to it but then took the originals, so I am hoping that someone can help me come up with an idea of how to get in and not learn all is lost.

I apologize since this is my first time toying with Moodle.  From what I see it’s quite user friendly and I feel that once I get in to the admin console I can take care of things from there.  I apologize if I haven’t provided enough information.  If there is anything else I can provide please ask and I will be happy to get any and all info.


Attachment loginpage.PNG
Average of ratings: -
In reply to Evan Brunken

Re: Unable to Login, possible corrupt install?

by Evan Brunken -
Was this the old interface for that version or am I going about it wrong to get to admin panel?
In reply to Evan Brunken

Re: Unable to Login, possible corrupt install?

by Ken Task -
Picture of Particularly helpful Moodlers

Inheriting a site with no info left is kinda tough.   Lot's to learn/check.

Will say that 2.6.x is pretty old and many may not even remember what screens looked like back then (moodle now 3.9).

So ... a couple of questions and depending upon answers might have some suggestions/things for you to try.

1. where hosted?  Provider (like Self/SiteGround/DigialOcean) and how (like shared/VPS).

2. Is OS linux?   IF so what flavor?  Ubuntu/CentOS/Debian (hopefully not Windows).

The admin login screen is same as for users ... moodle uses a inline theme for all ... only the icons and menus change for user role in/on system.

So if you login and see no Site Admin menu then the login you are using isn't set to be an admin level user.

Do you have an account?   What is the user ID? (you can see that ID after logging on).

If not an admin level, one can cheat and make any account an admin level but one has to have access to the files in the code directory and be able to edit config.php file.

One could add a line to config.php, like so:

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

ID 2, BTW, was/is the user that installed the Moodle.

Then login ... see a site admin Menu link in menus?

There is also a way to change the password of User ID 2 via command line which requires terminal access to server, locating moodlecode/admin/cli/ and executing a php script:

php reset_password.php

Account must be a manual account - which user ID 2 should be (unless someone changed it).

Firist, one is prompted for the account login.  If found, you would be prompted to enter a new password.

To find user ID 2 info, query the DB for moodle mdl_user table, like so:

mysql> select username,email from mdl_user where id='2';

username in output above is login name.

That's enough 'fun' for now, isn't it? smile

'SoS', Ken

In reply to Ken Task

Re: Unable to Login, possible corrupt install?

by Evan Brunken -

Hello Ken,

Thanks for the info and advice, I was able to locate the user files and make the changes to it.  Currently working on getting the sql updates loaded to the server.  The site is being hosted on hostgator since the customer uses them for multiple sites.  The reason my info was being rejected was because I was altering the wrong user database.  Upon investigating the config.php file I saw where the pointers were and was able to make the required changes.  I am in a Windows environment but also have Kali so I would say its Debian.  I will post whether I get this resolved or not, but thank you again for your help as it pointed me in the right direction.


-Evan

In reply to Evan Brunken

Re: Unable to Login, possible corrupt install?

by Ken Task -
Picture of Particularly helpful Moodlers

See you are getting plenty of advice now ... that's good ...

Hostgator should have some sort of panel (cPanel) that you can log into.  Probably by IP address with a port.

cPanel's File Browser will allow at least poking around ... finding where things are located ... and it's probably what you used to edit config.php.   There is a version.php file that contains version of Moodle.

Let's not confuse questions about what you use to connect to server with what operating system the server is running.   OS makes a difference.   cPanel should show something about that.

Also ... cPanel might have a 'Terminal' icon ... that's command line.   If it doesn't, contact hostgator help desk and ask if that could be installed.

Can customer share one login/pass with you?  Can they login?

IF so, you could make that user temp admin and use that account to login by adding a line to config.php.

$CFG->siteadmins='IDNUMBEROFACCOUNT';

Should be able to login with that account then and see the 'Site Admin Menu'.

'SoS', Ken


In reply to Ken Task

Re: Unable to Login, possible corrupt install?

by Evan Brunken -
Hello Ken,

I had updated the mysqli database in phpmyadmin and reset the password hash in MD5 to something I assigned, and also attempted to place it in the config.php file but am unable to get the login to work. I get the feeling its because the changes I have made on phpmyadmin hadn't published to the site and pushed the info out to the php portion...any chance you could either send me a link of where to find some info on it or offer any advice? I had just loaded a laptop with ubuntu but definitely feel like I'm missing something.

Thanks,

Evan
In reply to Evan Brunken

Re: Unable to Login, possible corrupt install?

by Colin Fraser -
Picture of Documentation writers Picture of Testers
Just to butt in, the text based page, like your image above, happens when the wwwroot is incorrect, and is not connecting via a server environment but that's from memory so I may not have it right. I suspect it's not loading the php or javascripting elements properly. I seem to recall fixing this in the config.php file, changing it to the full ip address, like "https:\\10.1.1.7\moodle" (as an example, yours will be different). I can't recall if I had to go in and edit the php.ini file but I know I was doing something in there. It may have been the installation of php itself wasn't configured properly that causes this problem. You might also want to check your .htaccess file if you have one, see of there is something there that might be interfering.
As for changing passwords, in phpmyAdmin, I've always replaced forgotten passwords with the same password hash as Guest, which is, of course, "guest", seems to work for me. It's a copy and paste, then go in and change the password via Moodle. That way I don't get mucked around by making a mess of the password hash.
May or may not be helpful, but I am not the programmer that Ken is..smile .
In reply to Evan Brunken

Re: Unable to Login, possible corrupt install?

by Evan Brunken -

I attempted to make said changes in phpmyadmin as well as the config.php file to no avail.  I feel I may be missing something rudimentary here...I am wondering if I were to upgrade the site to the newest form of moodle would it compromise the data as it seems this may be a corrupt version on the server?  Just trying to figure out any in's before I end up having to start from scratch and tell the customer to go purchase their training manuals etc again.


Thank you all for the advice and input thus far.  It is appreciated as I try to navigate this.

In reply to Evan Brunken

Re: Unable to Login, possible corrupt install?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Patient abandoned? The new doctor is from a different field? Hope, this'll end up well! smile

Take a https://docs.moodle.org/26/en/Site_backup and download those three things to your local computer. If the worst should happen, a Moodle person could https://docs.moodle.org/26/en/Site_restore your site somewhere else. Also carefully document the changes you have done so far.

After doing that, let's visit your original problem. The "text" login page is not a problem for a Moodle administrator, if he could log in as 'admin'. You have tried one method of recovering the admin's password. Here's another: https://docs.moodle.org/26/en/Administration_via_command_line#Reset_user_password.

And, don't change anything major, like system upgrades, in the mean time! Each Moodle release works only under a narrow set of system software. Ref. http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases.