Cannot find 'loginhttps' in mdl_config

Cannot find 'loginhttps' in mdl_config

by Esli Verheggen -
Number of replies: 3

Hi all, 

I'm afraid I made a mistake and I am not sure how to fix it. I have obtained an SSL certificate for our domain, but forgot to enable the option 'use HTTPS for logins' beforehand. As you might expect, I am now locked out of our Moodle server and somehow the lay-out of our page has also faulted. 

I have learned that there should be an easy way to fix this mistake by enablign loginhttps using phpMyAdmin over the hosting provider. I have managed to use SQL and find the file 'mdl_config' where the 'loginghttps' value should be located. Unfortunately, it is not (see screenshot below). 

 
I do not understand why the value is not here and I am looking for tips on how we can access our site again. As you understand, this is of a rather great concern to me and any help would be more than greatly appreciated. 


Average of ratings: -
In reply to Esli Verheggen

Re: Cannot find 'loginhttps' in mdl_config

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If you're not seeing a setting in that table, it means it hasn't been set. You can either create a record with name = 'loginhttps', value = 1 (you'll probably need to purge caches as well), or you could add $CFG->loginhttps = 1; to your config.php (which will always override what's set in the database).

An alternative would be to set your $CFG->wwwroot to start with https://, which is sensible in any case. There's no reason to use https only for login.
Average of ratings: Useful (2)
In reply to Mark Johnson

Re: Cannot find 'loginhttps' in mdl_config

by Esli Verheggen -
Many thanks, Mark! 

I made the change you suggested and adding this one 's' to the wwwroot did the trick.
Just in case anyone else is having a similiar question, I had to spend some more time locating the right config.php file. In my case it was located in: httpdocs / config.php.

Also, there is some useful documentation on transitioning to HTTPS behind this link, which I wish I would've read before starting off glimlach