Commit 5cec3fb4 authored by Robert Lyon's avatar Robert Lyon

Delete button on User's Settings page for 'no institution'

Bug 1480038 - When the registerallowed is turned off - this is wrong

Change-Id: Ib511a1c372a15cddd9fd7329cfa93cc72dac412f
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 8df87b1d
......@@ -1258,9 +1258,16 @@ class User {
// Users who belong to an institution that doesn't allow
// registration cannot delete themselves.
foreach ($this->get('institutions') as $i) {
if (!$i->registerallowed) {
return false;
$institutions = $this->get('institutions');
if (empty($institutions)) {
// only in the no institution
return get_field('institution', 'registerallowed', 'name', 'mahara');
}
else {
foreach ($institutions as $i) {
if (!$i->registerallowed) {
return false;
}
}
}
return true;
......
......@@ -15,3 +15,4 @@ Feature: Mahara users can change their account settings
And I select "Email" from "activity_viewaccess"
And I press "Save"
Then I should see "Preferences saved"
And I should not see "Delete account"
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