Skip to content

Commit

Permalink
Merge pull request #230 from ONLYOFFICE/develop
Browse files Browse the repository at this point in the history
Release/4.1.4
  • Loading branch information
LinneyS authored Jan 28, 2020
2 parents a7d640b + ca73004 commit f9e427e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
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="dev@onlyoffice.com" 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

0 comments on commit f9e427e

Please sign in to comment.