aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/js/vue-settings-apps-users-management.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings/js/vue-settings-apps-users-management.js')
-rw-r--r--apps/settings/js/vue-settings-apps-users-management.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/settings/js/vue-settings-apps-users-management.js b/apps/settings/js/vue-settings-apps-users-management.js
index b1449d33ebb..a1cde0dff88 100644
--- a/apps/settings/js/vue-settings-apps-users-management.js
+++ b/apps/settings/js/vue-settings-apps-users-management.js
@@ -1,4 +1,4 @@
-!function(t){function e(e){for(var n,o,i=e[0],a=e[1],s=0,c=[];s<i.length;s++)o=i[s],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&c.push(r[o][0]),r[o]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n]);for(u&&u(e);c.length;)c.shift()()}var n={},r={2:0};function o(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(t){var e=[],n=r[t];if(0!==n)if(n)e.push(n[2]);else{var i=new Promise((function(e,o){n=r[t]=[e,o]}));e.push(n[2]=i);var a,s=document.createElement("script");s.charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.src=function(t){return o.p+"vue-"+({}[t]||t)+".js?v="+{0:"321669b9d7c7db52f9e2",5:"1a818e0a343a467554cb",6:"438115442c83f509070d",7:"466f413f44f3f1d639ea",8:"172ac98d8a0b5b5e90ee"}[t]}(t);var u=new Error;a=function(e){s.onerror=s.onload=null,clearTimeout(c);var n=r[t];if(0!==n){if(n){var o=e&&("load"===e.type?"missing":e.type),i=e&&e.target&&e.target.src;u.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",u.name="ChunkLoadError",u.type=o,u.request=i,n[1](u)}r[t]=void 0}};var c=setTimeout((function(){a({type:"timeout",target:s})}),12e4);s.onerror=s.onload=a,document.head.appendChild(s)}return Promise.all(e)},o.m=t,o.c=n,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/js/",o.oe=function(t){throw console.error(t),t};var i=window.webpackJsonpSettings=window.webpackJsonpSettings||[],a=i.push.bind(i);i.push=e,i=i.slice();for(var s=0;s<i.length;s++)e(i[s]);var u=a;o(o.s=649)}([function(t,e,n){var r=n(2),o=n(85),i=n(4),a=n(54),s=n(86),u=n(156),c=o("wks"),f=r.Symbol,l=u?f:f&&f.withoutSetter||a;t.exports=function(t){return i(c,t)||(s&&i(f,t)?c[t]=f[t]:c[t]=l("Symbol."+t)),c[t]}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")()}).call(this,n(10))},function(t,e,n){var r=n(2),o=n(29).f,i=n(12),a=n(11),s=n(63),u=n(153),c=n(52);t.exports=function(t,e){var n,f,l,p,d,h=t.target,v=t.global,m=t.stat;if(n=v?r:m?r[h]||s(h,{}):(r[h]||{}).prototype)for(f in e){if(p=e[f],l=t.noTargetGet?(d=o(n,f))&&d.value:n[f],!c(v?f:h+(m?".":"#")+f,t.forced)&&void 0!==l){if(typeof p==typeof l)continue;u(p,l)}(t.sham||l&&l.sham)&&i(p,"sham",!0),a(n,f,p,t)}}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(1);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(6);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e,n){"use strict";var r=n(122),o=Object.prototype.toString;function i(t){return"[object Array]"===o.call(t)}function a(t){return void 0===t}function s(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===o.call(t)}function c(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),i(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:i,isArrayBuffer:function(t){return"[object ArrayBuffer]"===o.call(t)},isBuffer:function(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isUndefined:a,isDate:function(t){return"[object Date]"===o.call(t)},isFile:function(t){return"[object File]"===o.call(t)},isBlob:function(t){return"[object Blob]"===o.call(t)},isFunction:u,isStream:function(t){return s(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:c,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},deepMerge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]="object"==typeof n?t({},n):n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,(function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){var r=n(5),o=n(130),i=n(7),a=n(44),s=Object.defineProperty;e.f=r?s:function(t,e,n){if(i(t),e=a(e,!0),i(n),o)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(2),o=n(12),i=n(4),a=n(63),s=n(84),u=n(20),c=u.get,f=u.enforce,l=String(String).split("String");(t.exports=function(t,e,n,s){var u=!!s&&!!s.unsafe,c=!!s&&!!s.enumerable,p=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof e||i(n,"name")||o(n,"name",e),f(n).source=l.join("string"==typeof e?e:"")),t!==r?(u?!p&&t[e]&&(c=!0):delete t[e],c?t[e]=n:o(t,e,n)):c?t[e]=n:a(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||s(this)}))},function(t,e,n){var r=n(5),o=n(9),i=n(27);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){"use strict";n.r(e),function(t,n){
+!function(t){function e(e){for(var n,o,i=e[0],a=e[1],s=0,c=[];s<i.length;s++)o=i[s],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&c.push(r[o][0]),r[o]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n]);for(u&&u(e);c.length;)c.shift()()}var n={},r={2:0};function o(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(t){var e=[],n=r[t];if(0!==n)if(n)e.push(n[2]);else{var i=new Promise((function(e,o){n=r[t]=[e,o]}));e.push(n[2]=i);var a,s=document.createElement("script");s.charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.src=function(t){return o.p+"vue-"+({}[t]||t)+".js?v="+{0:"321669b9d7c7db52f9e2",5:"1a818e0a343a467554cb",6:"5ce9710030fb4b46525f",7:"466f413f44f3f1d639ea",8:"172ac98d8a0b5b5e90ee"}[t]}(t);var u=new Error;a=function(e){s.onerror=s.onload=null,clearTimeout(c);var n=r[t];if(0!==n){if(n){var o=e&&("load"===e.type?"missing":e.type),i=e&&e.target&&e.target.src;u.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",u.name="ChunkLoadError",u.type=o,u.request=i,n[1](u)}r[t]=void 0}};var c=setTimeout((function(){a({type:"timeout",target:s})}),12e4);s.onerror=s.onload=a,document.head.appendChild(s)}return Promise.all(e)},o.m=t,o.c=n,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/js/",o.oe=function(t){throw console.error(t),t};var i=window.webpackJsonpSettings=window.webpackJsonpSettings||[],a=i.push.bind(i);i.push=e,i=i.slice();for(var s=0;s<i.length;s++)e(i[s]);var u=a;o(o.s=649)}([function(t,e,n){var r=n(2),o=n(85),i=n(4),a=n(54),s=n(86),u=n(156),c=o("wks"),f=r.Symbol,l=u?f:f&&f.withoutSetter||a;t.exports=function(t){return i(c,t)||(s&&i(f,t)?c[t]=f[t]:c[t]=l("Symbol."+t)),c[t]}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")()}).call(this,n(10))},function(t,e,n){var r=n(2),o=n(29).f,i=n(12),a=n(11),s=n(63),u=n(153),c=n(52);t.exports=function(t,e){var n,f,l,p,d,h=t.target,v=t.global,m=t.stat;if(n=v?r:m?r[h]||s(h,{}):(r[h]||{}).prototype)for(f in e){if(p=e[f],l=t.noTargetGet?(d=o(n,f))&&d.value:n[f],!c(v?f:h+(m?".":"#")+f,t.forced)&&void 0!==l){if(typeof p==typeof l)continue;u(p,l)}(t.sham||l&&l.sham)&&i(p,"sham",!0),a(n,f,p,t)}}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(1);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(6);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e,n){"use strict";var r=n(122),o=Object.prototype.toString;function i(t){return"[object Array]"===o.call(t)}function a(t){return void 0===t}function s(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===o.call(t)}function c(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),i(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:i,isArrayBuffer:function(t){return"[object ArrayBuffer]"===o.call(t)},isBuffer:function(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isUndefined:a,isDate:function(t){return"[object Date]"===o.call(t)},isFile:function(t){return"[object File]"===o.call(t)},isBlob:function(t){return"[object Blob]"===o.call(t)},isFunction:u,isStream:function(t){return s(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:c,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},deepMerge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]="object"==typeof n?t({},n):n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,(function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){var r=n(5),o=n(130),i=n(7),a=n(44),s=Object.defineProperty;e.f=r?s:function(t,e,n){if(i(t),e=a(e,!0),i(n),o)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(2),o=n(12),i=n(4),a=n(63),s=n(84),u=n(20),c=u.get,f=u.enforce,l=String(String).split("String");(t.exports=function(t,e,n,s){var u=!!s&&!!s.unsafe,c=!!s&&!!s.enumerable,p=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof e||i(n,"name")||o(n,"name",e),f(n).source=l.join("string"==typeof e?e:"")),t!==r?(u?!p&&t[e]&&(c=!0):delete t[e],c?t[e]=n:o(t,e,n)):c?t[e]=n:a(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||s(this)}))},function(t,e,n){var r=n(5),o=n(9),i=n(27);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){"use strict";n.r(e),function(t,n){
/*!
* Vue.js v2.6.11
* (c) 2014-2019 Evan You
@@ -57,7 +57,7 @@ function(t){if(Number(t.version.split(".")[0])>=2)t.mixin({beforeCreate:n});else
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- */i.default.use(Xt);var Kt=new Xt({mode:"history",base:OC.generateUrl(""),linkActiveClass:"active",routes:[{path:"/:index(index.php/)?settings/users",component:Wt,props:!0,name:"users",children:[{path:":selectedGroup",name:"group",component:Wt}]},{path:"/:index(index.php/)?settings/apps",component:Yt,props:!0,name:"apps",children:[{path:":category",name:"apps-category",component:Yt,children:[{path:":id",name:"apps-details",component:Yt}]}]}]}),Jt=o(254),Qt=o(35),Zt=o.n(Qt),te=o(90),ee=o.n(te),ne=function(t){return t.replace(/\/$/,"")},re=function(){return ee()()},oe=function(t){return Zt.a.get(ne(t))},ie=function(t,e){return Zt.a.post(ne(t),e)},ae=function(t,e){return Zt.a.put(ne(t),e)},se=function(t,e){return Zt.a.delete(ne(t),{data:e})},ue=function(t,e){return 1===e?t.sort((function(t,e){return t.usercount-t.disabled<e.usercount-e.disabled})):t.sort((function(t,e){return t.name.localeCompare(e.name)}))},ce={id:"",name:"",usercount:0,disabled:0,canAdd:!0,canRemove:!0},fe={state:{users:[],groups:[],orderBy:1,minPasswordLength:0,usersOffset:0,usersLimit:25,userCount:0},mutations:{appendUsers:function(t,e){var n=t.users.concat(Object.keys(e).map((function(t){return e[t]})));t.usersOffset+=t.usersLimit,t.users=n},setPasswordPolicyMinLength:function(t,e){t.minPasswordLength=""!==e?e:0},initGroups:function(t,e){var n=e.groups,r=e.orderBy,o=e.userCount;t.groups=n.map((function(t){return Object.assign({},ce,t)})),t.orderBy=r,t.userCount=o,t.groups=ue(t.groups,t.orderBy)},addGroup:function(t,e){var n=e.gid,r=e.displayName;try{if(void 0!==t.groups.find((function(t){return t.id===n})))return;var o=Object.assign({},ce,{id:n,name:r});t.groups.push(o),t.groups=ue(t.groups,t.orderBy)}catch(t){console.error("Can't create group",t)}},removeGroup:function(t,e){var n=t.groups.findIndex((function(t){return t.id===e}));n>=0&&t.groups.splice(n,1)},addUserGroup:function(t,e){var n=e.userid,r=e.gid,o=t.groups.find((function(t){return t.id===r})),i=t.users.find((function(t){return t.id===n}));o&&i.enabled&&t.userCount>0&&o.usercount++,i.groups.push(r),t.groups=ue(t.groups,t.orderBy)},removeUserGroup:function(t,e){var n=e.userid,r=e.gid,o=t.groups.find((function(t){return t.id===r})),i=t.users.find((function(t){return t.id===n}));o&&i.enabled&&t.userCount>0&&o.usercount--;var a=i.groups;a.splice(a.indexOf(r),1),t.groups=ue(t.groups,t.orderBy)},addUserSubAdmin:function(t,e){var n=e.userid,r=e.gid;t.users.find((function(t){return t.id===n})).subadmin.push(r)},removeUserSubAdmin:function(t,e){var n=e.userid,r=e.gid,o=t.users.find((function(t){return t.id===n})).subadmin;o.splice(o.indexOf(r),1)},deleteUser:function(t,e){var n=t.users.findIndex((function(t){return t.id===e}));t.users.splice(n,1)},addUserData:function(t,e){t.users.push(e.data.ocs.data)},enableDisableUser:function(t,e){var n=e.userid,r=e.enabled,o=t.users.find((function(t){return t.id===n}));o.enabled=r,t.userCount>0&&(t.groups.find((function(t){return"disabled"===t.id})).usercount+=r?-1:1,t.userCount+=r?1:-1,o.groups.forEach((function(e){t.groups.find((function(t){return t.id===e})).disabled+=r?-1:1})))},setUserData:function(t,e){var n=e.userid,r=e.key,o=e.value;if("quota"===r){var i=OC.Util.computerFileSize(o);t.users.find((function(t){return t.id===n}))[r][r]=null!==i?i:o}else t.users.find((function(t){return t.id===n}))[r]=o},resetUsers:function(t){t.users=[],t.usersOffset=0}},getters:{getUsers:function(t){return t.users},getGroups:function(t){return t.groups},getSubadminGroups:function(t){return t.groups.filter((function(t){return"admin"!==t.id&&"disabled"!==t.id}))},getPasswordPolicyMinLength:function(t){return t.minPasswordLength},getUsersOffset:function(t){return t.usersOffset},getUsersLimit:function(t){return t.usersLimit},getUserCount:function(t){return t.userCount}},actions:{getUsers:function(t,e){var n=e.offset,r=e.limit,o=e.search,i=e.group;return o="string"==typeof o?o:"",""!==(i="string"==typeof i?i:"")?oe(OC.linkToOCS("cloud/groups/".concat(encodeURIComponent(i),"/users/details?offset=").concat(n,"&limit=").concat(r,"&search=").concat(o),2)).then((function(e){return Object.keys(e.data.ocs.data.users).length>0&&(t.commit("appendUsers",e.data.ocs.data.users),!0)})).catch((function(e){return t.commit("API_FAILURE",e)})):oe(OC.linkToOCS("cloud/users/details?offset=".concat(n,"&limit=").concat(r,"&search=").concat(o),2)).then((function(e){return Object.keys(e.data.ocs.data.users).length>0&&(t.commit("appendUsers",e.data.ocs.data.users),!0)})).catch((function(e){return t.commit("API_FAILURE",e)}))},getGroups:function(t,e){var n=e.offset,r=e.limit,o=e.search;o="string"==typeof o?o:"";var i=-1===r?"":"&limit=".concat(r);return oe(OC.linkToOCS("cloud/groups?offset=".concat(n,"&search=").concat(o).concat(i),2)).then((function(e){return Object.keys(e.data.ocs.data.groups).length>0&&(e.data.ocs.data.groups.forEach((function(e){t.commit("addGroup",{gid:e,displayName:e})})),!0)})).catch((function(e){return t.commit("API_FAILURE",e)}))},getUsersFromList:function(t,e){var n=e.offset,r=e.limit,o=e.search;return o="string"==typeof o?o:"",oe(OC.linkToOCS("cloud/users/details?offset=".concat(n,"&limit=").concat(r,"&search=").concat(o),2)).then((function(e){return Object.keys(e.data.ocs.data.users).length>0&&(t.commit("appendUsers",e.data.ocs.data.users),!0)})).catch((function(e){return t.commit("API_FAILURE",e)}))},getUsersFromGroup:function(t,e){var n=e.groupid,r=e.offset,o=e.limit;return oe(OC.linkToOCS("cloud/users/".concat(encodeURIComponent(n),"/details?offset=").concat(r,"&limit=").concat(o),2)).then((function(e){return t.commit("getUsersFromList",e.data.ocs.data.users)})).catch((function(e){return t.commit("API_FAILURE",e)}))},getPasswordPolicyMinLength:function(t){return!(!OC.getCapabilities().password_policy||!OC.getCapabilities().password_policy.minLength)&&(t.commit("setPasswordPolicyMinLength",OC.getCapabilities().password_policy.minLength),OC.getCapabilities().password_policy.minLength)},addGroup:function(t,e){return re().then((function(n){return ie(OC.linkToOCS("cloud/groups",2),{groupid:e}).then((function(n){return t.commit("addGroup",{gid:e,displayName:e}),{gid:e,displayName:e}})).catch((function(t){throw t}))})).catch((function(n){throw t.commit("API_FAILURE",{gid:e,error:n}),n}))},removeGroup:function(t,e){return re().then((function(n){return se(OC.linkToOCS("cloud/groups/".concat(encodeURIComponent(e)),2)).then((function(n){return t.commit("removeGroup",e)})).catch((function(t){throw t}))})).catch((function(n){return t.commit("API_FAILURE",{gid:e,error:n})}))},addUserGroup:function(t,e){var n=e.userid,r=e.gid;return re().then((function(e){return ie(OC.linkToOCS("cloud/users/".concat(n,"/groups"),2),{groupid:r}).then((function(e){return t.commit("addUserGroup",{userid:n,gid:r})})).catch((function(t){throw t}))})).catch((function(e){return t.commit("API_FAILURE",{userid:n,error:e})}))},removeUserGroup:function(t,e){var n=e.userid,r=e.gid;return re().then((function(e){return se(OC.linkToOCS("cloud/users/".concat(n,"/groups"),2),{groupid:r}).then((function(e){return t.commit("removeUserGroup",{userid:n,gid:r})})).catch((function(t){throw t}))})).catch((function(e){throw t.commit("API_FAILURE",{userid:n,error:e}),e}))},addUserSubAdmin:function(t,e){var n=e.userid,r=e.gid;return re().then((function(e){return ie(OC.linkToOCS("cloud/users/".concat(n,"/subadmins"),2),{groupid:r}).then((function(e){return t.commit("addUserSubAdmin",{userid:n,gid:r})})).catch((function(t){throw t}))})).catch((function(e){return t.commit("API_FAILURE",{userid:n,error:e})}))},removeUserSubAdmin:function(t,e){var n=e.userid,r=e.gid;return re().then((function(e){return se(OC.linkToOCS("cloud/users/".concat(n,"/subadmins"),2),{groupid:r}).then((function(e){return t.commit("removeUserSubAdmin",{userid:n,gid:r})})).catch((function(t){throw t}))})).catch((function(e){return t.commit("API_FAILURE",{userid:n,error:e})}))},wipeUserDevices:function(t,e){return re().then((function(t){return ie(OC.linkToOCS("cloud/users/".concat(e,"/wipe"),2)).catch((function(t){throw t}))})).catch((function(n){return t.commit("API_FAILURE",{userid:e,error:n})}))},deleteUser:function(t,e){return re().then((function(n){return se(OC.linkToOCS("cloud/users/".concat(e),2)).then((function(n){return t.commit("deleteUser",e)})).catch((function(t){throw t}))})).catch((function(n){return t.commit("API_FAILURE",{userid:e,error:n})}))},addUser:function(t,e){var n=t.commit,r=t.dispatch,o=e.userid,i=e.password,a=e.displayName,s=e.email,u=e.groups,c=e.subadmin,f=e.quota,l=e.language;return re().then((function(t){return ie(OC.linkToOCS("cloud/users",2),{userid:o,password:i,displayName:a,email:s,groups:u,subadmin:c,quota:f,language:l}).then((function(t){return r("addUserData",o||t.data.ocs.data.id)})).catch((function(t){throw t}))})).catch((function(t){throw n("API_FAILURE",{userid:o,error:t}),t}))},addUserData:function(t,e){return re().then((function(n){return oe(OC.linkToOCS("cloud/users/".concat(e),2)).then((function(e){return t.commit("addUserData",e)})).catch((function(t){throw t}))})).catch((function(n){return t.commit("API_FAILURE",{userid:e,error:n})}))},enableDisableUser:function(t,e){var n=e.userid,r=e.enabled,o=void 0===r||r,i=o?"enable":"disable";return re().then((function(e){return ae(OC.linkToOCS("cloud/users/".concat(n,"/").concat(i),2)).then((function(e){return t.commit("enableDisableUser",{userid:n,enabled:o})})).catch((function(t){throw t}))})).catch((function(e){return t.commit("API_FAILURE",{userid:n,error:e})}))},setUserData:function(t,e){var n=e.userid,r=e.key,o=e.value,i=["email","displayname"];return-1!==["email","language","quota","displayname","password"].indexOf(r)&&"string"==typeof o&&(-1===i.indexOf(r)&&o.length>0||-1!==i.indexOf(r))?re().then((function(e){return ae(OC.linkToOCS("cloud/users/".concat(n),2),{key:r,value:o}).then((function(e){return t.commit("setUserData",{userid:n,key:r,value:o})})).catch((function(t){throw t}))})).catch((function(e){return t.commit("API_FAILURE",{userid:n,error:e})})):Promise.reject(new Error("Invalid request data"))},sendWelcomeMail:function(t,e){return re().then((function(t){return ie(OC.linkToOCS("cloud/users/".concat(e,"/welcome"),2)).then((function(t){return!0})).catch((function(t){throw t}))})).catch((function(n){return t.commit("API_FAILURE",{userid:e,error:n})}))}}},le={state:{apps:[],categories:[],updateCount:0,loading:{},loadingList:!1},mutations:{APPS_API_FAILURE:function(e,n){OC.Notification.showHtml(t("settings","An error occured during the request. Unable to proceed.")+"<br>"+n.error.response.data.data.message,{timeout:7}),console.error(e,n)},initCategories:function(t,e){var n=e.categories,r=e.updateCount;t.categories=n,t.updateCount=r},setUpdateCount:function(t,e){t.updateCount=e},addCategory:function(t,e){t.categories.push(e)},appendCategories:function(t,e){t.categories=e},setAllApps:function(t,e){t.apps=e},setError:function(t,e){var n=e.appId,r=e.error;Array.isArray(n)||(n=[n]),n.forEach((function(e){t.apps.find((function(t){return t.id===e})).error=r}))},clearError:function(t,e){var n=e.appId;e.error;t.apps.find((function(t){return t.id===n})).error=null},enableApp:function(t,e){var n=e.appId,r=e.groups,o=t.apps.find((function(t){return t.id===n}));o.active=!0,o.groups=r},disableApp:function(t,e){var n=t.apps.find((function(t){return t.id===e}));n.active=!1,n.groups=[],n.removable&&(n.canUnInstall=!0)},uninstallApp:function(t,e){t.apps.find((function(t){return t.id===e})).active=!1,t.apps.find((function(t){return t.id===e})).groups=[],t.apps.find((function(t){return t.id===e})).needsDownload=!0,t.apps.find((function(t){return t.id===e})).installed=!1,t.apps.find((function(t){return t.id===e})).canUnInstall=!1,t.apps.find((function(t){return t.id===e})).canInstall=!0},updateApp:function(t,e){var n=t.apps.find((function(t){return t.id===e})),r=n.update;n.update=null,n.version=r,t.updateCount--},resetApps:function(t){t.apps=[]},reset:function(t){t.apps=[],t.categories=[],t.updateCount=0},startLoading:function(t,e){Array.isArray(e)?e.forEach((function(e){i.default.set(t.loading,e,!0)})):i.default.set(t.loading,e,!0)},stopLoading:function(t,e){Array.isArray(e)?e.forEach((function(e){i.default.set(t.loading,e,!1)})):i.default.set(t.loading,e,!1)}},getters:{loading:function(t){return function(e){return t.loading[e]}},getCategories:function(t){return t.categories},getAllApps:function(t){return t.apps},getUpdateCount:function(t){return t.updateCount}},actions:{enableApp:function(e,n){var r,o=n.appId,i=n.groups;return r=Array.isArray(o)?o:[o],re().then((function(n){return e.commit("startLoading",r),e.commit("startLoading","install"),ie(OC.generateUrl("settings/apps/enable"),{appIds:r,groups:i}).then((function(n){return e.commit("stopLoading",r),e.commit("stopLoading","install"),r.forEach((function(t){e.commit("enableApp",{appId:t,groups:i})})),oe(OC.generateUrl("apps/files")).then((function(){n.data.update_required&&(OC.dialogs.info(t("settings","The app has been enabled but needs to be updated. You will be redirected to the update page in 5 seconds."),t("settings","App update"),(function(){window.location.reload()}),!0),setTimeout((function(){location.reload()}),5e3))})).catch((function(){Array.isArray(o)||e.commit("setError",{appId:r,error:t("settings","Error: This app can not be enabled because it makes the server unstable")})}))})).catch((function(t){e.commit("stopLoading",r),e.commit("stopLoading","install"),e.commit("setError",{appId:r,error:t.response.data.data.message}),e.commit("APPS_API_FAILURE",{appId:o,error:t})}))})).catch((function(t){return e.commit("API_FAILURE",{appId:o,error:t})}))},forceEnableApp:function(t,e){var n,r=e.appId;e.groups;return n=Array.isArray(r)?r:[r],re().then((function(){return t.commit("startLoading",n),t.commit("startLoading","install"),ie(OC.generateUrl("settings/apps/force"),{appId:r}).then((function(t){location.reload()})).catch((function(e){t.commit("stopLoading",n),t.commit("stopLoading","install"),t.commit("setError",{appId:n,error:e.response.data.data.message}),t.commit("APPS_API_FAILURE",{appId:r,error:e})}))})).catch((function(e){return t.commit("API_FAILURE",{appId:r,error:e})}))},disableApp:function(t,e){var n,r=e.appId;return n=Array.isArray(r)?r:[r],re().then((function(e){return t.commit("startLoading",n),ie(OC.generateUrl("settings/apps/disable"),{appIds:n}).then((function(e){return t.commit("stopLoading",n),n.forEach((function(e){t.commit("disableApp",e)})),!0})).catch((function(e){t.commit("stopLoading",n),t.commit("APPS_API_FAILURE",{appId:r,error:e})}))})).catch((function(e){return t.commit("API_FAILURE",{appId:r,error:e})}))},uninstallApp:function(t,e){var n=e.appId;return re().then((function(e){return t.commit("startLoading",n),oe(OC.generateUrl("settings/apps/uninstall/".concat(n))).then((function(e){return t.commit("stopLoading",n),t.commit("uninstallApp",n),!0})).catch((function(e){t.commit("stopLoading",n),t.commit("APPS_API_FAILURE",{appId:n,error:e})}))})).catch((function(e){return t.commit("API_FAILURE",{appId:n,error:e})}))},updateApp:function(t,e){var n=e.appId;return re().then((function(e){return t.commit("startLoading",n),t.commit("startLoading","install"),oe(OC.generateUrl("settings/apps/update/".concat(n))).then((function(e){return t.commit("stopLoading","install"),t.commit("stopLoading",n),t.commit("updateApp",n),!0})).catch((function(e){t.commit("stopLoading",n),t.commit("stopLoading","install"),t.commit("APPS_API_FAILURE",{appId:n,error:e})}))})).catch((function(e){return t.commit("API_FAILURE",{appId:n,error:e})}))},getAllApps:function(t){return t.commit("startLoading","list"),oe(OC.generateUrl("settings/apps/list")).then((function(e){return t.commit("setAllApps",e.data.apps),t.commit("stopLoading","list"),!0})).catch((function(e){return t.commit("API_FAILURE",e)}))},getCategories:function(t){return t.commit("startLoading","categories"),oe(OC.generateUrl("settings/apps/categories")).then((function(e){return e.data.length>0&&(t.commit("appendCategories",e.data),t.commit("stopLoading","categories"),!0)})).catch((function(e){return t.commit("API_FAILURE",e)}))}}},pe={state:{serverData:{}},mutations:{setServerData:function(t,e){t.serverData=e}},getters:{getServerData:function(t){return t.serverData}},actions:{}},de={state:{},mutations:{},getters:{},actions:{setAppConfig:function(t,e){var n=e.app,r=e.key,o=e.value;return re().then((function(t){return ie(OC.linkToOCS("apps/provisioning_api/api/v1/config/apps/".concat(n,"/").concat(r),2),{value:o}).catch((function(t){throw t}))})).catch((function(e){return t.commit("API_FAILURE",{app:n,key:r,value:o,error:e})}))}}};
+ */i.default.use(Xt);var Kt=new Xt({mode:"history",base:OC.generateUrl(""),linkActiveClass:"active",routes:[{path:"/:index(index.php/)?settings/users",component:Wt,props:!0,name:"users",children:[{path:":selectedGroup",name:"group",component:Wt}]},{path:"/:index(index.php/)?settings/apps",component:Yt,props:!0,name:"apps",children:[{path:":category",name:"apps-category",component:Yt,children:[{path:":id",name:"apps-details",component:Yt}]}]}]}),Jt=o(254),Qt=o(35),Zt=o.n(Qt),te=o(90),ee=o.n(te),ne=function(t){return t.replace(/\/$/,"")},re=function(){return ee()()},oe=function(t){return Zt.a.get(ne(t))},ie=function(t,e){return Zt.a.post(ne(t),e)},ae=function(t,e){return Zt.a.put(ne(t),e)},se=function(t,e){return Zt.a.delete(ne(t),{data:e})},ue=function(t,e){return 1===e?t.sort((function(t,e){return t.usercount-t.disabled<e.usercount-e.disabled})):t.sort((function(t,e){return t.name.localeCompare(e.name)}))},ce={id:"",name:"",usercount:0,disabled:0,canAdd:!0,canRemove:!0},fe={state:{users:[],groups:[],orderBy:1,minPasswordLength:0,usersOffset:0,usersLimit:25,userCount:0},mutations:{appendUsers:function(t,e){var n=t.users.concat(Object.keys(e).map((function(t){return e[t]})));t.usersOffset+=t.usersLimit,t.users=n},setPasswordPolicyMinLength:function(t,e){t.minPasswordLength=""!==e?e:0},initGroups:function(t,e){var n=e.groups,r=e.orderBy,o=e.userCount;t.groups=n.map((function(t){return Object.assign({},ce,t)})),t.orderBy=r,t.userCount=o,t.groups=ue(t.groups,t.orderBy)},addGroup:function(t,e){var n=e.gid,r=e.displayName;try{if(void 0!==t.groups.find((function(t){return t.id===n})))return;var o=Object.assign({},ce,{id:n,name:r});t.groups.push(o),t.groups=ue(t.groups,t.orderBy)}catch(t){console.error("Can't create group",t)}},removeGroup:function(t,e){var n=t.groups.findIndex((function(t){return t.id===e}));n>=0&&t.groups.splice(n,1)},addUserGroup:function(t,e){var n=e.userid,r=e.gid,o=t.groups.find((function(t){return t.id===r})),i=t.users.find((function(t){return t.id===n}));o&&i.enabled&&t.userCount>0&&o.usercount++,i.groups.push(r),t.groups=ue(t.groups,t.orderBy)},removeUserGroup:function(t,e){var n=e.userid,r=e.gid,o=t.groups.find((function(t){return t.id===r})),i=t.users.find((function(t){return t.id===n}));o&&i.enabled&&t.userCount>0&&o.usercount--;var a=i.groups;a.splice(a.indexOf(r),1),t.groups=ue(t.groups,t.orderBy)},addUserSubAdmin:function(t,e){var n=e.userid,r=e.gid;t.users.find((function(t){return t.id===n})).subadmin.push(r)},removeUserSubAdmin:function(t,e){var n=e.userid,r=e.gid,o=t.users.find((function(t){return t.id===n})).subadmin;o.splice(o.indexOf(r),1)},deleteUser:function(t,e){var n=t.users.findIndex((function(t){return t.id===e}));t.users.splice(n,1)},addUserData:function(t,e){t.users.push(e.data.ocs.data)},enableDisableUser:function(t,e){var n=e.userid,r=e.enabled,o=t.users.find((function(t){return t.id===n}));o.enabled=r,t.userCount>0&&(t.groups.find((function(t){return"disabled"===t.id})).usercount+=r?-1:1,t.userCount+=r?1:-1,o.groups.forEach((function(e){t.groups.find((function(t){return t.id===e})).disabled+=r?-1:1})))},setUserData:function(t,e){var n=e.userid,r=e.key,o=e.value;if("quota"===r){var i=OC.Util.computerFileSize(o);t.users.find((function(t){return t.id===n}))[r][r]=null!==i?i:o}else t.users.find((function(t){return t.id===n}))[r]=o},resetUsers:function(t){t.users=[],t.usersOffset=0}},getters:{getUsers:function(t){return t.users},getGroups:function(t){return t.groups},getSubadminGroups:function(t){return t.groups.filter((function(t){return"admin"!==t.id&&"disabled"!==t.id}))},getPasswordPolicyMinLength:function(t){return t.minPasswordLength},getUsersOffset:function(t){return t.usersOffset},getUsersLimit:function(t){return t.usersLimit},getUserCount:function(t){return t.userCount}},actions:{getUsers:function(t,e){var n=e.offset,r=e.limit,o=e.search,i=e.group;return o="string"==typeof o?o:"",""!==(i="string"==typeof i?i:"")?oe(OC.linkToOCS("cloud/groups/".concat(encodeURIComponent(encodeURIComponent(i)),"/users/details?offset=").concat(n,"&limit=").concat(r,"&search=").concat(o),2)).then((function(e){return Object.keys(e.data.ocs.data.users).length>0&&(t.commit("appendUsers",e.data.ocs.data.users),!0)})).catch((function(e){return t.commit("API_FAILURE",e)})):oe(OC.linkToOCS("cloud/users/details?offset=".concat(n,"&limit=").concat(r,"&search=").concat(o),2)).then((function(e){return Object.keys(e.data.ocs.data.users).length>0&&(t.commit("appendUsers",e.data.ocs.data.users),!0)})).catch((function(e){return t.commit("API_FAILURE",e)}))},getGroups:function(t,e){var n=e.offset,r=e.limit,o=e.search;o="string"==typeof o?o:"";var i=-1===r?"":"&limit=".concat(r);return oe(OC.linkToOCS("cloud/groups?offset=".concat(n,"&search=").concat(o).concat(i),2)).then((function(e){return Object.keys(e.data.ocs.data.groups).length>0&&(e.data.ocs.data.groups.forEach((function(e){t.commit("addGroup",{gid:e,displayName:e})})),!0)})).catch((function(e){return t.commit("API_FAILURE",e)}))},getUsersFromList:function(t,e){var n=e.offset,r=e.limit,o=e.search;return o="string"==typeof o?o:"",oe(OC.linkToOCS("cloud/users/details?offset=".concat(n,"&limit=").concat(r,"&search=").concat(o),2)).then((function(e){return Object.keys(e.data.ocs.data.users).length>0&&(t.commit("appendUsers",e.data.ocs.data.users),!0)})).catch((function(e){return t.commit("API_FAILURE",e)}))},getUsersFromGroup:function(t,e){var n=e.groupid,r=e.offset,o=e.limit;return oe(OC.linkToOCS("cloud/users/".concat(encodeURIComponent(encodeURIComponent(n)),"/details?offset=").concat(r,"&limit=").concat(o),2)).then((function(e){return t.commit("getUsersFromList",e.data.ocs.data.users)})).catch((function(e){return t.commit("API_FAILURE",e)}))},getPasswordPolicyMinLength:function(t){return!(!OC.getCapabilities().password_policy||!OC.getCapabilities().password_policy.minLength)&&(t.commit("setPasswordPolicyMinLength",OC.getCapabilities().password_policy.minLength),OC.getCapabilities().password_policy.minLength)},addGroup:function(t,e){return re().then((function(n){return ie(OC.linkToOCS("cloud/groups",2),{groupid:e}).then((function(n){return t.commit("addGroup",{gid:e,displayName:e}),{gid:e,displayName:e}})).catch((function(t){throw t}))})).catch((function(n){throw t.commit("API_FAILURE",{gid:e,error:n}),n}))},removeGroup:function(t,e){return re().then((function(n){return se(OC.linkToOCS("cloud/groups/".concat(encodeURIComponent(encodeURIComponent(e))),2)).then((function(n){return t.commit("removeGroup",e)})).catch((function(t){throw t}))})).catch((function(n){return t.commit("API_FAILURE",{gid:e,error:n})}))},addUserGroup:function(t,e){var n=e.userid,r=e.gid;return re().then((function(e){return ie(OC.linkToOCS("cloud/users/".concat(n,"/groups"),2),{groupid:r}).then((function(e){return t.commit("addUserGroup",{userid:n,gid:r})})).catch((function(t){throw t}))})).catch((function(e){return t.commit("API_FAILURE",{userid:n,error:e})}))},removeUserGroup:function(t,e){var n=e.userid,r=e.gid;return re().then((function(e){return se(OC.linkToOCS("cloud/users/".concat(n,"/groups"),2),{groupid:r}).then((function(e){return t.commit("removeUserGroup",{userid:n,gid:r})})).catch((function(t){throw t}))})).catch((function(e){throw t.commit("API_FAILURE",{userid:n,error:e}),e}))},addUserSubAdmin:function(t,e){var n=e.userid,r=e.gid;return re().then((function(e){return ie(OC.linkToOCS("cloud/users/".concat(n,"/subadmins"),2),{groupid:r}).then((function(e){return t.commit("addUserSubAdmin",{userid:n,gid:r})})).catch((function(t){throw t}))})).catch((function(e){return t.commit("API_FAILURE",{userid:n,error:e})}))},removeUserSubAdmin:function(t,e){var n=e.userid,r=e.gid;return re().then((function(e){return se(OC.linkToOCS("cloud/users/".concat(n,"/subadmins"),2),{groupid:r}).then((function(e){return t.commit("removeUserSubAdmin",{userid:n,gid:r})})).catch((function(t){throw t}))})).catch((function(e){return t.commit("API_FAILURE",{userid:n,error:e})}))},wipeUserDevices:function(t,e){return re().then((function(t){return ie(OC.linkToOCS("cloud/users/".concat(e,"/wipe"),2)).catch((function(t){throw t}))})).catch((function(n){return t.commit("API_FAILURE",{userid:e,error:n})}))},deleteUser:function(t,e){return re().then((function(n){return se(OC.linkToOCS("cloud/users/".concat(e),2)).then((function(n){return t.commit("deleteUser",e)})).catch((function(t){throw t}))})).catch((function(n){return t.commit("API_FAILURE",{userid:e,error:n})}))},addUser:function(t,e){var n=t.commit,r=t.dispatch,o=e.userid,i=e.password,a=e.displayName,s=e.email,u=e.groups,c=e.subadmin,f=e.quota,l=e.language;return re().then((function(t){return ie(OC.linkToOCS("cloud/users",2),{userid:o,password:i,displayName:a,email:s,groups:u,subadmin:c,quota:f,language:l}).then((function(t){return r("addUserData",o||t.data.ocs.data.id)})).catch((function(t){throw t}))})).catch((function(t){throw n("API_FAILURE",{userid:o,error:t}),t}))},addUserData:function(t,e){return re().then((function(n){return oe(OC.linkToOCS("cloud/users/".concat(e),2)).then((function(e){return t.commit("addUserData",e)})).catch((function(t){throw t}))})).catch((function(n){return t.commit("API_FAILURE",{userid:e,error:n})}))},enableDisableUser:function(t,e){var n=e.userid,r=e.enabled,o=void 0===r||r,i=o?"enable":"disable";return re().then((function(e){return ae(OC.linkToOCS("cloud/users/".concat(n,"/").concat(i),2)).then((function(e){return t.commit("enableDisableUser",{userid:n,enabled:o})})).catch((function(t){throw t}))})).catch((function(e){return t.commit("API_FAILURE",{userid:n,error:e})}))},setUserData:function(t,e){var n=e.userid,r=e.key,o=e.value,i=["email","displayname"];return-1!==["email","language","quota","displayname","password"].indexOf(r)&&"string"==typeof o&&(-1===i.indexOf(r)&&o.length>0||-1!==i.indexOf(r))?re().then((function(e){return ae(OC.linkToOCS("cloud/users/".concat(n),2),{key:r,value:o}).then((function(e){return t.commit("setUserData",{userid:n,key:r,value:o})})).catch((function(t){throw t}))})).catch((function(e){return t.commit("API_FAILURE",{userid:n,error:e})})):Promise.reject(new Error("Invalid request data"))},sendWelcomeMail:function(t,e){return re().then((function(t){return ie(OC.linkToOCS("cloud/users/".concat(e,"/welcome"),2)).then((function(t){return!0})).catch((function(t){throw t}))})).catch((function(n){return t.commit("API_FAILURE",{userid:e,error:n})}))}}},le={state:{apps:[],categories:[],updateCount:0,loading:{},loadingList:!1},mutations:{APPS_API_FAILURE:function(e,n){OC.Notification.showHtml(t("settings","An error occured during the request. Unable to proceed.")+"<br>"+n.error.response.data.data.message,{timeout:7}),console.error(e,n)},initCategories:function(t,e){var n=e.categories,r=e.updateCount;t.categories=n,t.updateCount=r},setUpdateCount:function(t,e){t.updateCount=e},addCategory:function(t,e){t.categories.push(e)},appendCategories:function(t,e){t.categories=e},setAllApps:function(t,e){t.apps=e},setError:function(t,e){var n=e.appId,r=e.error;Array.isArray(n)||(n=[n]),n.forEach((function(e){t.apps.find((function(t){return t.id===e})).error=r}))},clearError:function(t,e){var n=e.appId;e.error;t.apps.find((function(t){return t.id===n})).error=null},enableApp:function(t,e){var n=e.appId,r=e.groups,o=t.apps.find((function(t){return t.id===n}));o.active=!0,o.groups=r},disableApp:function(t,e){var n=t.apps.find((function(t){return t.id===e}));n.active=!1,n.groups=[],n.removable&&(n.canUnInstall=!0)},uninstallApp:function(t,e){t.apps.find((function(t){return t.id===e})).active=!1,t.apps.find((function(t){return t.id===e})).groups=[],t.apps.find((function(t){return t.id===e})).needsDownload=!0,t.apps.find((function(t){return t.id===e})).installed=!1,t.apps.find((function(t){return t.id===e})).canUnInstall=!1,t.apps.find((function(t){return t.id===e})).canInstall=!0},updateApp:function(t,e){var n=t.apps.find((function(t){return t.id===e})),r=n.update;n.update=null,n.version=r,t.updateCount--},resetApps:function(t){t.apps=[]},reset:function(t){t.apps=[],t.categories=[],t.updateCount=0},startLoading:function(t,e){Array.isArray(e)?e.forEach((function(e){i.default.set(t.loading,e,!0)})):i.default.set(t.loading,e,!0)},stopLoading:function(t,e){Array.isArray(e)?e.forEach((function(e){i.default.set(t.loading,e,!1)})):i.default.set(t.loading,e,!1)}},getters:{loading:function(t){return function(e){return t.loading[e]}},getCategories:function(t){return t.categories},getAllApps:function(t){return t.apps},getUpdateCount:function(t){return t.updateCount}},actions:{enableApp:function(e,n){var r,o=n.appId,i=n.groups;return r=Array.isArray(o)?o:[o],re().then((function(n){return e.commit("startLoading",r),e.commit("startLoading","install"),ie(OC.generateUrl("settings/apps/enable"),{appIds:r,groups:i}).then((function(n){return e.commit("stopLoading",r),e.commit("stopLoading","install"),r.forEach((function(t){e.commit("enableApp",{appId:t,groups:i})})),oe(OC.generateUrl("apps/files")).then((function(){n.data.update_required&&(OC.dialogs.info(t("settings","The app has been enabled but needs to be updated. You will be redirected to the update page in 5 seconds."),t("settings","App update"),(function(){window.location.reload()}),!0),setTimeout((function(){location.reload()}),5e3))})).catch((function(){Array.isArray(o)||e.commit("setError",{appId:r,error:t("settings","Error: This app can not be enabled because it makes the server unstable")})}))})).catch((function(t){e.commit("stopLoading",r),e.commit("stopLoading","install"),e.commit("setError",{appId:r,error:t.response.data.data.message}),e.commit("APPS_API_FAILURE",{appId:o,error:t})}))})).catch((function(t){return e.commit("API_FAILURE",{appId:o,error:t})}))},forceEnableApp:function(t,e){var n,r=e.appId;e.groups;return n=Array.isArray(r)?r:[r],re().then((function(){return t.commit("startLoading",n),t.commit("startLoading","install"),ie(OC.generateUrl("settings/apps/force"),{appId:r}).then((function(t){location.reload()})).catch((function(e){t.commit("stopLoading",n),t.commit("stopLoading","install"),t.commit("setError",{appId:n,error:e.response.data.data.message}),t.commit("APPS_API_FAILURE",{appId:r,error:e})}))})).catch((function(e){return t.commit("API_FAILURE",{appId:r,error:e})}))},disableApp:function(t,e){var n,r=e.appId;return n=Array.isArray(r)?r:[r],re().then((function(e){return t.commit("startLoading",n),ie(OC.generateUrl("settings/apps/disable"),{appIds:n}).then((function(e){return t.commit("stopLoading",n),n.forEach((function(e){t.commit("disableApp",e)})),!0})).catch((function(e){t.commit("stopLoading",n),t.commit("APPS_API_FAILURE",{appId:r,error:e})}))})).catch((function(e){return t.commit("API_FAILURE",{appId:r,error:e})}))},uninstallApp:function(t,e){var n=e.appId;return re().then((function(e){return t.commit("startLoading",n),oe(OC.generateUrl("settings/apps/uninstall/".concat(n))).then((function(e){return t.commit("stopLoading",n),t.commit("uninstallApp",n),!0})).catch((function(e){t.commit("stopLoading",n),t.commit("APPS_API_FAILURE",{appId:n,error:e})}))})).catch((function(e){return t.commit("API_FAILURE",{appId:n,error:e})}))},updateApp:function(t,e){var n=e.appId;return re().then((function(e){return t.commit("startLoading",n),t.commit("startLoading","install"),oe(OC.generateUrl("settings/apps/update/".concat(n))).then((function(e){return t.commit("stopLoading","install"),t.commit("stopLoading",n),t.commit("updateApp",n),!0})).catch((function(e){t.commit("stopLoading",n),t.commit("stopLoading","install"),t.commit("APPS_API_FAILURE",{appId:n,error:e})}))})).catch((function(e){return t.commit("API_FAILURE",{appId:n,error:e})}))},getAllApps:function(t){return t.commit("startLoading","list"),oe(OC.generateUrl("settings/apps/list")).then((function(e){return t.commit("setAllApps",e.data.apps),t.commit("stopLoading","list"),!0})).catch((function(e){return t.commit("API_FAILURE",e)}))},getCategories:function(t){return t.commit("startLoading","categories"),oe(OC.generateUrl("settings/apps/categories")).then((function(e){return e.data.length>0&&(t.commit("appendCategories",e.data),t.commit("stopLoading","categories"),!0)})).catch((function(e){return t.commit("API_FAILURE",e)}))}}},pe={state:{serverData:{}},mutations:{setServerData:function(t,e){t.serverData=e}},getters:{getServerData:function(t){return t.serverData}},actions:{}},de={state:{},mutations:{},getters:{},actions:{setAppConfig:function(t,e){var n=e.app,r=e.key,o=e.value;return re().then((function(t){return ie(OC.linkToOCS("apps/provisioning_api/api/v1/config/apps/".concat(n,"/").concat(r),2),{value:o}).catch((function(t){throw t}))})).catch((function(e){return t.commit("API_FAILURE",{app:n,key:r,value:o,error:e})}))}}};
/**
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
*
@@ -103,4 +103,4 @@ i.default.use(Jt.a);var he={API_FAILURE:function(e,n){try{var r=n.error.response
*
*/
i.default.use(a.default,{defaultHtml:!1}),Object(s.sync)(ve,Kt),o.nc=btoa(OC.requestToken),o.p=OC.linkTo("settings","js/"),i.default.prototype.t=t,i.default.prototype.n=n,i.default.prototype.OC=OC,i.default.prototype.OCA=OCA,i.default.prototype.oc_userconfig=oc_userconfig;var me=new i.default({router:Kt,store:ve,render:function(t){return t(f)}}).$mount("#content")}]);
-//# sourceMappingURL=vue-settings-apps-users-management.js.map?v=9a41717789b1a47d5e1e \ No newline at end of file
+//# sourceMappingURL=vue-settings-apps-users-management.js.map?v=2a1a23d390ff09bb2f4b \ No newline at end of file