nextcloud/apps/settings/js/vue-5.js

23 lines
51 KiB
JavaScript

(window.webpackJsonpSettings=window.webpackJsonpSettings||[]).push([[5],{492:function(e,t,s){var n=s(584);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);(0,s(172).default)("50a53998",n,!0,{})},493:function(e,t,s){var n=s(586);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);(0,s(172).default)("ff8e8434",n,!0,{})},494:function(e,t,s){var n=s(589);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);(0,s(172).default)("0ac9816e",n,!0,{})},495:function(e,t,s){var n=s(591);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);(0,s(172).default)("5652d104",n,!0,{})},583:function(e,t,s){"use strict";var n=s(492);s.n(n).a},584:function(e,t,s){(t=s(171)(!1)).push([e.i,"\n.cellText[data-v-4e4f161e] {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n",""]),e.exports=t},585:function(e,t,s){"use strict";var n=s(493);s.n(n).a},586:function(e,t,s){(t=s(171)(!1)).push([e.i,".row--menu-opened[data-v-f7a44eec]{z-index:1 !important}.row[data-v-f7a44eec] .multiselect__single{z-index:auto !important}\n",""]),e.exports=t},588:function(e,t,s){"use strict";var n=s(494);s.n(n).a},589:function(e,t,s){(t=s(171)(!1)).push([e.i,"\n.row[data-v-7a9ad4cb] .multiselect__single {\n\tz-index: auto !important;\n}\n",""]),e.exports=t},590:function(e,t,s){"use strict";var n=s(495);s.n(n).a},591:function(e,t,s){(t=s(171)(!1)).push([e.i,"#usergrouplist #addgroup[data-v-0183f287] .app-navigation-entry__utils{display:none}\n",""]),e.exports=t},603:function(e,s,n){"use strict";n.r(s);var a=n(530),i=n.n(a),r=n(498),o=n.n(r),u=n(499),l=n.n(u),d=n(531),c=n.n(d),g=n(500),p=n.n(g),h=n(501),m=n.n(h),f=n(532),v=n.n(f),w=n(533),b=n.n(w),_=n(30),y=n.n(_),C=n(502),A=n.n(C),U=n(354),k=n(534),L=n.n(k),x=n(11),S=n(503),G=n.n(S),M=n(504),N=n.n(M),O=n(98),$=n(162),P=n(535);function q(e){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}
/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* 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/>.
*
*/var D={props:{user:{type:Object,required:!0},settings:{type:Object,default:function(){return{}}},groups:{type:Array,default:function(){return[]}},subAdminsGroups:{type:Array,default:function(){return[]}},quotaOptions:{type:Array,default:function(){return[]}},showConfig:{type:Object,default:function(){return{}}},languages:{type:Array,required:!0},externalActions:{type:Array,default:function(){return[]}}},computed:{userGroups:function(){var e=this,t=this.groups.filter((function(t){return e.user.groups.includes(t.id)}));return t},userSubAdminsGroups:function(){var e=this,t=this.subAdminsGroups.filter((function(t){return e.user.subadmin.includes(t.id)}));return t},availableGroups:function(){var e=this;return this.groups.map((function(t){var s=Object.assign({},t);return s.$isDisabled=!1===t.canAdd&&!e.user.groups.includes(t.id)||!1===t.canRemove&&e.user.groups.includes(t.id),s}))},usedSpace:function(){return this.user.quota.used?t("settings","{size} used",{size:OC.Util.humanFileSize(this.user.quota.used)}):t("settings","{size} used",{size:OC.Util.humanFileSize(0)})},usedQuota:function(){var e=this.user.quota.quota;e>0?e=Math.min(100,Math.round(this.user.quota.used/e*100)):e=95*(1-1/(this.user.quota.used/(10*Math.pow(2,30))+1));return isNaN(e)?0:e},userQuota:function(){if(this.user.quota.quota>=0){var e=OC.Util.humanFileSize(this.user.quota.quota),t=this.quotaOptions.find((function(t){return t.id===e}));return t||{id:e,label:e}}return"default"===this.user.quota.quota?this.quotaOptions[0]:this.quotaOptions[1]},minPasswordLength:function(){return this.$store.getters.getPasswordPolicyMinLength},userLanguage:function(){var e=this,t=this.languages[0].languages.concat(this.languages[1].languages).find((function(t){return t.code===e.user.language}));return"object"!==q(t)&&""!==this.user.language?{code:this.user.language,name:this.user.language}:""!==this.user.language&&t},userLastLoginTooltip:function(){return this.user.lastLogin>0?OC.Util.formatDate(this.user.lastLogin):""},userLastLogin:function(){return this.user.lastLogin>0?OC.Util.relativeModifiedDate(this.user.lastLogin):t("settings","Never")}},methods:{generateAvatar:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32;return OC.generateUrl("/avatar/{user}/{size}?v={version}",{user:e,size:t,version:oc_userconfig.avatar.version})}}},B={name:"UserRowSimple",components:{PopoverMenu:$.PopoverMenu,ActionButton:$.ActionButton,Actions:$.Actions},directives:{ClickOutside:N.a},mixins:[D],props:{user:{type:Object,required:!0},loading:{type:Object,required:!0},showConfig:{type:Object,required:!0},userActions:{type:Array,required:!0},openedMenu:{type:Boolean,required:!0},feedbackMessage:{type:String,required:!0},subAdminsGroups:{type:Array,required:!0},settings:{type:Object,required:!0}},computed:{userGroupsLabels:function(){return this.userGroups.map((function(e){return e.name})).join(", ")},userSubAdminsGroupsLabels:function(){return this.userSubAdminsGroups.map((function(e){return e.name})).join(", ")},usedSpace:function(){return this.user.quota.used?t("settings","{size} used",{size:OC.Util.humanFileSize(this.user.quota.used)}):t("settings","{size} used",{size:OC.Util.humanFileSize(0)})},canEdit:function(){return Object(P.getCurrentUser)().uid!==this.user.id&&"admin"!==this.user.id}},methods:{hideMenu:function(){this.$emit("hideMenu")},toggleEdit:function(){this.$emit("update:editing",!0)}}},Q=(n(583),n(41)),j=Object(Q.a)(B,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"row",class:{disabled:e.loading.delete||e.loading.disable},attrs:{"data-id":e.user.id}},[s("div",{staticClass:"avatar",class:{"icon-loading-small":e.loading.delete||e.loading.disable||e.loading.wipe}},[e.loading.delete||e.loading.disable||e.loading.wipe?e._e():s("img",{attrs:{alt:"",width:"32",height:"32",src:e.generateAvatar(e.user.id,32),srcset:e.generateAvatar(e.user.id,64)+" 2x, "+e.generateAvatar(e.user.id,128)+" 4x"}})]),e._v(" "),s("div",{staticClass:"name"},[e._v("\n\t\t"+e._s(e.user.id)+"\n\t\t"),s("div",{staticClass:"displayName subtitle"},[s("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.user.displayname.length>20?e.user.displayname:"",expression:"user.displayname.length > 20 ? user.displayname : ''"}],staticClass:"cellText"},[e._v("\n\t\t\t\t"+e._s(e.user.displayname)+"\n\t\t\t")])])]),e._v(" "),s("div"),e._v(" "),s("div",{staticClass:"mailAddress"},[s("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:null!==e.user.email&&e.user.email.length>20?e.user.email:"",expression:"user.email !== null && user.email.length > 20 ? user.email : ''"}],staticClass:"cellText"},[e._v("\n\t\t\t"+e._s(e.user.email)+"\n\t\t")])]),e._v(" "),s("div",{staticClass:"groups"},[e._v("\n\t\t"+e._s(e.userGroupsLabels)+"\n\t")]),e._v(" "),e.subAdminsGroups.length>0&&e.settings.isAdmin?s("div",{staticClass:"subAdminsGroups"},[e._v("\n\t\t"+e._s(e.userSubAdminsGroupsLabels)+"\n\t")]):e._e(),e._v(" "),s("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:e.usedSpace,expression:"usedSpace",modifiers:{auto:!0}}],staticClass:"quota"},[s("progress",{staticClass:"quota-user-progress",class:{warn:e.usedQuota>80},attrs:{max:"100"},domProps:{value:e.usedQuota}})]),e._v(" "),e.showConfig.showLanguages?s("div",{staticClass:"languages"},[e._v("\n\t\t"+e._s(e.userLanguage.name)+"\n\t")]):e._e(),e._v(" "),e.showConfig.showUserBackend||e.showConfig.showStoragePath?s("div",{staticClass:"userBackend"},[e.showConfig.showUserBackend?s("div",{staticClass:"userBackend"},[e._v("\n\t\t\t"+e._s(e.user.backend)+"\n\t\t")]):e._e(),e._v(" "),e.showConfig.showStoragePath?s("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.user.storageLocation,expression:"user.storageLocation"}],staticClass:"storageLocation subtitle"},[e._v("\n\t\t\t"+e._s(e.user.storageLocation)+"\n\t\t")]):e._e()]):e._e(),e._v(" "),e.showConfig.showLastLogin?s("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:e.userLastLoginTooltip,expression:"userLastLoginTooltip",modifiers:{auto:!0}}],staticClass:"lastLogin"},[e._v("\n\t\t"+e._s(e.userLastLogin)+"\n\t")]):e._e(),e._v(" "),s("div",{staticClass:"userActions"},[e.canEdit&&!e.loading.all?s("div",{staticClass:"toggleUserActions"},[s("Actions",[s("ActionButton",{attrs:{icon:"icon-rename"},on:{click:e.toggleEdit}},[e._v("\n\t\t\t\t\t"+e._s(e.t("settings","Edit User"))+"\n\t\t\t\t")])],1),e._v(" "),s("div",{staticClass:"userPopoverMenuWrapper"},[s("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.hideMenu,expression:"hideMenu"}],staticClass:"icon-more",on:{click:function(t){return e.$emit("toggleMenu")}}}),e._v(" "),s("div",{staticClass:"popovermenu",class:{open:e.openedMenu}},[s("PopoverMenu",{attrs:{menu:e.userActions}})],1)])],1):e._e(),e._v(" "),s("div",{staticClass:"feedback",style:{opacity:""!==e.feedbackMessage?1:0}},[s("div",{staticClass:"icon-checkmark"}),e._v("\n\t\t\t"+e._s(e.feedbackMessage)+"\n\t\t")])])])}),[],!1,null,"4e4f161e",null).exports;function z(e,t,s,n,a,i,r){try{var o=e[i](r),u=o.value}catch(e){return void s(e)}o.done?t(u):Promise.resolve(u).then(n,a)}function R(e){return function(){var t=this,s=arguments;return new Promise((function(n,a){var i=e.apply(t,s);function r(e){z(i,n,a,r,o,"next",e)}function o(e){z(i,n,a,r,o,"throw",e)}r(void 0)}))}}x.default.use(O.default);var E={name:"UserRow",components:{UserRowSimple:j,PopoverMenu:$.PopoverMenu,Actions:$.Actions,ActionButton:$.ActionButton,Multiselect:$.Multiselect},directives:{ClickOutside:N.a},mixins:[D],props:{user:{type:Object,required:!0},settings:{type:Object,default:function(){return{}}},groups:{type:Array,default:function(){return[]}},subAdminsGroups:{type:Array,default:function(){return[]}},quotaOptions:{type:Array,default:function(){return[]}},showConfig:{type:Object,default:function(){return{}}},languages:{type:Array,required:!0},externalActions:{type:Array,default:function(){return[]}}},data:function(){return{rand:parseInt(1e3*Math.random()),openedMenu:!1,feedbackMessage:"",editing:!1,loading:{all:!1,displayName:!1,password:!1,mailAddress:!1,groups:!1,subadmins:!1,quota:!1,delete:!1,disable:!1,languages:!1,wipe:!1}}},computed:{userActions:function(){var e=[{icon:"icon-delete",text:t("settings","Delete user"),action:this.deleteUser},{icon:"icon-delete",text:t("settings","Wipe all devices"),action:this.wipeUserDevices},{icon:this.user.enabled?"icon-close":"icon-add",text:this.user.enabled?t("settings","Disable user"):t("settings","Enable user"),action:this.enableDisableUser}];return null!==this.user.email&&""!==this.user.email&&e.push({icon:"icon-mail",text:t("settings","Resend welcome email"),action:this.sendWelcomeMail}),e.concat(this.externalActions)}},methods:{toggleMenu:function(){this.openedMenu=!this.openedMenu},hideMenu:function(){this.openedMenu=!1},wipeUserDevices:function(){var e=this,s=this.user.id;OC.dialogs.confirmDestructive(t("settings","In case of lost device or exiting the organization, this can remotely wipe the Nextcloud data from all devices associated with {userid}. Only works if the devices are connected to the internet.",{userid:s}),t("settings","Remote wipe of devices"),{type:OC.dialogs.YES_NO_BUTTONS,confirm:t("settings","Wipe {userid}'s devices",{userid:s}),confirmClasses:"error",cancel:t("settings","Cancel")},(function(t){t&&(e.loading.wipe=!0,e.loading.all=!0,e.$store.dispatch("wipeUserDevices",s).then((function(){e.loading.wipe=!1,e.loading.all=!1})))}),!0)},deleteUser:function(){var e=this,s=this.user.id;OC.dialogs.confirmDestructive(t("settings","Fully delete {userid}'s account including all their personal files, app data, etc.",{userid:s}),t("settings","Account deletion"),{type:OC.dialogs.YES_NO_BUTTONS,confirm:t("settings","Delete {userid}'s account",{userid:s}),confirmClasses:"error",cancel:t("settings","Cancel")},(function(t){if(t)return e.loading.delete=!0,e.loading.all=!0,e.$store.dispatch("deleteUser",s).then((function(){e.loading.delete=!1,e.loading.all=!1}))}),!0)},enableDisableUser:function(){var e=this;this.loading.delete=!0,this.loading.all=!0;var t=this.user.id,s=!this.user.enabled;return this.$store.dispatch("enableDisableUser",{userid:t,enabled:s}).then((function(){e.loading.delete=!1,e.loading.all=!1}))},updateDisplayName:function(){var e=this,t=this.$refs.displayName.value;this.loading.displayName=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"displayname",value:t}).then((function(){e.loading.displayName=!1,e.$refs.displayName.value=t}))},updatePassword:function(){var e=this,t=this.$refs.password.value;this.loading.password=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"password",value:t}).then((function(){e.loading.password=!1,e.$refs.password.value=""}))},updateEmail:function(){var e=this,t=this.$refs.mailAddress.value;this.loading.mailAddress=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"email",value:t}).then((function(){e.loading.mailAddress=!1,e.$refs.mailAddress.value=t}))},createGroup:function(e){var t=this;return R(regeneratorRuntime.mark((function s(){var n;return regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return t.loading={groups:!0,subadmins:!0},s.prev=1,s.next=4,t.$store.dispatch("addGroup",e);case 4:return n=t.user.id,s.next=7,t.$store.dispatch("addUserGroup",{userid:n,gid:e});case 7:s.next=12;break;case 9:s.prev=9,s.t0=s.catch(1),console.error(s.t0);case 12:return s.prev=12,t.loading={groups:!1,subadmins:!1},s.finish(12);case 15:return s.abrupt("return",t.$store.getters.getGroups[t.groups.length]);case 16:case"end":return s.stop()}}),s,null,[[1,9,12,15]])})))()},addUserGroup:function(e){var t=this;return R(regeneratorRuntime.mark((function s(){var n,a;return regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(!1!==e.canAdd){s.next=2;break}return s.abrupt("return",!1);case 2:return t.loading.groups=!0,n=t.user.id,a=e.id,s.prev=5,s.next=8,t.$store.dispatch("addUserGroup",{userid:n,gid:a});case 8:s.next=13;break;case 10:s.prev=10,s.t0=s.catch(5),console.error(s.t0);case 13:return s.prev=13,t.loading.groups=!1,s.finish(13);case 16:case"end":return s.stop()}}),s,null,[[5,10,13,16]])})))()},removeUserGroup:function(e){var t=this;return R(regeneratorRuntime.mark((function s(){var n,a;return regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(!1!==e.canRemove){s.next=2;break}return s.abrupt("return",!1);case 2:return t.loading.groups=!0,n=t.user.id,a=e.id,s.prev=5,s.next=8,t.$store.dispatch("removeUserGroup",{userid:n,gid:a});case 8:t.loading.groups=!1,t.$route.params.selectedGroup===a&&t.$store.commit("deleteUser",n),s.next=15;break;case 12:s.prev=12,s.t0=s.catch(5),t.loading.groups=!1;case 15:case"end":return s.stop()}}),s,null,[[5,12]])})))()},addUserSubAdmin:function(e){var t=this;return R(regeneratorRuntime.mark((function s(){var n,a;return regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return t.loading.subadmins=!0,n=t.user.id,a=e.id,s.prev=3,s.next=6,t.$store.dispatch("addUserSubAdmin",{userid:n,gid:a});case 6:t.loading.subadmins=!1,s.next=12;break;case 9:s.prev=9,s.t0=s.catch(3),console.error(s.t0);case 12:case"end":return s.stop()}}),s,null,[[3,9]])})))()},removeUserSubAdmin:function(e){var t=this;return R(regeneratorRuntime.mark((function s(){var n,a;return regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return t.loading.subadmins=!0,n=t.user.id,a=e.id,s.prev=3,s.next=6,t.$store.dispatch("removeUserSubAdmin",{userid:n,gid:a});case 6:s.next=11;break;case 8:s.prev=8,s.t0=s.catch(3),console.error(s.t0);case 11:return s.prev=11,t.loading.subadmins=!1,s.finish(11);case 14:case"end":return s.stop()}}),s,null,[[3,8,11,14]])})))()},setUserQuota:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";return R(regeneratorRuntime.mark((function s(){return regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return e.loading.quota=!0,t=t.id?t.id:t,s.prev=2,s.next=5,e.$store.dispatch("setUserData",{userid:e.user.id,key:"quota",value:t});case 5:s.next=10;break;case 7:s.prev=7,s.t0=s.catch(2),console.error(s.t0);case 10:return s.prev=10,e.loading.quota=!1,s.finish(10);case 13:return s.abrupt("return",t);case 14:case"end":return s.stop()}}),s,null,[[2,7,10,13]])})))()},validateQuota:function(e){var t=OC.Util.computerFileSize(e);return null!==t&&t>=0&&this.setUserQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(e)))},setUserLanguage:function(e){var t=this;return R(regeneratorRuntime.mark((function s(){return regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return t.loading.languages=!0,s.prev=1,s.next=4,t.$store.dispatch("setUserData",{userid:t.user.id,key:"language",value:e.code});case 4:s.next=9;break;case 6:s.prev=6,s.t0=s.catch(1),console.error(s.t0);case 9:return s.prev=9,t.loading.languages=!1,s.finish(9);case 12:return s.abrupt("return",e);case 13:case"end":return s.stop()}}),s,null,[[1,6,9,12]])})))()},sendWelcomeMail:function(){var e=this;this.loading.all=!0,this.$store.dispatch("sendWelcomeMail",this.user.id).then((function(s){s&&(e.feedbackMessage=t("setting","Welcome mail sent!"),setTimeout((function(){e.feedbackMessage=""}),2e3)),e.loading.all=!1}))}}},F=(n(585),Object(Q.a)(E,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return 1===Object.keys(e.user).length?s("div",{staticClass:"row",attrs:{"data-id":e.user.id}},[s("div",{staticClass:"avatar",class:{"icon-loading-small":e.loading.delete||e.loading.disable||e.loading.wipe}},[e.loading.delete||e.loading.disable||e.loading.wipe?e._e():s("img",{attrs:{src:e.generateAvatar(e.user.id,32),srcset:e.generateAvatar(e.user.id,64)+" 2x, "+e.generateAvatar(e.user.id,128)+" 4x",alt:"",height:"32",width:"32"}})]),e._v(" "),s("div",{staticClass:"name"},[e._v("\n\t\t"+e._s(e.user.id)+"\n\t")]),e._v(" "),s("div",{staticClass:"obfuscated"},[e._v("\n\t\t"+e._s(e.t("settings","You do not have permissions to see the details of this user"))+"\n\t")])]):e.editing?s("div",{staticClass:"row row--editable",class:{disabled:e.loading.delete||e.loading.disable,"row--menu-opened":e.openedMenu},attrs:{"data-id":e.user.id}},[s("div",{staticClass:"avatar",class:{"icon-loading-small":e.loading.delete||e.loading.disable||e.loading.wipe}},[e.loading.delete||e.loading.disable||e.loading.wipe?e._e():s("img",{attrs:{src:e.generateAvatar(e.user.id,32),srcset:e.generateAvatar(e.user.id,64)+" 2x, "+e.generateAvatar(e.user.id,128)+" 4x",alt:"",height:"32",width:"32"}})]),e._v(" "),e.user.backendCapabilities.setDisplayName?s("div",{staticClass:"displayName"},[s("form",{staticClass:"displayName",class:{"icon-loading-small":e.loading.displayName},on:{submit:function(t){return t.preventDefault(),e.updateDisplayName(t)}}},[s("input",{ref:"displayName",attrs:{id:"displayName"+e.user.id+e.rand,disabled:e.loading.displayName||e.loading.all,autocapitalize:"off",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text"},domProps:{value:e.user.displayname}}),e._v(" "),s("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})])]):s("div",{staticClass:"name"},[e._v("\n\t\t"+e._s(e.user.id)+"\n\t\t"),s("div",{staticClass:"displayName subtitle"},[s("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.user.displayname.length>20?e.user.displayname:"",expression:"user.displayname.length > 20 ? user.displayname : ''"}],staticClass:"cellText"},[e._v("\n\t\t\t\t"+e._s(e.user.displayname)+"\n\t\t\t")])])]),e._v(" "),e.settings.canChangePassword&&e.user.backendCapabilities.setPassword?s("form",{staticClass:"password",class:{"icon-loading-small":e.loading.password},on:{submit:function(t){return t.preventDefault(),e.updatePassword(t)}}},[s("input",{ref:"password",attrs:{id:"password"+e.user.id+e.rand,disabled:e.loading.password||e.loading.all,minlength:e.minPasswordLength,placeholder:e.t("settings","Add new password"),autocapitalize:"off",autocomplete:"new-password",autocorrect:"off",required:"",spellcheck:"false",type:"password",value:""}}),e._v(" "),s("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})]):s("div"),e._v(" "),s("form",{staticClass:"mailAddress",class:{"icon-loading-small":e.loading.mailAddress},on:{submit:function(t){return t.preventDefault(),e.updateEmail(t)}}},[s("input",{ref:"mailAddress",attrs:{id:"mailAddress"+e.user.id+e.rand,disabled:e.loading.mailAddress||e.loading.all,placeholder:e.t("settings","Add new email address"),autocapitalize:"off",autocomplete:"new-password",autocorrect:"off",spellcheck:"false",type:"email"},domProps:{value:e.user.email}}),e._v(" "),s("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})]),e._v(" "),s("div",{staticClass:"groups",class:{"icon-loading-small":e.loading.groups}},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{"close-on-select":!1,disabled:e.loading.groups||e.loading.all,limit:2,multiple:!0,options:e.availableGroups,placeholder:e.t("settings","Add user in group"),"tag-width":60,taggable:e.settings.isAdmin,value:e.userGroups,label:"name","tag-placeholder":"create","track-by":"id"},on:{remove:e.removeUserGroup,select:e.addUserGroup,tag:e.createGroup}},[s("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v(e._s(e.t("settings","No results")))])])],1),e._v(" "),e.subAdminsGroups.length>0&&e.settings.isAdmin?s("div",{staticClass:"subadmins",class:{"icon-loading-small":e.loading.subadmins}},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{"close-on-select":!1,disabled:e.loading.subadmins||e.loading.all,limit:2,multiple:!0,options:e.subAdminsGroups,placeholder:e.t("settings","Set user as admin for"),"tag-width":60,value:e.userSubAdminsGroups,label:"name","track-by":"id"},on:{remove:e.removeUserSubAdmin,select:e.addUserSubAdmin}},[s("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v(e._s(e.t("settings","No results")))])])],1):e._e(),e._v(" "),s("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:e.usedSpace,expression:"usedSpace",modifiers:{auto:!0}}],staticClass:"quota",class:{"icon-loading-small":e.loading.quota}},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{"allow-empty":!1,disabled:e.loading.quota||e.loading.all,options:e.quotaOptions,placeholder:e.t("settings","Select user quota"),taggable:!0,value:e.userQuota,label:"label","tag-placeholder":"create","track-by":"id"},on:{input:e.setUserQuota,tag:e.validateQuota}})],1),e._v(" "),e.showConfig.showLanguages?s("div",{staticClass:"languages",class:{"icon-loading-small":e.loading.languages}},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{"allow-empty":!1,disabled:e.loading.languages||e.loading.all,options:e.languages,placeholder:e.t("settings","No language set"),value:e.userLanguage,"group-label":"label","group-values":"languages",label:"name","track-by":"code"},on:{input:e.setUserLanguage}})],1):e._e(),e._v(" "),e.showConfig.showStoragePath||e.showConfig.showUserBackend?s("div",{staticClass:"storageLocation"}):e._e(),e._v(" "),e.showConfig.showLastLogin?s("div"):e._e(),e._v(" "),s("div",{staticClass:"userActions"},[e.OC.currentUser===e.user.id||"admin"===e.user.id||e.loading.all?e._e():s("div",{staticClass:"toggleUserActions"},[s("Actions",[s("ActionButton",{attrs:{icon:"icon-checkmark"},on:{click:function(t){e.editing=!1}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("settings","Done"))+"\n\t\t\t\t")])],1),e._v(" "),s("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.hideMenu,expression:"hideMenu"}],staticClass:"userPopoverMenuWrapper"},[s("div",{staticClass:"icon-more",on:{click:e.toggleMenu}}),e._v(" "),s("div",{staticClass:"popovermenu",class:{open:e.openedMenu}},[s("PopoverMenu",{attrs:{menu:e.userActions}})],1)])],1),e._v(" "),s("div",{staticClass:"feedback",style:{opacity:""!==e.feedbackMessage?1:0}},[s("div",{staticClass:"icon-checkmark"}),e._v("\n\t\t\t"+e._s(e.feedbackMessage)+"\n\t\t")])])]):s("UserRowSimple",{class:{"row--menu-opened":e.openedMenu},attrs:{editing:e.editing,"feedback-message":e.feedbackMessage,groups:e.groups,languages:e.languages,loading:e.loading,"opened-menu":e.openedMenu,settings:e.settings,"show-config":e.showConfig,"sub-admins-groups":e.subAdminsGroups,"user-actions":e.userActions,user:e.user},on:{"update:editing":function(t){e.editing=t},hideMenu:e.hideMenu,toggleMenu:e.toggleMenu}})}),[],!1,null,"f7a44eec",null).exports),W=n(587),T=n.n(W),I={id:"none",label:t("settings","Unlimited")},Y={id:"default",label:t("settings","Default quota")},H={id:"",displayName:"",password:"",mailAddress:"",groups:[],subAdminsGroups:[],quota:Y,language:{code:"en",name:t("settings","Default language")}},J={name:"UserList",components:{userRow:F,Multiselect:$.Multiselect,InfiniteLoading:T.a,Actions:$.Actions,ActionButton:$.ActionButton},props:{users:{type:Array,default:function(){return[]}},showConfig:{type:Object,required:!0},selectedGroup:{type:String,default:null},externalActions:{type:Array,default:function(){return[]}}},data:function(){return{unlimitedQuota:I,defaultQuota:Y,loading:{all:!1,groups:!1},scrolled:!1,searchQuery:"",newUser:Object.assign({},H)}},computed:{settings:function(){return this.$store.getters.getServerData},filteredUsers:function(){return"disabled"===this.selectedGroup?this.users.filter((function(e){return!1===e.enabled})):this.settings.isAdmin?this.users.filter((function(e){return!1!==e.enabled})):this.users.filter((function(e){return!1!==e.enabled&&e.id!==OC.getCurrentUser().uid}))},groups:function(){return this.$store.getters.getGroups.filter((function(e){return"disabled"!==e.id})).sort((function(e,t){return e.name.localeCompare(t.name)}))},canAddGroups:function(){return this.groups.map((function(e){return(e=Object.assign({},e)).$isDisabled=!1===e.canAdd,e}))},subAdminsGroups:function(){return this.$store.getters.getSubadminGroups},quotaOptions:function(){var e=this.settings.quotaPreset.reduce((function(e,t){return e.concat({id:t,label:t})}),[]);return e.unshift(this.unlimitedQuota),e.unshift(this.defaultQuota),e},minPasswordLength:function(){return this.$store.getters.getPasswordPolicyMinLength},usersOffset:function(){return this.$store.getters.getUsersOffset},usersLimit:function(){return this.$store.getters.getUsersLimit},usersCount:function(){return this.users.length},languages:function(){return[{label:t("settings","Common languages"),languages:this.settings.languages.commonlanguages},{label:t("settings","All languages"),languages:this.settings.languages.languages}]}},watch:{selectedGroup:function(e,t){this.redirectIfDisabled(),this.$store.commit("resetUsers"),this.$refs.infiniteLoading.stateChanger.reset(),this.setNewUserDefaultGroup(e)},usersCount:function(e,t){0===e&&1===t?this.$refs.infiniteLoading.stateChanger.reset():1===e&&0===t&&this.$refs.infiniteLoading.stateChanger.loaded()}},mounted:function(){this.settings.canChangePassword||OC.Notification.showTemporary(t("settings","Password change is disabled because the master key is disabled")),this.resetForm(),this.userSearch=new OCA.Search(this.search,this.resetSearch),this.redirectIfDisabled()},methods:{onScroll:function(e){this.scrolled=e.target.scrollTo>0},validateQuota:function(e){var t=OC.Util.computerFileSize(e);return null!==t&&t>=0?(e=OC.Util.humanFileSize(OC.Util.computerFileSize(e)),this.newUser.quota={id:e,label:e},this.newUser.quota):(this.newUser.quota=this.quotaOptions[0],this.quotaOptions[0])},infiniteHandler:function(e){this.$store.dispatch("getUsers",{offset:this.usersOffset,limit:this.usersLimit,group:"disabled"!==this.selectedGroup?this.selectedGroup:"",search:this.searchQuery}).then((function(t){t?e.loaded():e.complete()}))},search:function(e){this.searchQuery=e,this.$store.commit("resetUsers"),this.$refs.infiniteLoading.stateChanger.reset()},resetSearch:function(){this.search("")},resetForm:function(){this.newUser=Object.assign({},H),this.settings.defaultLanguage&&x.default.set(this.newUser.language,"code",this.settings.defaultLanguage),this.setNewUserDefaultGroup(this.selectedGroup),this.loading.all=!1},createUser:function(){var e=this;this.loading.all=!0,this.$store.dispatch("addUser",{userid:this.newUser.id,password:this.newUser.password,displayName:this.newUser.displayName,email:this.newUser.mailAddress,groups:this.newUser.groups.map((function(e){return e.id})),subadmin:this.newUser.subAdminsGroups.map((function(e){return e.id})),quota:this.newUser.quota.id,language:this.newUser.language.code}).then((function(){e.resetForm(),e.$refs.newusername.focus()})).catch((function(t){if(e.loading.all=!1,t.response&&t.response.data&&t.response.data.ocs&&t.response.data.ocs.meta){var s=t.response.data.ocs.meta.statuscode;102===s?e.$refs.newusername.focus():107===s&&e.$refs.newuserpassword.focus()}}))},setNewUserDefaultGroup:function(e){if(e&&e.length>0){var t=this.groups.find((function(t){return t.id===e}));if(t)return void(this.newUser.groups=[t])}this.newUser.groups=[]},createGroup:function(e){var t=this;return this.loading.groups=!0,this.$store.dispatch("addGroup",e).then((function(s){t.newUser.groups.push(t.groups.find((function(t){return t.id===e}))),t.loading.groups=!1})).catch((function(){t.loading.groups=!1})),this.$store.getters.getGroups[this.groups.length]},redirectIfDisabled:function(){var e=this.$store.getters.getGroups;"disabled"===this.selectedGroup&&e.findIndex((function(e){return"disabled"===e.id&&0===e.usercount}))>-1&&(this.$router.push({name:"users"}),this.$refs.infiniteLoading.stateChanger.reset())},onClose:function(){this.showConfig.showNewUserForm=!1}}},Z=(n(588),Object(Q.a)(J,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"user-list-grid",attrs:{id:"app-content"},on:{"&scroll":function(t){return e.onScroll(t)}}},[s("form",{directives:[{name:"show",rawName:"v-show",value:e.showConfig.showNewUserForm,expression:"showConfig.showNewUserForm"}],staticClass:"row",class:{sticky:e.scrolled&&e.showConfig.showNewUserForm},attrs:{id:"new-user",disabled:e.loading.all},on:{submit:function(t){return t.preventDefault(),e.createUser(t)}}},[s("div",{class:e.loading.all?"icon-loading-small":"icon-add"}),e._v(" "),s("div",{staticClass:"name"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.newUser.id,expression:"newUser.id"}],ref:"newusername",attrs:{id:"newusername",disabled:e.settings.newUserGenerateUserID,placeholder:e.settings.newUserGenerateUserID?e.t("settings","Will be autogenerated"):e.t("settings","Username"),autocapitalize:"none",autocomplete:"off",autocorrect:"off",name:"username",pattern:"[a-zA-Z0-9 _\\.@\\-']+",required:"",type:"text"},domProps:{value:e.newUser.id},on:{input:function(t){t.target.composing||e.$set(e.newUser,"id",t.target.value)}}}),e._v(" "),s("div",{staticClass:"displayName"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.newUser.displayName,expression:"newUser.displayName"}],attrs:{id:"newdisplayname",placeholder:e.t("settings","Display name"),autocapitalize:"none",autocomplete:"off",autocorrect:"off",name:"displayname",type:"text"},domProps:{value:e.newUser.displayName},on:{input:function(t){t.target.composing||e.$set(e.newUser,"displayName",t.target.value)}}})])]),e._v(" "),s("div",{staticClass:"password"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.newUser.password,expression:"newUser.password"}],ref:"newuserpassword",attrs:{id:"newuserpassword",minlength:e.minPasswordLength,placeholder:e.t("settings","Password"),required:""===e.newUser.mailAddress,autocapitalize:"none",autocomplete:"new-password",autocorrect:"off",name:"password",type:"password"},domProps:{value:e.newUser.password},on:{input:function(t){t.target.composing||e.$set(e.newUser,"password",t.target.value)}}})]),e._v(" "),s("div",{staticClass:"mailAddress"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.newUser.mailAddress,expression:"newUser.mailAddress"}],attrs:{id:"newemail",placeholder:e.t("settings","Email"),required:""===e.newUser.password||e.settings.newUserRequireEmail,autocapitalize:"none",autocomplete:"off",autocorrect:"off",name:"email",type:"email"},domProps:{value:e.newUser.mailAddress},on:{input:function(t){t.target.composing||e.$set(e.newUser,"mailAddress",t.target.value)}}})]),e._v(" "),s("div",{staticClass:"groups"},[e.settings.isAdmin?e._e():s("input",{class:{"icon-loading-small":e.loading.groups},attrs:{id:"newgroups",required:!e.settings.isAdmin,tabindex:"-1",type:"text"},domProps:{value:e.newUser.groups}}),e._v(" "),s("Multiselect",{staticClass:"multiselect-vue",attrs:{"close-on-select":!1,disabled:e.loading.groups||e.loading.all,multiple:!0,options:e.canAddGroups,placeholder:e.t("settings","Add user in group"),"tag-width":60,taggable:!0,label:"name","tag-placeholder":"create","track-by":"id"},on:{tag:e.createGroup},model:{value:e.newUser.groups,callback:function(t){e.$set(e.newUser,"groups",t)},expression:"newUser.groups"}},[s("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v(e._s(e.t("settings","No results")))])])],1),e._v(" "),e.subAdminsGroups.length>0&&e.settings.isAdmin?s("div",{staticClass:"subadmins"},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{"close-on-select":!1,multiple:!0,options:e.subAdminsGroups,placeholder:e.t("settings","Set user as admin for"),"tag-width":60,label:"name","track-by":"id"},model:{value:e.newUser.subAdminsGroups,callback:function(t){e.$set(e.newUser,"subAdminsGroups",t)},expression:"newUser.subAdminsGroups"}},[s("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v(e._s(e.t("settings","No results")))])])],1):e._e(),e._v(" "),s("div",{staticClass:"quota"},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{"allow-empty":!1,options:e.quotaOptions,placeholder:e.t("settings","Select user quota"),taggable:!0,label:"label","track-by":"id"},on:{tag:e.validateQuota},model:{value:e.newUser.quota,callback:function(t){e.$set(e.newUser,"quota",t)},expression:"newUser.quota"}})],1),e._v(" "),e.showConfig.showLanguages?s("div",{staticClass:"languages"},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{"allow-empty":!1,options:e.languages,placeholder:e.t("settings","Default language"),"group-label":"label","group-values":"languages",label:"name","track-by":"code"},model:{value:e.newUser.language,callback:function(t){e.$set(e.newUser,"language",t)},expression:"newUser.language"}})],1):e._e(),e._v(" "),e.showConfig.showStoragePath?s("div",{staticClass:"storageLocation"}):e._e(),e._v(" "),e.showConfig.showUserBackend?s("div",{staticClass:"userBackend"}):e._e(),e._v(" "),e.showConfig.showLastLogin?s("div",{staticClass:"lastLogin"}):e._e(),e._v(" "),s("div",{staticClass:"userActions"},[s("input",{staticClass:"button primary icon-checkmark-white has-tooltip",attrs:{id:"newsubmit",title:e.t("settings","Add a new user"),type:"submit",value:""}}),e._v(" "),s("div",{staticClass:"closeButton"},[s("Actions",[s("ActionButton",{attrs:{icon:"icon-close"},on:{click:e.onClose}},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("settings","Close"))+"\n\t\t\t\t\t")])],1)],1)])]),e._v(" "),s("div",{staticClass:"row",class:{sticky:e.scrolled&&!e.showConfig.showNewUserForm},attrs:{id:"grid-header"}},[s("div",{staticClass:"avatar",attrs:{id:"headerAvatar"}}),e._v(" "),s("div",{staticClass:"name",attrs:{id:"headerName"}},[e._v("\n\t\t\t"+e._s(e.t("settings","Username"))+"\n\n\t\t\t"),s("div",{staticClass:"subtitle"},[e._v("\n\t\t\t\t"+e._s(e.t("settings","Display name"))+"\n\t\t\t")])]),e._v(" "),s("div",{staticClass:"password",attrs:{id:"headerPassword"}},[e._v("\n\t\t\t"+e._s(e.t("settings","Password"))+"\n\t\t")]),e._v(" "),s("div",{staticClass:"mailAddress",attrs:{id:"headerAddress"}},[e._v("\n\t\t\t"+e._s(e.t("settings","Email"))+"\n\t\t")]),e._v(" "),s("div",{staticClass:"groups",attrs:{id:"headerGroups"}},[e._v("\n\t\t\t"+e._s(e.t("settings","Groups"))+"\n\t\t")]),e._v(" "),e.subAdminsGroups.length>0&&e.settings.isAdmin?s("div",{staticClass:"subadmins",attrs:{id:"headerSubAdmins"}},[e._v("\n\t\t\t"+e._s(e.t("settings","Group admin for"))+"\n\t\t")]):e._e(),e._v(" "),s("div",{staticClass:"quota",attrs:{id:"headerQuota"}},[e._v("\n\t\t\t"+e._s(e.t("settings","Quota"))+"\n\t\t")]),e._v(" "),e.showConfig.showLanguages?s("div",{staticClass:"languages",attrs:{id:"headerLanguages"}},[e._v("\n\t\t\t"+e._s(e.t("settings","Language"))+"\n\t\t")]):e._e(),e._v(" "),e.showConfig.showUserBackend||e.showConfig.showStoragePath?s("div",{staticClass:"headerUserBackend userBackend"},[e.showConfig.showUserBackend?s("div",{staticClass:"userBackend"},[e._v("\n\t\t\t\t"+e._s(e.t("settings","User backend"))+"\n\t\t\t")]):e._e(),e._v(" "),e.showConfig.showStoragePath?s("div",{staticClass:"subtitle storageLocation"},[e._v("\n\t\t\t\t"+e._s(e.t("settings","Storage location"))+"\n\t\t\t")]):e._e()]):e._e(),e._v(" "),e.showConfig.showLastLogin?s("div",{staticClass:"headerLastLogin lastLogin"},[e._v("\n\t\t\t"+e._s(e.t("settings","Last login"))+"\n\t\t")]):e._e(),e._v(" "),s("div",{staticClass:"userActions"})]),e._v(" "),e._l(e.filteredUsers,(function(t,n){return s("user-row",{key:n,attrs:{"external-actions":e.externalActions,groups:e.groups,languages:e.languages,"quota-options":e.quotaOptions,settings:e.settings,"show-config":e.showConfig,"sub-admins-groups":e.subAdminsGroups,user:t}})})),e._v(" "),s("InfiniteLoading",{ref:"infiniteLoading",on:{infinite:e.infiniteHandler}},[s("div",{attrs:{slot:"spinner"},slot:"spinner"},[s("div",{staticClass:"users-icon-loading icon-loading"})]),e._v(" "),s("div",{attrs:{slot:"no-more"},slot:"no-more"},[s("div",{staticClass:"users-list-end"})]),e._v(" "),s("div",{attrs:{slot:"no-results"},slot:"no-results"},[s("div",{attrs:{id:"emptycontent"}},[s("div",{staticClass:"icon-contacts-dark"}),e._v(" "),s("h2",[e._v(e._s(e.t("settings","No users in here")))])])])])],2)}),[],!1,null,"7a9ad4cb",null).exports);function K(e){return(K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function V(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function X(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?V(Object(s),!0).forEach((function(t){ee(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):V(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}function ee(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function te(e,t,s,n,a,i,r){try{var o=e[i](r),u=o.value}catch(e){return void s(e)}o.done?t(u):Promise.resolve(u).then(n,a)}function se(e){return function(){var t=this,s=arguments;return new Promise((function(n,a){var i=e.apply(t,s);function r(e){te(i,n,a,r,o,"next",e)}function o(e){te(i,n,a,r,o,"throw",e)}r(void 0)}))}}x.default.use(G.a);var ne={name:"Users",components:{ActionButton:i.a,AppContent:o.a,AppNavigation:l.a,AppNavigationCaption:c.a,AppNavigationCounter:p.a,AppNavigationItem:m.a,AppNavigationNew:v.a,AppNavigationSettings:b.a,Content:A.a,Multiselect:L.a,UserList:Z},props:{selectedGroup:{type:String,default:null}},data:function(){return{unlimitedQuota:{id:"none",label:t("settings","Unlimited")},selectedQuota:!1,externalActions:[],loadingAddGroup:!1,loadingSendMail:!1,showConfig:{showStoragePath:!1,showUserBackend:!1,showLastLogin:!1,showNewUserForm:!1,showLanguages:!1}}},computed:{users:function(){return this.$store.getters.getUsers},groups:function(){return this.$store.getters.getGroups},usersOffset:function(){return this.$store.getters.getUsersOffset},usersLimit:function(){return this.$store.getters.getUsersLimit},showLanguages:{get:function(){return this.getLocalstorage("showLanguages")},set:function(e){this.setLocalStorage("showLanguages",e)}},showLastLogin:{get:function(){return this.getLocalstorage("showLastLogin")},set:function(e){this.setLocalStorage("showLastLogin",e)}},showUserBackend:{get:function(){return this.getLocalstorage("showUserBackend")},set:function(e){this.setLocalStorage("showUserBackend",e)}},showStoragePath:{get:function(){return this.getLocalstorage("showStoragePath")},set:function(e){this.setLocalStorage("showStoragePath",e)}},userCount:function(){return this.$store.getters.getUserCount},settings:function(){return this.$store.getters.getServerData},quotaOptions:function(){var e=this.settings.quotaPreset.reduce((function(e,t){return e.concat({id:t,label:t})}),[]);return e.unshift(this.unlimitedQuota),e},defaultQuota:{get:function(){return!1!==this.selectedQuota?this.selectedQuota:this.settings.defaultQuota!==this.unlimitedQuota.id&&OC.Util.computerFileSize(this.settings.defaultQuota)>=0?{id:this.settings.defaultQuota,label:this.settings.defaultQuota}:this.unlimitedQuota},set:function(e){this.selectedQuota=e}},sendWelcomeMail:{get:function(){return this.settings.newUserSendEmail},set:function(e){var t=this;return se(regeneratorRuntime.mark((function s(){return regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,t.loadingSendMail=!0,t.$store.commit("setServerData",X({},t.settings,{newUserSendEmail:e})),s.next=5,y.a.post(Object(U.generateUrl)("/settings/users/preferences/newUser.sendEmail"),{value:e?"yes":"no"});case 5:s.next=10;break;case 7:s.prev=7,s.t0=s.catch(0),console.error("could not update newUser.sendEmail preference: "+s.t0.message,s.t0);case 10:return s.prev=10,t.loadingSendMail=!1,s.finish(10);case 13:case"end":return s.stop()}}),s,null,[[0,7,10,13]])})))()}},groupList:function(){var e=this;return(Array.isArray(this.groups)?this.groups:[]).filter((function(e){return"disabled"!==e.id&&"admin"!==e.id})).map((function(t){return e.formatGroupMenu(t)}))},adminGroupMenu:function(){return this.formatGroupMenu(this.groups.find((function(e){return"admin"===e.id})))},disabledGroupMenu:function(){return this.formatGroupMenu(this.groups.find((function(e){return"disabled"===e.id})))}},beforeMount:function(){this.$store.commit("initGroups",{groups:this.$store.getters.getServerData.groups,orderBy:this.$store.getters.getServerData.sortGroups,userCount:this.$store.getters.getServerData.userCount}),this.$store.dispatch("getPasswordPolicyMinLength")},created:function(){Object.assign(OCA,{Settings:{UserList:{registerAction:this.registerAction}}})},methods:{toggleNewUserMenu:function(){this.showConfig.showNewUserForm=!this.showConfig.showNewUserForm,this.showConfig.showNewUserForm&&x.default.nextTick((function(){window.newusername.focus()}))},getLocalstorage:function(e){var t=this.$localStorage.get(e);return this.showConfig[e]=null!==t?"true"===t:this.showConfig[e],this.showConfig[e]},setLocalStorage:function(e,t){return this.showConfig[e]=t,this.$localStorage.set(e,t),t},removeGroup:function(e){var s=this;OC.dialogs.confirm(t("settings","You are about to remove the group {group}. The users will NOT be deleted.",{group:e}),t("settings","Please confirm the group removal "),(function(t){t&&s.$store.dispatch("removeGroup",e)}))},setDefaultQuota:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";this.$store.dispatch("setAppConfig",{app:"files",key:"default_quota",value:t.id?t.id:t}).then((function(){"object"!==K(t)&&(t={id:t,label:t}),e.defaultQuota=t}))},validateQuota:function(e){return null===OC.Util.computerFileSize(e)?this.setDefaultQuota("none"):this.setDefaultQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(e)))},registerAction:function(e,t,s){return this.externalActions.push({icon:e,text:t,action:s}),this.externalActions},createGroup:function(e){var t=this;return se(regeneratorRuntime.mark((function s(){return regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(""!==e.trim()){s.next=3;break}return x.default.nextTick((function(){t.toggleAddGroupEntry(!0)})),s.abrupt("return");case 3:return s.prev=3,t.loadingAddGroup=!0,s.next=7,t.$store.dispatch("addGroup",e.trim());case 7:t.toggleAddGroupEntry(!1),t.$router.push({name:"group",params:{selectedGroup:e.trim()}}),s.next=14;break;case 11:s.prev=11,s.t0=s.catch(3),t.toggleAddGroupEntry(!0);case 14:return s.prev=14,t.loadingAddGroup=!1,s.finish(14);case 17:case"end":return s.stop()}}),s,null,[[3,11,14,17]])})))()},toggleAddGroupEntry:function(e){var t=this;void 0===e&&(e=!this.$refs.addGroup.editing),this.$refs.addGroup.editing=e,x.default.nextTick((function(){if(t.$refs.addGroup.$el){var e=t.$refs.addGroup.$el.querySelector('form > input[type="text"]');e&&e.focus()}}))},formatGroupMenu:function(e){var t={};return t.id=e.id,t.title=e.name,t.usercount=e.usercount,e.usercount-e.disabled>0&&(t.count=e.usercount-e.disabled),t}}},ae=(n(590),Object(Q.a)(ne,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("Content",{attrs:{"app-name":"settings","navigation-class":{"icon-loading":e.loadingAddGroup}}},[s("AppNavigation",[s("AppNavigationNew",{attrs:{"button-id":"new-user-button",text:e.t("settings","New user"),"button-class":"icon-add"},on:{click:e.toggleNewUserMenu}}),e._v(" "),s("ul",{attrs:{id:"usergrouplist"}},[s("AppNavigationItem",{ref:"addGroup",attrs:{id:"addgroup","edit-placeholder":e.t("settings","Enter group name"),editable:!0,loading:e.loadingAddGroup,title:e.t("settings","Add group"),icon:"icon-add"},on:{click:function(t){return e.toggleAddGroupEntry(!0)},"update:title":e.createGroup}}),e._v(" "),s("AppNavigationItem",{attrs:{id:"everyone",exact:!0,title:e.t("settings","Everyone"),to:{name:"users"},icon:"icon-contacts-dark"}},[e.userCount>0?s("AppNavigationCounter",{attrs:{slot:"counter"},slot:"counter"},[e._v("\n\t\t\t\t\t"+e._s(e.userCount)+"\n\t\t\t\t")]):e._e()],1),e._v(" "),s("AppNavigationItem",{attrs:{id:"admin",exact:!0,title:e.t("settings","Admins"),to:{name:"users",params:{selectedGroup:"admin"}},icon:"icon-user-admin"}},[e.adminGroupMenu.count?s("AppNavigationCounter",{attrs:{slot:"counter"},slot:"counter"},[e._v("\n\t\t\t\t\t"+e._s(e.adminGroupMenu.count)+"\n\t\t\t\t")]):e._e()],1),e._v(" "),e.disabledGroupMenu.usercount>0||-1===e.disabledGroupMenu.usercount?s("AppNavigationItem",{attrs:{id:"disabled",exact:!0,title:e.t("settings","Disabled users"),to:{name:"users",params:{selectedGroup:"disabled"}},icon:"icon-disabled-users"}},[e.disabledGroupMenu.usercount>0?s("AppNavigationCounter",{attrs:{slot:"counter"},slot:"counter"},[e._v("\n\t\t\t\t\t"+e._s(e.disabledGroupMenu.usercount)+"\n\t\t\t\t")]):e._e()],1):e._e(),e._v(" "),e.groupList.length>0?s("AppNavigationCaption",{attrs:{title:e.t("settings","Groups")}}):e._e(),e._v(" "),e._l(e.groupList,(function(t){return s("AppNavigationItem",{key:t.id,attrs:{exact:!0,title:t.title,to:{name:"users",params:{selectedGroup:t.id}}}},[t.count?s("AppNavigationCounter",{attrs:{slot:"counter"},slot:"counter"},[e._v("\n\t\t\t\t\t"+e._s(t.count)+"\n\t\t\t\t")]):e._e(),e._v(" "),s("template",{slot:"actions"},["admin"!==t.id&&"disabled"!==t.id&&e.settings.isAdmin?s("ActionButton",{attrs:{icon:"icon-delete"},on:{click:function(s){return e.removeGroup(t.id)}}},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("settings","Remove group"))+"\n\t\t\t\t\t")]):e._e()],1)],2)}))],2),e._v(" "),s("AppNavigationSettings",[s("div",[s("p",[e._v(e._s(e.t("settings","Default quota:")))]),e._v(" "),s("Multiselect",{attrs:{value:e.defaultQuota,options:e.quotaOptions,"tag-placeholder":"create",placeholder:e.t("settings","Select default quota"),label:"label","track-by":"id","allow-empty":!1,taggable:!0},on:{tag:e.validateQuota,input:e.setDefaultQuota}})],1),e._v(" "),s("div",[s("input",{directives:[{name:"model",rawName:"v-model",value:e.showLanguages,expression:"showLanguages"}],staticClass:"checkbox",attrs:{id:"showLanguages",type:"checkbox"},domProps:{checked:Array.isArray(e.showLanguages)?e._i(e.showLanguages,null)>-1:e.showLanguages},on:{change:function(t){var s=e.showLanguages,n=t.target,a=!!n.checked;if(Array.isArray(s)){var i=e._i(s,null);n.checked?i<0&&(e.showLanguages=s.concat([null])):i>-1&&(e.showLanguages=s.slice(0,i).concat(s.slice(i+1)))}else e.showLanguages=a}}}),e._v(" "),s("label",{attrs:{for:"showLanguages"}},[e._v(e._s(e.t("settings","Show Languages")))])]),e._v(" "),s("div",[s("input",{directives:[{name:"model",rawName:"v-model",value:e.showLastLogin,expression:"showLastLogin"}],staticClass:"checkbox",attrs:{id:"showLastLogin",type:"checkbox"},domProps:{checked:Array.isArray(e.showLastLogin)?e._i(e.showLastLogin,null)>-1:e.showLastLogin},on:{change:function(t){var s=e.showLastLogin,n=t.target,a=!!n.checked;if(Array.isArray(s)){var i=e._i(s,null);n.checked?i<0&&(e.showLastLogin=s.concat([null])):i>-1&&(e.showLastLogin=s.slice(0,i).concat(s.slice(i+1)))}else e.showLastLogin=a}}}),e._v(" "),s("label",{attrs:{for:"showLastLogin"}},[e._v(e._s(e.t("settings","Show last login")))])]),e._v(" "),s("div",[s("input",{directives:[{name:"model",rawName:"v-model",value:e.showUserBackend,expression:"showUserBackend"}],staticClass:"checkbox",attrs:{id:"showUserBackend",type:"checkbox"},domProps:{checked:Array.isArray(e.showUserBackend)?e._i(e.showUserBackend,null)>-1:e.showUserBackend},on:{change:function(t){var s=e.showUserBackend,n=t.target,a=!!n.checked;if(Array.isArray(s)){var i=e._i(s,null);n.checked?i<0&&(e.showUserBackend=s.concat([null])):i>-1&&(e.showUserBackend=s.slice(0,i).concat(s.slice(i+1)))}else e.showUserBackend=a}}}),e._v(" "),s("label",{attrs:{for:"showUserBackend"}},[e._v(e._s(e.t("settings","Show user backend")))])]),e._v(" "),s("div",[s("input",{directives:[{name:"model",rawName:"v-model",value:e.showStoragePath,expression:"showStoragePath"}],staticClass:"checkbox",attrs:{id:"showStoragePath",type:"checkbox"},domProps:{checked:Array.isArray(e.showStoragePath)?e._i(e.showStoragePath,null)>-1:e.showStoragePath},on:{change:function(t){var s=e.showStoragePath,n=t.target,a=!!n.checked;if(Array.isArray(s)){var i=e._i(s,null);n.checked?i<0&&(e.showStoragePath=s.concat([null])):i>-1&&(e.showStoragePath=s.slice(0,i).concat(s.slice(i+1)))}else e.showStoragePath=a}}}),e._v(" "),s("label",{attrs:{for:"showStoragePath"}},[e._v(e._s(e.t("settings","Show storage path")))])]),e._v(" "),s("div",[s("input",{directives:[{name:"model",rawName:"v-model",value:e.sendWelcomeMail,expression:"sendWelcomeMail"}],staticClass:"checkbox",attrs:{id:"sendWelcomeMail",disabled:e.loadingSendMail,type:"checkbox"},domProps:{checked:Array.isArray(e.sendWelcomeMail)?e._i(e.sendWelcomeMail,null)>-1:e.sendWelcomeMail},on:{change:function(t){var s=e.sendWelcomeMail,n=t.target,a=!!n.checked;if(Array.isArray(s)){var i=e._i(s,null);n.checked?i<0&&(e.sendWelcomeMail=s.concat([null])):i>-1&&(e.sendWelcomeMail=s.slice(0,i).concat(s.slice(i+1)))}else e.sendWelcomeMail=a}}}),e._v(" "),s("label",{attrs:{for:"sendWelcomeMail"}},[e._v(e._s(e.t("settings","Send email to new user")))])])])],1),e._v(" "),s("AppContent",[s("UserList",{attrs:{users:e.users,"show-config":e.showConfig,"selected-group":e.selectedGroup,"external-actions":e.externalActions},scopedSlots:e._u([{key:"content",fn:function(){},proxy:!0}])})],1)],1)}),[],!1,null,"0183f287",null));s.default=ae.exports}}]);
//# sourceMappingURL=vue-5.js.map?v=c20ad55ed48ebf78b3ed