From 3e4466a41ed47ef29d2fc4d2e4ba66d512c8d804 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Sat, 4 Nov 2017 01:15:13 +0100 Subject: [PATCH] Fix appdb.add sql query --- src/appdb.js | 6 +++--- webadmin/src/views/appstore.js | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/appdb.js b/src/appdb.js index 784592334..b9cf71b47 100644 --- a/src/appdb.js +++ b/src/appdb.js @@ -205,7 +205,7 @@ function add(id, appStoreId, manifest, location, domain, portBindings, data, cal var queries = []; queries.push({ - query: 'INSERT INTO apps (id, appStoreId, manifestJson, installationState, location, domain, accessRestrictionJson, memoryLimit, altDomain, xFrameOptions, restoreConfigJson, sso, debugModeJson) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', + query: 'INSERT INTO apps (id, appStoreId, manifestJson, installationState, location, domain, accessRestrictionJson, memoryLimit, altDomain, xFrameOptions, restoreConfigJson, sso, debugModeJson) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', args: [ id, appStoreId, manifestJson, installationState, location, domain, accessRestrictionJson, memoryLimit, altDomain, xFrameOptions, restoreConfigJson, sso, debugModeJson ] }); @@ -219,8 +219,8 @@ function add(id, appStoreId, manifest, location, domain, portBindings, data, cal // only allocate a mailbox if mailboxName is set if (data.mailboxName) { queries.push({ - query: 'INSERT INTO mailboxes (name, ownerId, ownerType) VALUES (?, ?, ?)', - args: [ data.mailboxName, id, mailboxdb.TYPE_APP ] + query: 'INSERT INTO mailboxes (name, domain, ownerId, ownerType) VALUES (?, ?, ?, ?)', + args: [ data.mailboxName, domain, id, mailboxdb.TYPE_APP ] }); } diff --git a/webadmin/src/views/appstore.js b/webadmin/src/views/appstore.js index fae104b59..1b2ceb9e8 100644 --- a/webadmin/src/views/appstore.js +++ b/webadmin/src/views/appstore.js @@ -37,6 +37,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca error: {}, app: {}, location: '', + domain: '', portBindings: {}, mediaLinks: [], certificateFile: null, @@ -57,6 +58,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca $scope.appInstall.app = {}; $scope.appInstall.error = {}; $scope.appInstall.location = ''; + $scope.appInstall.domain = ''; $scope.appInstall.portBindings = {}; $scope.appInstall.state = 'appInfo'; $scope.appInstall.mediaLinks = []; @@ -102,6 +104,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca $scope.appInstall.mediaLinks = $scope.appInstall.app.manifest.mediaLinks || []; $scope.appInstall.location = app.location; + $scope.appInstall.domain = $scope.config.fqdn; // FIXME needs to come from domains dropdown $scope.appInstall.portBindingsInfo = $scope.appInstall.app.manifest.tcpPorts || {}; // Portbinding map only for information $scope.appInstall.portBindings = {}; // This is the actual model holding the env:port pair $scope.appInstall.portBindingsEnabled = {}; // This is the actual model holding the enabled/disabled flag @@ -145,6 +148,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca var data = { location: $scope.appInstall.location || '', + domain: $scope.appInstall.domain, portBindings: finalPortBindings, accessRestriction: finalAccessRestriction, cert: $scope.appInstall.certificateFile,