Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lang/en/tool_objectfs.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
$string['check:connection:error'] = 'Could not establish connection to the object store: {$a}';
$string['check:connection:na'] = 'No object store client is configured';
$string['check:connection:ok'] = 'Connection to the object store is working';
$string['check:proxyrangerequestsdisabled'] = 'The proxy range request setting is disabled.';
$string['check:proxyrangerequestsdisabled'] = 'Proxy range requests can\'t be tested with the current configuration.';
$string['check:tagging:error'] = 'Error trying to tag object';
$string['check:tagging:migrationerror'] = 'Object tagging migration task(s) have faildelay > 0';
$string['check:tagging:migrationok'] = 'Object tagging migration tasks OK';
Expand Down
38 changes: 4 additions & 34 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/

use tool_objectfs\check\connection;
use tool_objectfs\check\proxy_range_request;
use tool_objectfs\check\token_expiry;
use tool_objectfs\check\tagging_migration_status;
use tool_objectfs\check\tagging_sync_status;
Expand All @@ -34,8 +35,6 @@
require_once(__DIR__ . '/classes/local/manager.php');
require_once(__DIR__ . '/lib.php');

global $PAGE, $CFG;

if (!$hassiteconfig) {
return;
}
Expand Down Expand Up @@ -70,20 +69,6 @@
));

if ($ADMIN->fulltree) {
// Check if we are actually on the Objectfs settings page, or in correct category.
$caturl = new moodle_url('/admin/category.php');
$pageurl = new moodle_url('/admin/settings.php');
$objectfspage = false;
if ($PAGE->has_set_url()) {
$thisurl = $PAGE->url;
if (
($caturl->compare($thisurl, URL_MATCH_BASE) && $thisurl->get_param('category') == 'tool_objectfs') ||
($pageurl->compare($thisurl, URL_MATCH_BASE) && $thisurl->get_param('section') == 'tool_objectfs_settings')
) {
$objectfspage = true;
}
}

$warntext = '';
if (method_exists('file_storage', 'get_file_system')) {
if (!\tool_objectfs\local\manager::check_file_storage_filesystem()) {
Expand Down Expand Up @@ -249,36 +234,21 @@
));

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'
));

$settings->add(new admin_setting_check('tool_objectfs/proxyrangerequestscheck', new proxy_range_request()));

$settings->add(new admin_setting_configcheckbox(
'tool_objectfs/enablepresignedurls',
new lang_string('settings:presignedurl:enablepresignedurls', 'tool_objectfs'),
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2026041008; // The current plugin version (Date: YYYYMMDDXX).
$plugin->release = 2026041008; // Same as version.
$plugin->version = 2026041009; // The current plugin version (Date: YYYYMMDDXX).
$plugin->release = 2026041009; // Same as version.
$plugin->requires = 2024042200; // Requires 4.4.
$plugin->component = "tool_objectfs";
$plugin->maturity = MATURITY_STABLE;
Expand Down
Loading