Skip to content

Commit

Permalink
Fix #70: Set config even if user does not have 'maharaws:configure' p…
Browse files Browse the repository at this point in the history
…ermission
  • Loading branch information
djarran committed Oct 8, 2024
1 parent 3bdedcf commit c67f696
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,18 @@ public function save_settings(stdClass $data) {
$this->set_config('key', $data->assignsubmission_maharaws_key);
$this->set_config('secret', $data->assignsubmission_maharaws_secret);
}
$this->set_config('debug', false);
$this->set_config('remoteuser', false);

$this->set_config('lock', $data->assignsubmission_maharaws_lockpages);
$this->set_config('username_attribute', 'email');
$this->set_config('archiveonrelease', $data->assignsubmission_maharaws_archiveonrelease);
} else {
// Set to existing config or default value for users that cannot see lock element.
$this->set_config('lock', $this->get_config('lock') ?: '0');
}

$this->set_config('debug', false);
$this->set_config('remoteuser', false);
$this->set_config('username_attribute', 'email');
$this->set_config('archiveonrelease', $data->assignsubmission_maharaws_archiveonrelease);

// Test Mahara connection.
try {
$data = $this->webservice_call("mahara_user_get_extended_context", array());
Expand Down

0 comments on commit c67f696

Please sign in to comment.