Skip to content

Commit

Permalink
Some tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhilton committed Jan 15, 2024
1 parent 927a4f6 commit 78be6db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
4 changes: 2 additions & 2 deletions classes/local/store/s3/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public function test_connection(): result {
$details = $this->get_exception_details($e);
}

$summarystr = result::OK ? 'check:passed' : 'check:failed';
$summarystr = $status == result::OK ? 'check:passed' : 'check:failed';
$summary = get_string($summarystr, 'tool_objectfs');
return new result($status, $summary, $details);
}
Expand Down Expand Up @@ -368,7 +368,7 @@ public function test_permissions($testdelete): result {
}
}

$summarystr = result::OK ? 'settings:permissioncheckpassed' : 'settings:permissioncheckfailed';
$summarystr = $status == result::OK ? 'settings:permissioncheckpassed' : 'settings:permissioncheckfailed';
$summary = get_string($summarystr, 'tool_objectfs');
return new result($status, $summary, $details);
}
Expand Down
21 changes: 0 additions & 21 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,27 +158,6 @@
new lang_string('settings:presignedurl:header', 'tool_objectfs'), $warningtext));

if ($classexists) {
$connstatus = false;
if ($objectfspage) {
$testconn = $client->test_connection();
$connstatus = $testconn->success;
}

$warningtext = '';
$methodexists = method_exists('file_system', 'xsendfile_file');
if (!$methodexists) {
$warningtext .= $OUTPUT->notification(get_string('settings:presignedurl:xsendfilefile', 'tool_objectfs'));
} else if ($connstatus) {
// Range request tests can only work if there is a valid connection.
$range = $client->test_range_request(new $config->filesystem());
if ($range->result) {
$warningtext .= $OUTPUT->notification(get_string('settings:presignedurl:testrangeok', 'tool_objectfs'),
'notifysuccess');
} else {
$warningtext .= $OUTPUT->notification(get_string('settings:presignedurl:testrangeerror', 'tool_objectfs'));
$warningtext .= $OUTPUT->notification($range->error);
}
}
$settings->add(new admin_setting_configcheckbox('tool_objectfs/proxyrangerequests',
new lang_string('settings:presignedurl:proxyrangerequests', 'tool_objectfs'),
new lang_string('settings:presignedurl:proxyrangerequests_help', 'tool_objectfs') . $warningtext, '1'));
Expand Down

0 comments on commit 78be6db

Please sign in to comment.