Commit 4cc5af5a authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add allow multiple institutions setting in site options

parent 437a6c26
......@@ -146,6 +146,12 @@ $siteoptionform = pieform(array(
'defaultvalue' => get_config('defaultaccountinactivewarn'),
'help' => true,
),
'usersallowedmultipleinstitutions' => array(
'type' => 'checkbox',
'title' => get_string('usersallowedmultipleinstitutions','admin'),
'description' => get_string('usersallowedmultipleinstitutionsdescription','admin'),
'defaultvalue' => get_config('usersallowedmultipleinstitutions'),
),
'submit' => array(
'type' => 'submit',
'value' => get_string('updatesiteoptions','admin')
......@@ -171,8 +177,10 @@ function siteoptions_submit(Pieform $form, $values) {
siteoptions_fail($form, 'sessionlifetime');
}
// Submitted value is on/off; database entry should be 1/0
if (!set_config('viruschecking', (int) ($values['viruschecking'] == 'on'))) {
siteoptions_fail($form, 'viruschecking');
foreach(array('viruschecking', 'usersallowedmultipleinstitutions') as $checkbox) {
if (!set_config($checkbox, (int) ($values[$checkbox] == 'on'))) {
siteoptions_fail($form, $checkbox);
}
}
$form->json_reply(PIEFORM_OK, get_string('siteoptionsset','admin'));
}
......
......@@ -113,6 +113,8 @@ $string['siteoptionsset'] = 'Site options have been updated';
$string['sitethemedescription'] = ' ';
$string['theme'] = 'Theme';
$string['updatesiteoptions'] = 'Update site options';
$string['usersallowedmultipleinstitutions'] = 'Users allowed multiple institutions';
$string['usersallowedmultipleinstitutionsdescription'] = 'If checked, users can be members of several institutions at the same time';
$string['viruschecking'] = 'Virus checking';
$string['viruscheckingdescription'] = 'If checked, virus checking will be enabled for all uploaded files using ClamAV';
$string['searchplugin'] = 'Search plugin';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment