Configuration Reference: Administration Settings
Each parameter in the Site Administration block menus can be configured via the config.php
file. If a value has been set via this method, it is effectively hardcoded and cannot be changed via the Moodle interface; not even by the administrator.
For example, you might want to make sure that an administrator does not, even by accident, turn on https for logins. Turning this on would lock everybody out of the site if no SSL certificate is installed. To do this, enter the following line in config.php:
$CFG->loginhttps=false
;
How do you know what the parameter is called? Go to the respective setting in Moodle (in this case Security | HTTP security) and you will see the name of the parameter underneath the label.
If value is specified in config.php
, Moodle will display Defined in config.php besides the parameter, which indicates that the setting cannot be changed by the user. Invalid values are also shown for these hardcoded settings. In the following screenshot, the Debug messages value is incorrect while the Display debug messages value is correct:
The value that a parameter accepts depends on the type of setting. The table provides information for each type:
Type |
Moodle Field |
Values |
---|---|---|
Binary |
Checkbox |
True or 0 and false or 0. |
Numeric |
Number Field |
The number. |
String |
Text Field |
Text has to be surrounded by single quotes. |
Password |
Password Field |
Passwords have to be surrounded by single quotes. |
List |
Pull-Down Menu |
Each value is represented by a number. Unfortunately, there is no consistency for the allocation. For example, while the debug parameter accepts the values 0, 5, 15, 6143, and 38911, the sitemailcharset parameter accepts 0, EUC-JP, and GB18030! The easiest way to find out what values are valid is to check the database. Go to |
Array |
Multi-select Menu |
The same applies as for the list type. Values are separated by commas. Again, check |
There are some other special types that are mentioned when applicable. For each parameter, the type is put in brackets in the reference part of this appendix.