diff --git a/apps/settings/js/vue-0.js b/apps/settings/js/vue-0.js index 740d731bf096758db591bfea89ad8eb37b62e51a..1b1d0dc65bcc82c702763d8e3a1846f3291f2b02 100644 Binary files a/apps/settings/js/vue-0.js and b/apps/settings/js/vue-0.js differ diff --git a/apps/settings/js/vue-0.js.map b/apps/settings/js/vue-0.js.map index 0490ce708d961af8df66c118892db486731e87b8..c56c36b86a0d7725c8de12a9f62ed0204be69e32 100644 Binary files a/apps/settings/js/vue-0.js.map and b/apps/settings/js/vue-0.js.map differ diff --git a/apps/settings/js/vue-5.js b/apps/settings/js/vue-5.js index 276967d27fc57c1d8ae645a91ee7dd2fc5d78711..2dbbd2afa142670906bde75caf1e1e9af626f9d0 100644 Binary files a/apps/settings/js/vue-5.js and b/apps/settings/js/vue-5.js differ diff --git a/apps/settings/js/vue-5.js.map b/apps/settings/js/vue-5.js.map index ae8443bf9750dcab4b16626aa41e203370fae765..26de1476abcd13140600643882c61e32b010581c 100644 Binary files a/apps/settings/js/vue-5.js.map and b/apps/settings/js/vue-5.js.map differ diff --git a/apps/settings/js/vue-6.js b/apps/settings/js/vue-6.js index 7e1c1b85fd247d5ed74680607e0db2fa6d3c46f7..6f9f283823b1f951de8e0186d2ae7de1bbf48d0f 100644 Binary files a/apps/settings/js/vue-6.js and b/apps/settings/js/vue-6.js differ diff --git a/apps/settings/js/vue-6.js.map b/apps/settings/js/vue-6.js.map index 379219d05f68c5a55d6ce7c6a16de96a2bd7ca00..cf16929f213ce15cf83cc0d9f2ac5a7fd31f1e05 100644 Binary files a/apps/settings/js/vue-6.js.map and b/apps/settings/js/vue-6.js.map differ diff --git a/apps/settings/js/vue-7.js b/apps/settings/js/vue-7.js index 458a0137e96fff474254d95e1cbd5dcd02d2dc3b..a3c3f9ad0876f736f983c057b218807924d15e6a 100644 Binary files a/apps/settings/js/vue-7.js and b/apps/settings/js/vue-7.js differ diff --git a/apps/settings/js/vue-7.js.map b/apps/settings/js/vue-7.js.map index 543cfa4820420a435daa8ece481dc1045781cae6..4be0a991defa1c2cf2fa05d2aec6b8868c6e7548 100644 Binary files a/apps/settings/js/vue-7.js.map and b/apps/settings/js/vue-7.js.map differ diff --git a/apps/settings/js/vue-8.js b/apps/settings/js/vue-8.js index fed00f80c02d3c4e26f8157a650f070e2b0f65cd..541c1b886f8a8cca36498f6e10b85aa5c794fb7c 100644 Binary files a/apps/settings/js/vue-8.js and b/apps/settings/js/vue-8.js differ diff --git a/apps/settings/js/vue-8.js.map b/apps/settings/js/vue-8.js.map index dc70881a4dd16eb813dabb6d1f4d66878697ab1b..55afc63ceb126d90cef2ea1f849bfa1b57ea19c1 100644 Binary files a/apps/settings/js/vue-8.js.map and b/apps/settings/js/vue-8.js.map differ diff --git a/apps/settings/js/vue-settings-admin-security.js b/apps/settings/js/vue-settings-admin-security.js index 26e2a6710d2e40c1d8e711ae93ea46ca64f4b78f..3b41660116e31e4f294c0ae2330d3f42ffd18417 100644 Binary files a/apps/settings/js/vue-settings-admin-security.js and b/apps/settings/js/vue-settings-admin-security.js differ diff --git a/apps/settings/js/vue-settings-admin-security.js.map b/apps/settings/js/vue-settings-admin-security.js.map index aaaf9ce04f2f392007f07049bc2de3ccedc64187..8e0505adb036fec0b6ec8647ea8e3d34b938c629 100644 Binary files a/apps/settings/js/vue-settings-admin-security.js.map and b/apps/settings/js/vue-settings-admin-security.js.map differ diff --git a/apps/settings/js/vue-settings-apps-users-management.js b/apps/settings/js/vue-settings-apps-users-management.js index 6278f1465ccaf96e748cf87c5e321a0e3b7e53d8..3617215c9317dd920f19c064c8557fa6536a8aa4 100644 Binary files a/apps/settings/js/vue-settings-apps-users-management.js and b/apps/settings/js/vue-settings-apps-users-management.js differ diff --git a/apps/settings/js/vue-settings-apps-users-management.js.map b/apps/settings/js/vue-settings-apps-users-management.js.map index e502770fe3cc5916ebc0d8ad1ffff22824d9a252..1361408ba88dc678542be2af2b36d3c7ac4b94b4 100644 Binary files a/apps/settings/js/vue-settings-apps-users-management.js.map and b/apps/settings/js/vue-settings-apps-users-management.js.map differ diff --git a/apps/settings/js/vue-settings-personal-security.js b/apps/settings/js/vue-settings-personal-security.js index af45ae7b10ba3fd82af2f94f2ebf2aea52eefa6f..20bdd6a82614242265f775e2a06525ebcb4fa8be 100644 Binary files a/apps/settings/js/vue-settings-personal-security.js and b/apps/settings/js/vue-settings-personal-security.js differ diff --git a/apps/settings/js/vue-settings-personal-security.js.map b/apps/settings/js/vue-settings-personal-security.js.map index f10055ec6b008c015caaa4e0c7eef472c11fea5c..5cd2d0f4afe855f73157f6d40d8003c9a2a965db 100644 Binary files a/apps/settings/js/vue-settings-personal-security.js.map and b/apps/settings/js/vue-settings-personal-security.js.map differ diff --git a/apps/settings/js/vue-settings-personal-webauthn.js b/apps/settings/js/vue-settings-personal-webauthn.js index 85ecddb06cb12879693cad525513955018509c91..a9eac1fe0720a69996b07307bdbf07eadd3d8bc3 100644 Binary files a/apps/settings/js/vue-settings-personal-webauthn.js and b/apps/settings/js/vue-settings-personal-webauthn.js differ diff --git a/apps/settings/js/vue-settings-personal-webauthn.js.map b/apps/settings/js/vue-settings-personal-webauthn.js.map index 440016f110ce707a906bc439219a62a48e9cf154..9ae05337acaafc5e3504795137de418cdc444a3e 100644 Binary files a/apps/settings/js/vue-settings-personal-webauthn.js.map and b/apps/settings/js/vue-settings-personal-webauthn.js.map differ diff --git a/apps/settings/src/components/AdminTwoFactor.vue b/apps/settings/src/components/AdminTwoFactor.vue index 3470ebfc2f88658d455f5528258c930e0c4b44d9..4d34f8ab937115cee32c3f1a89ea240fbf0be34e 100644 --- a/apps/settings/src/components/AdminTwoFactor.vue +++ b/apps/settings/src/components/AdminTwoFactor.vue @@ -69,6 +69,7 @@ import axios from '@nextcloud/axios' import { Multiselect } from '@nextcloud/vue' import _ from 'lodash' +import { generateUrl, generateOcsUrl } from '@nextcloud/router' export default { name: 'AdminTwoFactor', @@ -124,7 +125,7 @@ export default { methods: { searchGroup: _.debounce(function(query) { this.loadingGroups = true - axios.get(OC.linkToOCS(`cloud/groups?offset=0&search=${encodeURIComponent(query)}&limit=20`, 2)) + axios.get(generateOcsUrl(`cloud/groups?offset=0&search=${encodeURIComponent(query)}&limit=20`, 2)) .then(res => res.data.ocs) .then(ocs => ocs.data.groups) .then(groups => { this.groups = _.sortedUniq(_.uniq(this.groups.concat(groups))) }) @@ -140,7 +141,7 @@ export default { enforcedGroups: this.enforcedGroups, excludedGroups: this.excludedGroups, } - axios.put(OC.generateUrl('/settings/api/admin/twofactorauth'), data) + axios.put(generateUrl('/settings/api/admin/twofactorauth'), data) .then(resp => resp.data) .then(state => { this.state = state diff --git a/apps/settings/src/components/AppList/AppScore.vue b/apps/settings/src/components/AppList/AppScore.vue index f3ff80b7792526ca241b7f9c7ddd40e66f4dba87..0569d687e880f2f4b078d78dfe0122f790728a80 100644 --- a/apps/settings/src/components/AppList/AppScore.vue +++ b/apps/settings/src/components/AppList/AppScore.vue @@ -24,6 +24,8 @@ <img :src="scoreImage" class="app-score-image"> </template> <script> +import { imagePath } from '@nextcloud/router' + export default { name: 'AppScore', props: ['score'], @@ -31,7 +33,7 @@ export default { scoreImage() { const score = Math.round(this.score * 10) const imageName = 'rating/s' + score + '.svg' - return OC.imagePath('core', imageName) + return imagePath('core', imageName) }, }, } diff --git a/apps/settings/src/components/AuthTokenSection.vue b/apps/settings/src/components/AuthTokenSection.vue index 6e574c86cab7f1b62054ee0716a4720e8483b77c..9c59d749e96c9f892a5ba8183c7800118a2038dd 100644 --- a/apps/settings/src/components/AuthTokenSection.vue +++ b/apps/settings/src/components/AuthTokenSection.vue @@ -37,6 +37,7 @@ <script> import axios from '@nextcloud/axios' import confirmPassword from '@nextcloud/password-confirmation' +import { generateUrl } from '@nextcloud/router' import AuthTokenList from './AuthTokenList' import AuthTokenSetupDialogue from './AuthTokenSetupDialogue' @@ -80,7 +81,7 @@ export default { }, data() { return { - baseUrl: OC.generateUrl('/settings/personal/authtokens'), + baseUrl: generateUrl('/settings/personal/authtokens'), } }, methods: { diff --git a/apps/settings/src/components/AuthTokenSetupDialogue.vue b/apps/settings/src/components/AuthTokenSetupDialogue.vue index eaf58734530ce3936a59e73822e9bfc097df4e87..410b0073c0b45aff39aefda6640525fd561cc284 100644 --- a/apps/settings/src/components/AuthTokenSetupDialogue.vue +++ b/apps/settings/src/components/AuthTokenSetupDialogue.vue @@ -29,7 +29,7 @@ <button class="button" :disabled="loading" @click="submit"> - {{ t('settings', 'Create new app password') }} + {{ t('settings', 'Create new app password') }} </button> </div> <div v-else> @@ -79,6 +79,7 @@ <script> import QR from '@chenfengyuan/vue-qrcode' import confirmPassword from '@nextcloud/password-confirmation' +import { getRootUrl } from '@nextcloud/router' export default { name: 'AuthTokenSetupDialogue', @@ -141,7 +142,7 @@ export default { this.loginName = token.loginName this.appPassword = token.token - const server = window.location.protocol + '//' + window.location.host + OC.getRootPath() + const server = window.location.protocol + '//' + window.location.host + getRootUrl() this.qrUrl = `nc://login/user:${token.loginName}&password:${token.token}&server:${server}` this.$nextTick(() => { diff --git a/apps/settings/src/components/WebAuthn/AddDevice.vue b/apps/settings/src/components/WebAuthn/AddDevice.vue index ad57b3b55bac86d956757a8ec023bf066cd12c51..722c28b51470da96205e3b23d50911d961829877 100644 --- a/apps/settings/src/components/WebAuthn/AddDevice.vue +++ b/apps/settings/src/components/WebAuthn/AddDevice.vue @@ -87,8 +87,8 @@ export default { httpWarning: Boolean, isHttps: { type: Boolean, - default: false - } + default: false, + }, }, data() { return { diff --git a/apps/settings/src/components/WebAuthn/Section.vue b/apps/settings/src/components/WebAuthn/Section.vue index a0cef9f753a2c36281a2a02a09fe5778930857c7..672ff3b44cbc11188fe0d446014c1f9e44c910ac 100644 --- a/apps/settings/src/components/WebAuthn/Section.vue +++ b/apps/settings/src/components/WebAuthn/Section.vue @@ -40,7 +40,7 @@ {{ t('settings', 'Your browser does not support WebAuthn.') }} </p> - <AddDevice v-if="hasPublicKeyCredential" :isHttps="isHttps" @added="deviceAdded" /> + <AddDevice v-if="hasPublicKeyCredential" :is-https="isHttps" @added="deviceAdded" /> </div> </template> diff --git a/apps/settings/src/mixins/UserRowMixin.js b/apps/settings/src/mixins/UserRowMixin.js index c997d2ea9454465fa99b9716aa9458896f113bfa..7d7ef44d77d85e24fd664c07aed2a91d187749ca 100644 --- a/apps/settings/src/mixins/UserRowMixin.js +++ b/apps/settings/src/mixins/UserRowMixin.js @@ -20,6 +20,8 @@ * */ +import { generateUrl } from '@nextcloud/router' + export default { props: { user: { @@ -158,7 +160,7 @@ export default { * @returns {string} */ generateAvatar(user, size = 32) { - return OC.generateUrl( + return generateUrl( '/avatar/{user}/{size}?v={version}', { user: user, diff --git a/apps/settings/src/router.js b/apps/settings/src/router.js index d292719d384a98b16864654b3dc65ff4e2260550..e46947e7987a07daa8553eec2bb5c91c73fd9d17 100644 --- a/apps/settings/src/router.js +++ b/apps/settings/src/router.js @@ -23,6 +23,7 @@ import Vue from 'vue' import Router from 'vue-router' +import { generateUrl } from '@nextcloud/router' // Dynamic loading const Users = () => import('./views/Users') @@ -43,7 +44,7 @@ export default new Router({ mode: 'history', // if index.php is in the url AND we got this far, then it's working: // let's keep using index.php in the url - base: OC.generateUrl(''), + base: generateUrl(''), linkActiveClass: 'active', routes: [ { diff --git a/apps/settings/src/store/api.js b/apps/settings/src/store/api.js index 5679ada52ae9159a8f3e418931842a4b2ca13c43..37d9a268607d4ae5d3b4b81999817ecdba3079e6 100644 --- a/apps/settings/src/store/api.js +++ b/apps/settings/src/store/api.js @@ -35,15 +35,15 @@ export default { * you'll need to be careful when using it. * e.g * // store - * action(context) { - * return api.requireAdmin().then((response) => { - * return api.get('url') - * .then((response) => {API success}) - * .catch((error) => {API failure}); - * }).catch((error) => {requireAdmin failure}); - * } + * action(context) { + * return api.requireAdmin().then((response) => { + * return api.get('url') + * .then((response) => {API success}) + * .catch((error) => {API failure}); + * }).catch((error) => {requireAdmin failure}); + * } * // vue - * this.$store.dispatch('action').then(() => {always executed}) + * this.$store.dispatch('action').then(() => {always executed}) * * Since Promise.then().catch().then() will always execute the last then * this.$store.dispatch('action').then will always be executed @@ -52,11 +52,11 @@ export default { * you will need to throw a new error in the api.get.catch() * * e.g - * api.requireAdmin().then((response) => { - * api.get('url') - * .then((response) => {API success}) - * .catch((error) => {throw error;}); - * }).catch((error) => {requireAdmin OR API failure}); + * api.requireAdmin().then((response) => { + * api.get('url') + * .then((response) => {API success}) + * .catch((error) => {throw error;}); + * }).catch((error) => {requireAdmin OR API failure}); * * @returns {Promise} */ diff --git a/apps/settings/src/store/apps.js b/apps/settings/src/store/apps.js index 309932ada0821b8018b6190dfa811c65c27b59fa..a65861d6b7cc26f19d0275e743e37077ddbdbe92 100644 --- a/apps/settings/src/store/apps.js +++ b/apps/settings/src/store/apps.js @@ -22,6 +22,7 @@ import api from './api' import Vue from 'vue' +import { generateUrl } from '@nextcloud/router' const state = { apps: [], @@ -165,7 +166,7 @@ const actions = { return api.requireAdmin().then((response) => { context.commit('startLoading', apps) context.commit('startLoading', 'install') - return api.post(OC.generateUrl(`settings/apps/enable`), { appIds: apps, groups: groups }) + return api.post(generateUrl(`settings/apps/enable`), { appIds: apps, groups: groups }) .then((response) => { context.commit('stopLoading', apps) context.commit('stopLoading', 'install') @@ -174,7 +175,7 @@ const actions = { }) // check for server health - return api.get(OC.generateUrl('apps/files')) + return api.get(generateUrl('apps/files')) .then(() => { if (response.data.update_required) { OC.dialogs.info( @@ -223,7 +224,7 @@ const actions = { return api.requireAdmin().then(() => { context.commit('startLoading', apps) context.commit('startLoading', 'install') - return api.post(OC.generateUrl(`settings/apps/force`), { appId }) + return api.post(generateUrl(`settings/apps/force`), { appId }) .then((response) => { // TODO: find a cleaner solution location.reload() @@ -248,7 +249,7 @@ const actions = { } return api.requireAdmin().then((response) => { context.commit('startLoading', apps) - return api.post(OC.generateUrl(`settings/apps/disable`), { appIds: apps }) + return api.post(generateUrl(`settings/apps/disable`), { appIds: apps }) .then((response) => { context.commit('stopLoading', apps) apps.forEach(_appId => { @@ -265,7 +266,7 @@ const actions = { uninstallApp(context, { appId }) { return api.requireAdmin().then((response) => { context.commit('startLoading', appId) - return api.get(OC.generateUrl(`settings/apps/uninstall/${appId}`)) + return api.get(generateUrl(`settings/apps/uninstall/${appId}`)) .then((response) => { context.commit('stopLoading', appId) context.commit('uninstallApp', appId) @@ -282,7 +283,7 @@ const actions = { return api.requireAdmin().then((response) => { context.commit('startLoading', appId) context.commit('startLoading', 'install') - return api.get(OC.generateUrl(`settings/apps/update/${appId}`)) + return api.get(generateUrl(`settings/apps/update/${appId}`)) .then((response) => { context.commit('stopLoading', 'install') context.commit('stopLoading', appId) @@ -299,7 +300,7 @@ const actions = { getAllApps(context) { context.commit('startLoading', 'list') - return api.get(OC.generateUrl(`settings/apps/list`)) + return api.get(generateUrl(`settings/apps/list`)) .then((response) => { context.commit('setAllApps', response.data.apps) context.commit('stopLoading', 'list') @@ -310,7 +311,7 @@ const actions = { getCategories(context) { context.commit('startLoading', 'categories') - return api.get(OC.generateUrl('settings/apps/categories')) + return api.get(generateUrl('settings/apps/categories')) .then((response) => { if (response.data.length > 0) { context.commit('appendCategories', response.data) diff --git a/apps/settings/src/store/oc.js b/apps/settings/src/store/oc.js index b416d684e6379442fe494bc1c77a51355fdc82b2..f7fdd4135540fb915044897641f577eea6fa80c3 100644 --- a/apps/settings/src/store/oc.js +++ b/apps/settings/src/store/oc.js @@ -21,6 +21,7 @@ */ import api from './api' +import { generateOcsUrl } from '@nextcloud/router' const state = {} const mutations = {} @@ -38,7 +39,7 @@ const actions = { */ setAppConfig(context, { app, key, value }) { return api.requireAdmin().then((response) => { - return api.post(OC.linkToOCS(`apps/provisioning_api/api/v1/config/apps/${app}/${key}`, 2), { value: value }) + return api.post(generateOcsUrl(`apps/provisioning_api/api/v1/config/apps/${app}/${key}`, 2), { value: value }) .catch((error) => { throw error }) }).catch((error) => context.commit('API_FAILURE', { app, key, value, error })) }, diff --git a/apps/settings/src/store/users.js b/apps/settings/src/store/users.js index 83bc32d7b6ad0f66d14ea2fcbec7a88f824db4a8..8e586492a9b8d02ec7d83b251094be282e8d4bbd 100644 --- a/apps/settings/src/store/users.js +++ b/apps/settings/src/store/users.js @@ -21,6 +21,7 @@ */ import api from './api' +import { generateOcsUrl } from '@nextcloud/router' const orderGroups = function(groups, orderBy) { /* const SORT_USERCOUNT = 1; @@ -205,7 +206,7 @@ const actions = { search = typeof search === 'string' ? search : '' group = typeof group === 'string' ? group : '' if (group !== '') { - return api.get(OC.linkToOCS(`cloud/groups/${encodeURIComponent(encodeURIComponent(group))}/users/details?offset=${offset}&limit=${limit}&search=${search}`, 2)) + return api.get(generateOcsUrl(`cloud/groups/${encodeURIComponent(encodeURIComponent(group))}/users/details?offset=${offset}&limit=${limit}&search=${search}`, 2)) .then((response) => { if (Object.keys(response.data.ocs.data.users).length > 0) { context.commit('appendUsers', response.data.ocs.data.users) @@ -216,7 +217,7 @@ const actions = { .catch((error) => context.commit('API_FAILURE', error)) } - return api.get(OC.linkToOCS(`cloud/users/details?offset=${offset}&limit=${limit}&search=${search}`, 2)) + return api.get(generateOcsUrl(`cloud/users/details?offset=${offset}&limit=${limit}&search=${search}`, 2)) .then((response) => { if (Object.keys(response.data.ocs.data.users).length > 0) { context.commit('appendUsers', response.data.ocs.data.users) @@ -230,7 +231,7 @@ const actions = { getGroups(context, { offset, limit, search }) { search = typeof search === 'string' ? search : '' const limitParam = limit === -1 ? '' : `&limit=${limit}` - return api.get(OC.linkToOCS(`cloud/groups?offset=${offset}&search=${search}${limitParam}`, 2)) + return api.get(generateOcsUrl(`cloud/groups?offset=${offset}&search=${search}${limitParam}`, 2)) .then((response) => { if (Object.keys(response.data.ocs.data.groups).length > 0) { response.data.ocs.data.groups.forEach(function(group) { @@ -254,7 +255,7 @@ const actions = { */ getUsersFromList(context, { offset, limit, search }) { search = typeof search === 'string' ? search : '' - return api.get(OC.linkToOCS(`cloud/users/details?offset=${offset}&limit=${limit}&search=${search}`, 2)) + return api.get(generateOcsUrl(`cloud/users/details?offset=${offset}&limit=${limit}&search=${search}`, 2)) .then((response) => { if (Object.keys(response.data.ocs.data.users).length > 0) { context.commit('appendUsers', response.data.ocs.data.users) @@ -275,7 +276,7 @@ const actions = { * @returns {Promise} */ getUsersFromGroup(context, { groupid, offset, limit }) { - return api.get(OC.linkToOCS(`cloud/users/${encodeURIComponent(encodeURIComponent(groupid))}/details?offset=${offset}&limit=${limit}`, 2)) + return api.get(generateOcsUrl(`cloud/users/${encodeURIComponent(encodeURIComponent(groupid))}/details?offset=${offset}&limit=${limit}`, 2)) .then((response) => context.commit('getUsersFromList', response.data.ocs.data.users)) .catch((error) => context.commit('API_FAILURE', error)) }, @@ -297,7 +298,7 @@ const actions = { */ addGroup(context, gid) { return api.requireAdmin().then((response) => { - return api.post(OC.linkToOCS(`cloud/groups`, 2), { groupid: gid }) + return api.post(generateOcsUrl(`cloud/groups`, 2), { groupid: gid }) .then((response) => { context.commit('addGroup', { gid: gid, displayName: gid }) return { gid: gid, displayName: gid } @@ -320,7 +321,7 @@ const actions = { */ removeGroup(context, gid) { return api.requireAdmin().then((response) => { - return api.delete(OC.linkToOCS(`cloud/groups/${encodeURIComponent(encodeURIComponent(gid))}`, 2)) + return api.delete(generateOcsUrl(`cloud/groups/${encodeURIComponent(encodeURIComponent(gid))}`, 2)) .then((response) => context.commit('removeGroup', gid)) .catch((error) => { throw error }) }).catch((error) => context.commit('API_FAILURE', { gid, error })) @@ -337,7 +338,7 @@ const actions = { */ addUserGroup(context, { userid, gid }) { return api.requireAdmin().then((response) => { - return api.post(OC.linkToOCS(`cloud/users/${userid}/groups`, 2), { groupid: gid }) + return api.post(generateOcsUrl(`cloud/users/${userid}/groups`, 2), { groupid: gid }) .then((response) => context.commit('addUserGroup', { userid, gid })) .catch((error) => { throw error }) }).catch((error) => context.commit('API_FAILURE', { userid, error })) @@ -354,7 +355,7 @@ const actions = { */ removeUserGroup(context, { userid, gid }) { return api.requireAdmin().then((response) => { - return api.delete(OC.linkToOCS(`cloud/users/${userid}/groups`, 2), { groupid: gid }) + return api.delete(generateOcsUrl(`cloud/users/${userid}/groups`, 2), { groupid: gid }) .then((response) => context.commit('removeUserGroup', { userid, gid })) .catch((error) => { throw error }) }).catch((error) => { @@ -376,7 +377,7 @@ const actions = { */ addUserSubAdmin(context, { userid, gid }) { return api.requireAdmin().then((response) => { - return api.post(OC.linkToOCS(`cloud/users/${userid}/subadmins`, 2), { groupid: gid }) + return api.post(generateOcsUrl(`cloud/users/${userid}/subadmins`, 2), { groupid: gid }) .then((response) => context.commit('addUserSubAdmin', { userid, gid })) .catch((error) => { throw error }) }).catch((error) => context.commit('API_FAILURE', { userid, error })) @@ -393,7 +394,7 @@ const actions = { */ removeUserSubAdmin(context, { userid, gid }) { return api.requireAdmin().then((response) => { - return api.delete(OC.linkToOCS(`cloud/users/${userid}/subadmins`, 2), { groupid: gid }) + return api.delete(generateOcsUrl(`cloud/users/${userid}/subadmins`, 2), { groupid: gid }) .then((response) => context.commit('removeUserSubAdmin', { userid, gid })) .catch((error) => { throw error }) }).catch((error) => context.commit('API_FAILURE', { userid, error })) @@ -408,7 +409,7 @@ const actions = { */ wipeUserDevices(context, userid) { return api.requireAdmin().then((response) => { - return api.post(OC.linkToOCS(`cloud/users/${userid}/wipe`, 2)) + return api.post(generateOcsUrl(`cloud/users/${userid}/wipe`, 2)) .catch((error) => { throw error }) }).catch((error) => context.commit('API_FAILURE', { userid, error })) }, @@ -422,7 +423,7 @@ const actions = { */ deleteUser(context, userid) { return api.requireAdmin().then((response) => { - return api.delete(OC.linkToOCS(`cloud/users/${userid}`, 2)) + return api.delete(generateOcsUrl(`cloud/users/${userid}`, 2)) .then((response) => context.commit('deleteUser', userid)) .catch((error) => { throw error }) }).catch((error) => context.commit('API_FAILURE', { userid, error })) @@ -444,7 +445,7 @@ const actions = { */ addUser({ commit, dispatch }, { userid, password, displayName, email, groups, subadmin, quota, language }) { return api.requireAdmin().then((response) => { - return api.post(OC.linkToOCS(`cloud/users`, 2), { userid, password, displayName, email, groups, subadmin, quota, language }) + return api.post(generateOcsUrl(`cloud/users`, 2), { userid, password, displayName, email, groups, subadmin, quota, language }) .then((response) => dispatch('addUserData', userid || response.data.ocs.data.id)) .catch((error) => { throw error }) }).catch((error) => { @@ -462,7 +463,7 @@ const actions = { */ addUserData(context, userid) { return api.requireAdmin().then((response) => { - return api.get(OC.linkToOCS(`cloud/users/${userid}`, 2)) + return api.get(generateOcsUrl(`cloud/users/${userid}`, 2)) .then((response) => context.commit('addUserData', response)) .catch((error) => { throw error }) }).catch((error) => context.commit('API_FAILURE', { userid, error })) @@ -479,7 +480,7 @@ const actions = { enableDisableUser(context, { userid, enabled = true }) { const userStatus = enabled ? 'enable' : 'disable' return api.requireAdmin().then((response) => { - return api.put(OC.linkToOCS(`cloud/users/${userid}/${userStatus}`, 2)) + return api.put(generateOcsUrl(`cloud/users/${userid}/${userStatus}`, 2)) .then((response) => context.commit('enableDisableUser', { userid, enabled })) .catch((error) => { throw error }) }).catch((error) => context.commit('API_FAILURE', { userid, error })) @@ -506,7 +507,7 @@ const actions = { ) ) { return api.requireAdmin().then((response) => { - return api.put(OC.linkToOCS(`cloud/users/${userid}`, 2), { key: key, value: value }) + return api.put(generateOcsUrl(`cloud/users/${userid}`, 2), { key: key, value: value }) .then((response) => context.commit('setUserData', { userid, key, value })) .catch((error) => { throw error }) }).catch((error) => context.commit('API_FAILURE', { userid, error })) @@ -524,7 +525,7 @@ const actions = { */ sendWelcomeMail(context, userid) { return api.requireAdmin().then((response) => { - return api.post(OC.linkToOCS(`cloud/users/${userid}/welcome`, 2)) + return api.post(generateOcsUrl(`cloud/users/${userid}/welcome`, 2)) .then(response => true) .catch((error) => { throw error }) }).catch((error) => context.commit('API_FAILURE', { userid, error }))