liip/moodle-local_confseed

Name: moodle-local_confseed

Owner: Liip

Description: Moodle 'local' plugin to seed configuration to DB at installation or upgrade time

Created: 2018-04-30 08:04:17.0

Updated: 2018-04-30 09:44:58.0

Pushed: 2018-04-30 13:09:52.0

Homepage: null

Size: 43

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

local/confseed - A Moodle settings enforcer for custom developments

This plugin allows the automated setup of various configurations that are usually hard to setup through config.php.

Syntax

It uses a special file config-seed.php containing only the $CONFSEED configuration variable, which is a stdClass in which attributes can be set to be enforced at upgrade time:

config-seed.php example

FSEED = new stdClass();
FSEED->version = 2017110800;
et some values.
FSEED->settings = array(
heme' => 'boost',
nablewebservices' => 1,

et some plugin values (like 'moodlecourse | format')
FSEED->plugin_settings = array(
oodlecourse' => array (
'format' => 'weeks'


ninstall certain plugins; all the pre-2.7 themes are uninstalled forcibly if the variable is set.
FSEED->uninstall_plugins = array(
'theme_oldmamma',

reate user profile categories.
FSEED->user_info_categories = array(
ood' => (object) array(
'id' => 1,
'name' => 'Alimentary restrictions',
'sortorder' => 1,



reate user profile fields.
FSEED->user_info_fields = array(
eat' => (object) array(
'category' => 'food',
'name' => 'I eat meat',
'required' => false,
'signup' => true,
'datatype' => 'checkbox',
'defaultdata' => false

reetext' => (object) array(
'category' => 'food',
'name' => 'Comments ?',
'signup' => true,
'datatype' => 'text',
'param1' => 60, // Display size.
'param2' => 512, // Maximum length.


nable or disable certain authentications.
FSEED->auth_enable = ['cas', ];
FSEED->auth_disable = ['email', ];
nable or disable certain enrolment methods.
FSEED->enrol_enable = ['database', ];
FSEED->enrol_disable = ['self', ];
how or hide certain activity modules.
FSEED->mod_show = ['assignment', ];
FSEED->mod_hide = ['book', ];
nable or disable certain webservices protocols.
FSEED->wsprotocols_enable = ['rest', ];
FSEED->wsprotocols_disable = ['soap', ];

Limitations

Due to Moodle Core forcibly setting the registerauth setting upon install, it is not possible for local_confseed to seed this variable upon install. It does work upon upgrade though.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.