Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/4.1.4 #230

Merged
merged 2 commits into from
Jan 28, 2020
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 4.1.4
## Changed
- fix file opening in Nextcloud Android mobile application

## 4.1.2
## Changed
- fix file opening with a sidebar
Expand Down
3 changes: 1 addition & 2 deletions appinfo/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ function() {
$eventDispatcher->addListener(RegisterDirectEditorEvent::class,
function (RegisterDirectEditorEvent $event) use ($container) {
if (!empty($this->appConfig->GetDocumentServerUrl())
&& $this->appConfig->SettingsAreSuccessful()
&& $this->appConfig->isUserAllowedToUse()) {
&& $this->appConfig->SettingsAreSuccessful()) {
$editor = $container->query("DirectEditor");
$event->register($editor);
}
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<description>ONLYOFFICE connector enables you to edit Office documents within ONLYOFFICE from the familiar web interface. This will create a new Open in ONLYOFFICE action within the document library for Office documents. This allows multiple users to collaborate in real time and to save back those changes to your file storage.</description>
<licence>agpl</licence>
<author mail="[email protected]" homepage="https://www.onlyoffice.com/">Ascensio System SIA</author>
<version>4.1.2</version>
<version>4.1.4</version>
<namespace>Onlyoffice</namespace>
<types>
<filesystem/>
Expand Down
14 changes: 13 additions & 1 deletion lib/directeditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ public function getName(): string {
*/
public function getMimetypes(): array {
$mimes = array();
if (!$this->config->isUserAllowedToUse()) {
return $mimes;
}

$formats = $this->config->FormatsSetting();
foreach ($formats as $format => $setting) {
if (array_key_exists("edit", $setting) && $setting["edit"]
Expand All @@ -157,6 +161,10 @@ public function getMimetypes(): array {
*/
public function getMimetypesOptional(): array {
$mimes = array();
if (!$this->config->isUserAllowedToUse()) {
return $mimes;
}

$formats = $this->config->FormatsSetting();
foreach ($formats as $format => $setting) {
if (array_key_exists("edit", $setting) && $setting["edit"]
Expand All @@ -174,6 +182,10 @@ public function getMimetypesOptional(): array {
* @return array of ACreateFromTemplate|ACreateEmpty
*/
public function getCreators(): array {
if (!$this->config->isUserAllowedToUse()) {
return array();
}

return [
new FileCreator($this->appName, $this->trans, $this->logger, "docx"),
new FileCreator($this->appName, $this->trans, $this->logger, "xlsx"),
Expand All @@ -194,7 +206,7 @@ public function isSecure(): bool {
* Return a template response for displaying the editor
*
* open can only be called once when the client requests the editor with a one-time-use token
* For handling editing and later requests, editors need to impelement their own token handling
* For handling editing and later requests, editors need to implement their own token handling
* and take care of invalidation
*
* @param IToken $token - one time token
Expand Down