Commit 7596bef1 authored by Elliot Pahl's avatar Elliot Pahl Committed by Elliot Pahl
Browse files

Fix check for ['copynewuser'] in view access page.

parent 0a58eb08
......@@ -223,7 +223,7 @@ $form['elements']['submit'] = array(
function editaccess_validate(Pieform $form, $values) {
global $institution, $group;
if ($values['copynewuser'] && !$values['template']) {
if ($institution && $values['copynewuser'] && !$values['template']) {
$form->set_error('copynewuser', get_string('viewscopiedfornewusersmustbecopyable', 'view'));
}
$createforgroup = false;
......@@ -260,7 +260,7 @@ function editaccess_validate(Pieform $form, $values) {
}
}
// Must have logged in user access for copy new user/group settings.
if (($createforgroup || $values['copynewuser']) && !$loggedinaccess) {
if (($createforgroup || ($institution && $values['copynewuser'])) && !$loggedinaccess) {
$form->set_error('accesslist', get_string('copynewusergroupneedsloggedinaccess', 'view'));
}
}
......
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