Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Krasikov <klonishe@gmail.com>2019-12-22 16:26:51 +0300
committerPavel Krasikov <klonishe@gmail.com>2019-12-22 16:26:51 +0300
commite9e03788b90caf465d665dd43a081a964b89cf8d (patch)
tree1769f695d23189b930f190c62153270418348069
parent6c48695f03f10d1ea5e958b80c9fe219a1f27685 (diff)
backwards compatibilityv3.4.9
-rwxr-xr-x[-rw-r--r--]Makefile1
-rwxr-xr-xappinfo/info.xml5
-rwxr-xr-x[-rw-r--r--]appinfo/routes.php3
-rwxr-xr-xlib/Controller/PageController.php29
-rwxr-xr-x[-rw-r--r--]lib/Migration/OldConfigRepairStep.php40
5 files changed, 78 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 5e8edcb4..83b0f46f 100644..100755
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,7 @@ appstore: clean
--exclude=phpunit*xml \
--exclude=tests \
--exclude=vendor/bin \
+ --exclude=node_modules \
$(project_dir) $(sign_dir)
@echo "Signing…"
$(occ) integrity:sign-app --privateKey=$(cert_dir)/$(app_name).key --certificate=$(cert_dir)/$(app_name).crt --path=$(sign_dir)/$(app_name)
diff --git a/appinfo/info.xml b/appinfo/info.xml
index 2d996877..41f6a3ec 100755
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -37,4 +37,9 @@
<personal>OCA\Wopi\Settings\Personal</personal>
<personal-section>OCA\Wopi\Settings\Section</personal-section>
</settings>
+ <repair-steps>
+ <post-migration>
+ <step>OCA\Wopi\Migration\OldConfigRepairStep</step>
+ </post-migration>
+ </repair-steps>
</info>
diff --git a/appinfo/routes.php b/appinfo/routes.php
index 0451f7d7..ab68a338 100644..100755
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -64,6 +64,9 @@ return [
['name' => 'templates#getPreview', 'url' => '/template/preview/{fileId}', 'verb' => 'GET'],
['name' => 'templates#add', 'url' => '/template', 'verb' => 'POST'],
['name' => 'templates#delete', 'url' => '/template/{fileId}', 'verb' => 'DELETE'],
+
+ //backwards compatibility
+ ['name' => 'page#editor', 'url' => '/editor', 'verb' => 'GET'],
],
'ocs' => [
['name' => 'OCS#create', 'url' => '/api/v1/document', 'verb' => 'POST'],
diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php
new file mode 100755
index 00000000..ac4a9058
--- /dev/null
+++ b/lib/Controller/PageController.php
@@ -0,0 +1,29 @@
+<?php
+namespace OCA\Wopi\Controller;
+
+use OCP\AppFramework\Http\RedirectResponse;
+use OCP\IRequest;
+use OCP\AppFramework\Controller;
+use OCP\IURLGenerator;
+
+class PageController extends Controller {
+
+ private $userId;
+ /** @var IURLGenerator */
+ private $urlGenerator;
+
+
+ public function __construct($AppName, IRequest $request, $UserId, IURLGenerator $urlGenerator){
+ parent::__construct($AppName, $request);
+ $this->userId = $UserId;
+ $this->urlGenerator=$urlGenerator;
+ }
+
+ /**
+ * @NoAdminRequired
+ * @NoCSRFRequired
+ */
+ public function editor($id) {
+ return new RedirectResponse($this->urlGenerator->getAbsoluteURL('/'));
+ }
+}
diff --git a/lib/Migration/OldConfigRepairStep.php b/lib/Migration/OldConfigRepairStep.php
index b3d9bbc7..cb1c319a 100644..100755
--- a/lib/Migration/OldConfigRepairStep.php
+++ b/lib/Migration/OldConfigRepairStep.php
@@ -1 +1,41 @@
<?php
+namespace OCA\Wopi\Migration;
+
+use OCP\IConfig;
+use OCP\Migration\IOutput;
+use OCP\Migration\IRepairStep;
+use OCP\ILogger;
+
+class OldConfigRepairStep implements IRepairStep {
+
+ /** @var ILogger */
+ protected $logger;
+ /**
+ * @var IConfig
+ */
+ private $config;
+
+ public function __construct(ILogger $logger, IConfig $config) {
+ $this->logger = $logger;
+ $this->config = $config;
+ }
+
+ /**
+ * Returns the step's name
+ */
+ public function getName() {
+ return 'Move old config';
+ }
+
+ /**
+ * @param IOutput $output
+ */
+ public function run(IOutput $output) {
+ $serverUrl = $this->config->getAppValue('wopi', 'serverUrl');
+ if ($serverUrl !== '')
+ {
+ $this->config->setAppValue('wopi', 'wopi_url', $serverUrl);
+ $this->config->deleteAppValue('wopi', 'serverUrl');
+ }
+ }
+} \ No newline at end of file