Skip to content

Commit 273c148

Browse files
committed
Merge branch 'feature/empty-jwt-warning' into develop
2 parents b2a7fbf + 710e4f2 commit 273c148

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This plugin is developed and maintained at https://github.com/ONLYOFFICE/onlyoff
99
- editor URL generation for documents with viewable extensions
1010
- plugin description and useful links in admin settings
1111
- hide a JWT secret from display
12+
- show warning popup when jwt secret is empty
1213

1314
## 1.5.0
1415
## Added

lang/english.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@
4545
$strings['UserVoiceDescription'] = 'Collaborate on documents, spreadsheets, presentations, and forms within the Chamilo structure using ONLYOFFICE Docs.';
4646
$strings['LearnMore'] = 'Learn more';
4747
$strings['SuggestFeature'] = 'Suggest a feature';
48+
$strings['EmptyJwtWarning'] = 'To ensure the security of important parameters in ONLYOFFICE Docs requests, please set a Secret Key on the Settings page.
49+
To learn more, <a target="_blank" style="text-decoration:underline;" href="https://api.onlyoffice.com/docs/docs-api/get-started/how-it-works/security/">click here</a>.';

lib/onlyofficeSettingsFormBuilder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ public static function validateSettingsForm(OnlyofficeAppsettings $settingsManag
113113
if (!empty($error)) {
114114
$errorMsg = $plugin->get_lang('connectionError').'('.$error.')'.(!empty($version) ? '(Version '.$version.')' : '');
115115
self::displayError($errorMsg);
116+
} else if (empty($settingsManager->getJwtKey())) {
117+
$message = Display::return_message($plugin->get_lang('EmptyJwtWarning'), 'warning', false);
118+
Display::addFlash($message);
116119
}
117120
}
118121
}

0 commit comments

Comments
 (0)