Get HTTP security settings from the database

Get HTTP security settings from the database

by John Lu -
Number of replies: 3

Hi

I was wondering where can I get this value from the database? (/admin/settings.php?section=httpsecurity), I couldn't find it in mdl_config? 


Average of ratings: -
In reply to John Lu

Re: Get HTTP security settings from the database

by Michael Aherne -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Have you tried get_config('core', 'loginhttps')? If it's not in there there's probably something wrong with your installation.

In reply to John Lu

Re: Get HTTP security settings from the database

by Trevor Furtado -
Picture of Plugin developers

What's your Moodle version?


Here in 2.7 and 3.1

select * from mdl_config where name like 'loginhttps'

return:

206;"loginhttps";"0"
In reply to John Lu

Re: Get HTTP security settings from the database

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

This normally works:

SELECT * FROM mdl_config WHERE name = 'loginhttps';

Michael is right though, in PHP code you should use get_config().