Get HTTP security settings from the database

Get HTTP security settings from the database

ni 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

ni Michael Aherne -
Larawan ng Core developers Larawan ng Particularly helpful Moodlers Larawan ng Peer reviewers Larawan ng 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

ni Trevor Furtado -
Larawan ng 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

ni David Mudrák -
Larawan ng Core developers Larawan ng Documentation writers Larawan ng Moodle HQ Larawan ng Particularly helpful Moodlers Larawan ng Peer reviewers Larawan ng Plugin developers Larawan ng Plugins guardians Larawan ng Testers Larawan ng Translators

This normally works:

SELECT * FROM mdl_config WHERE name = 'loginhttps';

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