diff options
Diffstat (limited to 'dist/settings-users-8351.js')
-rw-r--r-- | dist/settings-users-8351.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dist/settings-users-8351.js b/dist/settings-users-8351.js index 4f6ea72bf41..4cb19c85b7f 100644 --- a/dist/settings-users-8351.js +++ b/dist/settings-users-8351.js @@ -1,3 +1,3 @@ /*! For license information please see settings-users-8351.js.LICENSE.txt */ -"use strict";(self.webpackChunknextcloud=self.webpackChunknextcloud||[]).push([[8351],{91491:(t,e,s)=>{s.d(e,{Z:()=>o});var n=s(87537),a=s.n(n),i=s(23645),r=s.n(i)()(a());r.push([t.id,".row--menu-opened[data-v-8360d33a]{z-index:1 !important}.row[data-v-8360d33a] .multiselect__single{z-index:auto !important}.displayName input[data-v-8360d33a],.password input[data-v-8360d33a],.mailAddress input[data-v-8360d33a]{width:100%;height:44px !important;border:2px solid var(--color-border-dark)}","",{version:3,sources:["webpack://./apps/settings/src/components/UserList/UserRow.vue"],names:[],mappings:"AAEA,mCACC,oBAAA,CAED,2CACC,uBAAA,CAED,yGAGE,UAAA,CACA,sBAAA,CACD,yCAAA",sourcesContent:["\n// Force menu to be above other rows\n.row--menu-opened {\n\tz-index: 1 !important;\n}\n.row::v-deep .multiselect__single {\n\tz-index: auto !important;\n}\n.displayName input,\n.password input,\n.mailAddress input {\n width: 100%;\n height: 44px!important;\n\tborder: 2px solid var(--color-border-dark);\n}\n"],sourceRoot:""}]);const o=r},79600:(t,e,s)=>{s.d(e,{Z:()=>o});var n=s(87537),a=s.n(n),i=s(23645),r=s.n(i)()(a());r.push([t.id,".cellText{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-more{background-color:var(--color-main-background);border:0}.row .name{padding-left:0px !important}","",{version:3,sources:["webpack://./apps/settings/src/components/UserList/UserRowSimple.vue"],names:[],mappings:"AACC,UACC,eAAA,CACA,sBAAA,CACA,kBAAA,CAED,WACC,6CAAA,CACA,QAAA,CAED,WACC,2BAAA",sourcesContent:["\n\t.cellText {\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n}\n\t.icon-more {\n\t\tbackground-color: var(--color-main-background);\n\t\tborder: 0;\n\t}\n\t.row .name {\n\t\tpadding-left: 0px!important;\n\t}\n"],sourceRoot:""}]);const o=r},40551:(t,e,s)=>{s.d(e,{Z:()=>o});var n=s(87537),a=s.n(n),i=s(23645),r=s.n(i)()(a());r.push([t.id,".app-navigation__list #addgroup[data-v-76897a76] .app-navigation-entry__utils{display:none}","",{version:3,sources:["webpack://./apps/settings/src/views/Users.vue"],names:[],mappings:"AAEA,8EACC,YAAA",sourcesContent:["\n// force hiding the editing action for the add group entry\n.app-navigation__list #addgroup::v-deep .app-navigation-entry__utils {\n\tdisplay: none;\n}\n"],sourceRoot:""}]);const o=r},26280:(t,e,s)=>{s.d(e,{Z:()=>o});var n=s(87537),a=s.n(n),i=s(23645),r=s.n(i)()(a());r.push([t.id,'\n.modal-wrapper[data-v-84f756a4] {\n\tmargin: 2vh 0;\n\talign-items: flex-start;\n}\n.modal__content[data-v-84f756a4] {\n\tdisplay: flex;\n\tpadding: 20px;\n\tflex-direction: column;\n\talign-items: center;\n\ttext-align: center;\n}\n.modal__item[data-v-84f756a4] {\n\tmargin-bottom: 16px;\n\twidth: 100%;\n}\n.modal__item[data-v-84f756a4]:not(:focus):not(:active) {\n\tborder-color: var(--color-border-dark);\n}\n.modal__item[data-v-84f756a4] .multiselect {\n\twidth: 100%;\n}\n.user-actions[data-v-84f756a4] {\n\tmargin-top: 20px;\n}\n.modal__content[data-v-84f756a4] .multiselect__single {\n\ttext-align: left;\n\tbox-sizing: border-box;\n}\n.modal__content[data-v-84f756a4] .multiselect__content-wrapper {\n\tbox-sizing: border-box;\n}\n.row[data-v-84f756a4] .multiselect__single {\n\tz-index: auto !important;\n}\n\n/* fake input for groups validation */\ninput#newgroups[data-v-84f756a4] {\n\tposition: absolute;\n\topacity: 0;\n\t/* The "hidden" input is behind the Multiselect, so in general it does\n\t * not receives clicks. However, with Firefox, after the validation\n\t * fails, it will receive the first click done on it, so its width needs\n\t * to be set to 0 to prevent that ("pointer-events: none" does not\n\t * prevent it). */\n\twidth: 0;\n}\n#app-content tbody tr[data-v-84f756a4] {\n&[data-v-84f756a4]:hover,\n\t&[data-v-84f756a4]:focus,\n\t&[data-v-84f756a4]:active {\n\t\tbackground-color: var(--color-main-background);\n}\n}\n',"",{version:3,sources:["webpack://./apps/settings/src/components/UserList.vue"],names:[],mappings:";AAyrBA;CACA,aAAA;CACA,uBAAA;AACA;AACA;CACA,aAAA;CACA,aAAA;CACA,sBAAA;CACA,mBAAA;CACA,kBAAA;AACA;AACA;CACA,mBAAA;CACA,WAAA;AACA;AACA;CACA,sCAAA;AACA;AACA;CACA,WAAA;AACA;AACA;CACA,gBAAA;AACA;AACA;CACA,gBAAA;CACA,sBAAA;AACA;AACA;CACA,sBAAA;AACA;AACA;CACA,wBAAA;AACA;;AAEA,qCAAA;AACA;CACA,kBAAA;CACA,UAAA;CACA;;;;kBAIA;CACA,QAAA;AACA;AAEA;AACA;;;EAGA,8CAAA;AACA;AACA",sourcesContent:['\x3c!--\n - @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n --\x3e\n\n<template>\n\t<table id="app-content"\n\t\trole="grid"\n\t\t:aria-label="t(\'settings\', \'User\\\'s table\')"\n\t\tclass="user-list-grid"\n\t\t@scroll.passive="onScroll">\n\t\t<NcModal v-if="showConfig.showNewUserForm" size="small" @close="closeModal">\n\t\t\t<form id="new-user"\n\t\t\t\t:disabled="loading.all"\n\t\t\t\tclass="modal__content"\n\t\t\t\t@submit.prevent="createUser">\n\t\t\t\t<h2>{{ t(\'settings\',\'New user\') }}</h2>\n\t\t\t\t<input id="newusername"\n\t\t\t\t\tref="newusername"\n\t\t\t\t\tv-model="newUser.id"\n\t\t\t\t\t:disabled="settings.newUserGenerateUserID"\n\t\t\t\t\t:placeholder="settings.newUserGenerateUserID\n\t\t\t\t\t\t? t(\'settings\', \'Will be autogenerated\')\n\t\t\t\t\t\t: t(\'settings\', \'Username\')"\n\t\t\t\t\tautocapitalize="none"\n\t\t\t\t\tautocomplete="off"\n\t\t\t\t\tautocorrect="off"\n\t\t\t\t\tclass="modal__item"\n\t\t\t\t\tname="username"\n\t\t\t\t\tpattern="[a-zA-Z0-9 _\\.@\\-\']+"\n\t\t\t\t\trequired\n\t\t\t\t\ttype="text">\n\t\t\t\t<input id="newdisplayname"\n\t\t\t\t\tv-model="newUser.displayName"\n\t\t\t\t\t:placeholder="t(\'settings\', \'Display name\')"\n\t\t\t\t\tautocapitalize="none"\n\t\t\t\t\tautocomplete="off"\n\t\t\t\t\tautocorrect="off"\n\t\t\t\t\tclass="modal__item"\n\t\t\t\t\tname="displayname"\n\t\t\t\t\ttype="text">\n\t\t\t\t<input id="newuserpassword"\n\t\t\t\t\tref="newuserpassword"\n\t\t\t\t\tv-model="newUser.password"\n\t\t\t\t\t:minlength="minPasswordLength"\n\t\t\t\t\t:maxlength="469"\n\t\t\t\t\t:placeholder="t(\'settings\', \'Password\')"\n\t\t\t\t\t:required="newUser.mailAddress===\'\'"\n\t\t\t\t\tautocapitalize="none"\n\t\t\t\t\tautocomplete="new-password"\n\t\t\t\t\tautocorrect="off"\n\t\t\t\t\tclass="modal__item"\n\t\t\t\t\tname="password"\n\t\t\t\t\ttype="password">\n\t\t\t\t<input id="newemail"\n\t\t\t\t\tv-model="newUser.mailAddress"\n\t\t\t\t\t:placeholder="t(\'settings\', \'Email\')"\n\t\t\t\t\t:required="newUser.password===\'\' || settings.newUserRequireEmail"\n\t\t\t\t\tautocapitalize="none"\n\t\t\t\t\tautocomplete="off"\n\t\t\t\t\tautocorrect="off"\n\t\t\t\t\tclass="modal__item"\n\t\t\t\t\tname="email"\n\t\t\t\t\ttype="email">\n\t\t\t\t<div class="groups modal__item">\n\t\t\t\t\t\x3c!-- hidden input trick for vanilla html5 form validation --\x3e\n\t\t\t\t\t<input v-if="!settings.isAdmin"\n\t\t\t\t\t\tid="newgroups"\n\t\t\t\t\t\t:class="{\'icon-loading-small\': loading.groups}"\n\t\t\t\t\t\t:required="!settings.isAdmin"\n\t\t\t\t\t\t:value="newUser.groups"\n\t\t\t\t\t\ttabindex="-1"\n\t\t\t\t\t\ttype="text">\n\t\t\t\t\t<NcMultiselect v-model="newUser.groups"\n\t\t\t\t\t\t:close-on-select="false"\n\t\t\t\t\t\t:disabled="loading.groups||loading.all"\n\t\t\t\t\t\t:multiple="true"\n\t\t\t\t\t\t:options="canAddGroups"\n\t\t\t\t\t\t:placeholder="t(\'settings\', \'Add user to group\')"\n\t\t\t\t\t\t:tag-width="60"\n\t\t\t\t\t\t:taggable="true"\n\t\t\t\t\t\tclass="multiselect-vue"\n\t\t\t\t\t\tlabel="name"\n\t\t\t\t\t\ttag-placeholder="create"\n\t\t\t\t\t\ttrack-by="id"\n\t\t\t\t\t\t@tag="createGroup">\n\t\t\t\t\t\t\x3c!-- If user is not admin, he is a subadmin.\n\t\t\t\t\t\t\tSubadmins can\'t create users outside their groups\n\t\t\t\t\t\t\tTherefore, empty select is forbidden --\x3e\n\t\t\t\t\t\t<span slot="noResult">{{ t(\'settings\', \'No results\') }}</span>\n\t\t\t\t\t</NcMultiselect>\n\t\t\t\t</div>\n\t\t\t\t<div v-if="subAdminsGroups.length>0 && settings.isAdmin"\n\t\t\t\t\tclass="subadmins modal__item">\n\t\t\t\t\t<NcMultiselect v-model="newUser.subAdminsGroups"\n\t\t\t\t\t\t:close-on-select="false"\n\t\t\t\t\t\t:multiple="true"\n\t\t\t\t\t\t:options="subAdminsGroups"\n\t\t\t\t\t\t:placeholder="t(\'settings\', \'Set user as admin for\')"\n\t\t\t\t\t\t:tag-width="60"\n\t\t\t\t\t\tclass="multiselect-vue"\n\t\t\t\t\t\tlabel="name"\n\t\t\t\t\t\ttrack-by="id">\n\t\t\t\t\t\t<span slot="noResult">{{ t(\'settings\', \'No results\') }}</span>\n\t\t\t\t\t</NcMultiselect>\n\t\t\t\t</div>\n\t\t\t\t<div class="quota modal__item">\n\t\t\t\t\t<NcMultiselect v-model="newUser.quota"\n\t\t\t\t\t\t:allow-empty="false"\n\t\t\t\t\t\t:options="quotaOptions"\n\t\t\t\t\t\t:placeholder="t(\'settings\', \'Select user quota\')"\n\t\t\t\t\t\t:taggable="true"\n\t\t\t\t\t\tclass="multiselect-vue"\n\t\t\t\t\t\tlabel="label"\n\t\t\t\t\t\ttrack-by="id"\n\t\t\t\t\t\t@tag="validateQuota" />\n\t\t\t\t</div>\n\t\t\t\t<div v-if="showConfig.showLanguages" class="languages modal__item">\n\t\t\t\t\t<NcMultiselect v-model="newUser.language"\n\t\t\t\t\t\t:allow-empty="false"\n\t\t\t\t\t\t:options="languages"\n\t\t\t\t\t\t:placeholder="t(\'settings\', \'Default language\')"\n\t\t\t\t\t\tclass="multiselect-vue"\n\t\t\t\t\t\tgroup-label="label"\n\t\t\t\t\t\tgroup-values="languages"\n\t\t\t\t\t\tlabel="name"\n\t\t\t\t\t\ttrack-by="code" />\n\t\t\t\t</div>\n\t\t\t\t<div v-if="showConfig.showStoragePath" class="storageLocation" />\n\t\t\t\t<div v-if="showConfig.showUserBackend" class="userBackend" />\n\t\t\t\t<div v-if="showConfig.showLastLogin" class="lastLogin" />\n\t\t\t\t<div :class="{\'icon-loading-small\': loading.manager}" class="modal__item managers">\n\t\t\t\t\t<NcMultiselect ref="manager"\n\t\t\t\t\t\tv-model="newUser.manager"\n\t\t\t\t\t\t:close-on-select="true"\n\t\t\t\t\t\t:user-select="true"\n\t\t\t\t\t\t:options="possibleManagers"\n\t\t\t\t\t\t:placeholder="t(\'settings\', \'Select user manager\')"\n\t\t\t\t\t\tclass="multiselect-vue"\n\t\t\t\t\t\t@search-change="searchUserManager"\n\t\t\t\t\t\tlabel="displayname"\n\t\t\t\t\t\ttrack-by="id">\n\t\t\t\t\t\t<span slot="noResult">{{ t(\'settings\', \'No results\') }}</span>\n\t\t\t\t\t</NcMultiselect>\n\t\t\t\t</div>\n\t\t\t\t<div class="user-actions">\n\t\t\t\t\t<NcButton id="newsubmit"\n\t\t\t\t\t\ttype="primary"\n\t\t\t\t\t\tnative-type="submit"\n\t\t\t\t\t\tvalue="">\n\t\t\t\t\t\t{{ t(\'settings\', \'Add a new user\') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t</NcModal>\n\t\t<tbody>\n\t\t\t<tr id="grid-header"\n\t\t\t\t:class="{\'sticky\': scrolled && !showConfig.showNewUserForm}"\n\t\t\t\tclass="row">\n\t\t\t\t<th id="headerAvatar" class="avatar">\n\t\t\t\t\t<span class="hidden-visually"> {{ t(\'settings\', \'Avatar\') }} </span>\n\t\t\t\t</th>\n\t\t\t\t<th id="headerName" class="name">\n\t\t\t\t\t<div class="subtitle">\n\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t{{ t(\'settings\', \'Display name\') }}\n\t\t\t\t\t\t</strong>\n\t\t\t\t\t</div>\n\t\t\t\t\t{{ t(\'settings\', \'Username\') }}\n\t\t\t\t</th>\n\t\t\t\t<th id="headerPassword" class="password">\n\t\t\t\t\t{{ t(\'settings\', \'Password\') }}\n\t\t\t\t</th>\n\t\t\t\t<th id="headerAddress" class="mailAddress">\n\t\t\t\t\t{{ t(\'settings\', \'Email\') }}\n\t\t\t\t</th>\n\t\t\t\t<th id="headerGroups" class="groups">\n\t\t\t\t\t{{ t(\'settings\', \'Groups\') }}\n\t\t\t\t</th>\n\t\t\t\t<th v-if="subAdminsGroups.length>0 && settings.isAdmin"\n\t\t\t\t\tid="headerSubAdmins"\n\t\t\t\t\tclass="subadmins">\n\t\t\t\t\t{{ t(\'settings\', \'Group admin for\') }}\n\t\t\t\t</th>\n\t\t\t\t<th id="headerQuota" class="quota">\n\t\t\t\t\t{{ t(\'settings\', \'Quota\') }}\n\t\t\t\t</th>\n\t\t\t\t<th v-if="showConfig.showLanguages"\n\t\t\t\t\tid="headerLanguages"\n\t\t\t\t\tclass="languages">\n\t\t\t\t\t{{ t(\'settings\', \'Language\') }}\n\t\t\t\t</th>\n\n\t\t\t\t<th v-if="showConfig.showUserBackend || showConfig.showStoragePath"\n\t\t\t\t\tclass="headerUserBackend userBackend">\n\t\t\t\t\t<div v-if="showConfig.showUserBackend" class="userBackend">\n\t\t\t\t\t\t{{ t(\'settings\', \'User backend\') }}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div v-if="showConfig.showStoragePath"\n\t\t\t\t\t\tclass="subtitle storageLocation">\n\t\t\t\t\t\t{{ t(\'settings\', \'Storage location\') }}\n\t\t\t\t\t</div>\n\t\t\t\t</th>\n\t\t\t\t<th v-if="showConfig.showLastLogin"\n\t\t\t\t\tclass="headerLastLogin lastLogin">\n\t\t\t\t\t{{ t(\'settings\', \'Last login\') }}\n\t\t\t\t</th>\n\t\t\t\t<th id="headerManager" class="manager">\n\t\t\t\t\t{{ t(\'settings\', \'Manager\') }}\n\t\t\t\t</th>\n\t\t\t\t<th class="userActions hidden-visually">\n\t\t\t\t\t{{ t(\'settings\', \'User actions\') }}\n\t\t\t\t</th>\n\t\t\t</tr>\n\n\t\t\t<user-row v-for="user in filteredUsers"\n\t\t\t\t:key="user.id"\n\t\t\t\t:external-actions="externalActions"\n\t\t\t\t:groups="groups"\n\t\t\t\t:languages="languages"\n\t\t\t\t:quota-options="quotaOptions"\n\t\t\t\t:settings="settings"\n\t\t\t\t:show-config="showConfig"\n\t\t\t\t:sub-admins-groups="subAdminsGroups"\n\t\t\t\t:user="user"\n\t\t\t\t:users="users"\n\t\t\t\t:is-dark-theme="isDarkTheme" />\n\n\t\t\t<InfiniteLoading ref="infiniteLoading" @infinite="infiniteHandler">\n\t\t\t\t<div slot="spinner">\n\t\t\t\t\t<div class="users-icon-loading icon-loading" />\n\t\t\t\t</div>\n\t\t\t\t<div slot="no-more">\n\t\t\t\t\t<div class="users-list-end" />\n\t\t\t\t</div>\n\t\t\t\t<div slot="no-results">\n\t\t\t\t\t<div id="emptycontent">\n\t\t\t\t\t\t<div class="icon-contacts-dark" />\n\t\t\t\t\t\t<h2>{{ t(\'settings\', \'No users in here\') }}</h2>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</InfiniteLoading>\n\t\t</tbody>\n\t</table>\n</template>\n\n<script>\nimport { subscribe, unsubscribe } from \'@nextcloud/event-bus\'\nimport InfiniteLoading from \'vue-infinite-loading\'\nimport Vue from \'vue\'\nimport NcModal from \'@nextcloud/vue/dist/Components/NcModal.js\'\nimport NcButton from \'@nextcloud/vue/dist/Components/NcButton.js\'\nimport NcMultiselect from \'@nextcloud/vue/dist/Components/NcMultiselect.js\'\n\nimport userRow from \'./UserList/UserRow.vue\'\n\nconst unlimitedQuota = {\n\tid: \'none\',\n\tlabel: t(\'settings\', \'Unlimited\'),\n}\nconst defaultQuota = {\n\tid: \'default\',\n\tlabel: t(\'settings\', \'Default quota\'),\n}\nconst newUser = {\n\tid: \'\',\n\tdisplayName: \'\',\n\tpassword: \'\',\n\tmailAddress: \'\',\n\tgroups: [],\n\tmanager: \'\',\n\tsubAdminsGroups: [],\n\tquota: defaultQuota,\n\tlanguage: {\n\t\tcode: \'en\',\n\t\tname: t(\'settings\', \'Default language\'),\n\t},\n}\n\nexport default {\n\tname: \'UserList\',\n\tcomponents: {\n\t\tNcModal,\n\t\tuserRow,\n\t\tNcMultiselect,\n\t\tInfiniteLoading,\n\t\tNcButton,\n\t},\n\tprops: {\n\t\tusers: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\tshowConfig: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t\tselectedGroup: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\t\texternalActions: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tunlimitedQuota,\n\t\t\tdefaultQuota,\n\t\t\tloading: {\n\t\t\t\tall: false,\n\t\t\t\tgroups: false,\n\t\t\t},\n\t\t\tscrolled: false,\n\t\t\tpossibleManagers: [],\n\t\t\tsearchQuery: \'\',\n\t\t\tnewUser: Object.assign({}, newUser),\n\t\t}\n\t},\n\tcomputed: {\n\t\tsettings() {\n\t\t\treturn this.$store.getters.getServerData\n\t\t},\n\t\tselectedGroupDecoded() {\n\t\t\treturn decodeURIComponent(this.selectedGroup)\n\t\t},\n\t\tfilteredUsers() {\n\t\t\tif (this.selectedGroup === \'disabled\') {\n\t\t\t\treturn this.users.filter(user => user.enabled === false)\n\t\t\t}\n\t\t\tif (!this.settings.isAdmin) {\n\t\t\t\t// we don\'t want subadmins to edit themselves\n\t\t\t\treturn this.users.filter(user => user.enabled !== false)\n\t\t\t}\n\t\t\treturn this.users.filter(user => user.enabled !== false)\n\t\t},\n\t\tgroups() {\n\t\t\t// data provided php side + remove the disabled group\n\t\t\treturn this.$store.getters.getGroups\n\t\t\t\t.filter(group => group.id !== \'disabled\')\n\t\t\t\t.sort((a, b) => a.name.localeCompare(b.name))\n\t\t},\n\t\tcanAddGroups() {\n\t\t\t// disabled if no permission to add new users to group\n\t\t\treturn this.groups.map(group => {\n\t\t\t\t// clone object because we don\'t want\n\t\t\t\t// to edit the original groups\n\t\t\t\tgroup = Object.assign({}, group)\n\t\t\t\tgroup.$isDisabled = group.canAdd === false\n\t\t\t\treturn group\n\t\t\t})\n\t\t},\n\t\tsubAdminsGroups() {\n\t\t\t// data provided php side\n\t\t\treturn this.$store.getters.getSubadminGroups\n\t\t},\n\t\tquotaOptions() {\n\t\t\t// convert the preset array into objects\n\t\t\tconst quotaPreset = this.settings.quotaPreset.reduce((acc, cur) => acc.concat({\n\t\t\t\tid: cur,\n\t\t\t\tlabel: cur,\n\t\t\t}), [])\n\t\t\t// add default presets\n\t\t\tif (this.settings.allowUnlimitedQuota) {\n\t\t\t\tquotaPreset.unshift(this.unlimitedQuota)\n\t\t\t}\n\t\t\tquotaPreset.unshift(this.defaultQuota)\n\t\t\treturn quotaPreset\n\t\t},\n\t\tminPasswordLength() {\n\t\t\treturn this.$store.getters.getPasswordPolicyMinLength\n\t\t},\n\t\tusersOffset() {\n\t\t\treturn this.$store.getters.getUsersOffset\n\t\t},\n\t\tusersLimit() {\n\t\t\treturn this.$store.getters.getUsersLimit\n\t\t},\n\t\tusersCount() {\n\t\t\treturn this.users.length\n\t\t},\n\n\t\t/* LANGUAGES */\n\t\tlanguages() {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tlabel: t(\'settings\', \'Common languages\'),\n\t\t\t\t\tlanguages: this.settings.languages.commonLanguages,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: t(\'settings\', \'Other languages\'),\n\t\t\t\t\tlanguages: this.settings.languages.otherLanguages,\n\t\t\t\t},\n\t\t\t]\n\t\t},\n\t\tisDarkTheme() {\n\t\t\treturn window.getComputedStyle(this.$el)\n\t\t\t\t.getPropertyValue(\'--background-invert-if-dark\') === \'invert(100%)\'\n\t\t},\n\t},\n\twatch: {\n\t\t// watch url change and group select\n\t\tselectedGroup(val, old) {\n\t\t\t// if selected is the disabled group but it\'s empty\n\t\t\tthis.redirectIfDisabled()\n\t\t\tthis.$store.commit(\'resetUsers\')\n\t\t\tthis.$refs.infiniteLoading.stateChanger.reset()\n\t\t\tthis.setNewUserDefaultGroup(val)\n\t\t},\n\n\t\t// make sure the infiniteLoading state is changed if we manually\n\t\t// add/remove data from the store\n\t\tusersCount(val, old) {\n\t\t\t// deleting the last user, reset the list\n\t\t\tif (val === 0 && old === 1) {\n\t\t\t\tthis.$refs.infiniteLoading.stateChanger.reset()\n\t\t\t\t// adding the first user, warn the infiniteLoader that\n\t\t\t\t// the list is not empty anymore (we don\'t fetch the newly\n\t\t\t\t// added user as we already have all the info we need)\n\t\t\t} else if (val === 1 && old === 0) {\n\t\t\t\tthis.$refs.infiniteLoading.stateChanger.loaded()\n\t\t\t}\n\t\t},\n\t},\n\n\tasync beforeMount() {\n\t\tawait this.searchUserManager()\n\t},\n\n\tmounted() {\n\t\tif (!this.settings.canChangePassword) {\n\t\t\tOC.Notification.showTemporary(t(\'settings\', \'Password change is disabled because the master key is disabled\'))\n\t\t}\n\n\t\t/**\n\t\t * Reset and init new user form\n\t\t */\n\t\tthis.resetForm()\n\n\t\t/**\n\t\t * Register search\n\t\t */\n\t\tsubscribe(\'nextcloud:unified-search.search\', this.search)\n\t\tsubscribe(\'nextcloud:unified-search.reset\', this.resetSearch)\n\n\t\t/**\n\t\t * If disabled group but empty, redirect\n\t\t */\n\t\tthis.redirectIfDisabled()\n\t},\n\tbeforeDestroy() {\n\t\tunsubscribe(\'nextcloud:unified-search.search\', this.search)\n\t\tunsubscribe(\'nextcloud:unified-search.reset\', this.resetSearch)\n\t},\n\n\tmethods: {\n\t\tasync searchUserManager(query) {\n\t\t\tawait this.$store.dispatch(\'searchUsers\', { offset: 0, limit: 10, search: query }).then(response => {\n\t\t\t\tconst users = response?.data ? Object.values(response?.data.ocs.data.users) : []\n\t\t\t\tif (users.length > 0) {\n\t\t\t\t\tthis.possibleManagers = users\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tonScroll(event) {\n\t\t\tthis.scrolled = event.target.scrollTo > 0\n\t\t},\n\n\t\t/**\n\t\t * Validate quota string to make sure it\'s a valid human file size\n\t\t *\n\t\t * @param {string} quota Quota in readable format \'5 GB\'\n\t\t * @return {object}\n\t\t */\n\t\tvalidateQuota(quota) {\n\t\t\t// only used for new presets sent through @Tag\n\t\t\tconst validQuota = OC.Util.computerFileSize(quota)\n\t\t\tif (validQuota !== null && validQuota >= 0) {\n\t\t\t\t// unify format output\n\t\t\t\tquota = OC.Util.humanFileSize(OC.Util.computerFileSize(quota))\n\t\t\t\tthis.newUser.quota = { id: quota, label: quota }\n\t\t\t\treturn this.newUser.quota\n\t\t\t}\n\t\t\t// Default is unlimited\n\t\t\tthis.newUser.quota = this.quotaOptions[0]\n\t\t\treturn this.quotaOptions[0]\n\t\t},\n\n\t\tinfiniteHandler($state) {\n\t\t\tthis.$store.dispatch(\'getUsers\', {\n\t\t\t\toffset: this.usersOffset,\n\t\t\t\tlimit: this.usersLimit,\n\t\t\t\tgroup: this.selectedGroup !== \'disabled\' ? this.selectedGroup : \'\',\n\t\t\t\tsearch: this.searchQuery,\n\t\t\t})\n\t\t\t\t.then((usersCount) => {\n\t\t\t\t\tif (usersCount > 0) {\n\t\t\t\t\t\t$state.loaded()\n\t\t\t\t\t}\n\t\t\t\t\tif (usersCount < this.usersLimit) {\n\t\t\t\t\t\t$state.complete()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t},\n\n\t\t/* SEARCH */\n\t\tsearch({ query }) {\n\t\t\tthis.searchQuery = query\n\t\t\tthis.$store.commit(\'resetUsers\')\n\t\t\tthis.$refs.infiniteLoading.stateChanger.reset()\n\t\t},\n\t\tresetSearch() {\n\t\t\tthis.search({ query: \'\' })\n\t\t},\n\n\t\tresetForm() {\n\t\t\t// revert form to original state\n\t\t\tthis.newUser = Object.assign({}, newUser)\n\n\t\t\t/**\n\t\t\t * Init default language from server data. The use of this.settings\n\t\t\t * requires a computed variable, which break the v-model binding of the form,\n\t\t\t * this is a much easier solution than getter and setter on a computed var\n\t\t\t */\n\t\t\tif (this.settings.defaultLanguage) {\n\t\t\t\tVue.set(this.newUser.language, \'code\', this.settings.defaultLanguage)\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * In case the user directly loaded the user list within a group\n\t\t\t * the watch won\'t be triggered. We need to initialize it.\n\t\t\t */\n\t\t\tthis.setNewUserDefaultGroup(this.selectedGroup)\n\n\t\t\tthis.loading.all = false\n\t\t},\n\t\tcreateUser() {\n\t\t\tthis.loading.all = true\n\t\t\tthis.$store.dispatch(\'addUser\', {\n\t\t\t\tuserid: this.newUser.id,\n\t\t\t\tpassword: this.newUser.password,\n\t\t\t\tdisplayName: this.newUser.displayName,\n\t\t\t\temail: this.newUser.mailAddress,\n\t\t\t\tgroups: this.newUser.groups.map(group => group.id),\n\t\t\t\tsubadmin: this.newUser.subAdminsGroups.map(group => group.id),\n\t\t\t\tquota: this.newUser.quota.id,\n\t\t\t\tlanguage: this.newUser.language.code,\n\t\t\t\tmanager: this.newUser.manager.id,\n\t\t\t})\n\t\t\t\t.then(() => {\n\t\t\t\t\tthis.resetForm()\n\t\t\t\t\tthis.$refs.newusername.focus()\n\t\t\t\t\tthis.closeModal()\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tthis.loading.all = false\n\t\t\t\t\tif (error.response && error.response.data && error.response.data.ocs && error.response.data.ocs.meta) {\n\t\t\t\t\t\tconst statuscode = error.response.data.ocs.meta.statuscode\n\t\t\t\t\t\tif (statuscode === 102) {\n\t\t\t\t\t\t\t// wrong username\n\t\t\t\t\t\t\tthis.$refs.newusername.focus()\n\t\t\t\t\t\t} else if (statuscode === 107) {\n\t\t\t\t\t\t\t// wrong password\n\t\t\t\t\t\t\tthis.$refs.newuserpassword.focus()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t},\n\t\tsetNewUserDefaultGroup(value) {\n\t\t\tif (value && value.length > 0) {\n\t\t\t\t// setting new user default group to the current selected one\n\t\t\t\tconst currentGroup = this.groups.find(group => group.id === value)\n\t\t\t\tif (currentGroup) {\n\t\t\t\t\tthis.newUser.groups = [currentGroup]\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\t// fallback, empty selected group\n\t\t\tthis.newUser.groups = []\n\t\t},\n\n\t\t/**\n\t\t * Create a new group\n\t\t *\n\t\t * @param {string} gid Group id\n\t\t * @return {Promise}\n\t\t */\n\t\tcreateGroup(gid) {\n\t\t\tthis.loading.groups = true\n\t\t\tthis.$store.dispatch(\'addGroup\', gid)\n\t\t\t\t.then((group) => {\n\t\t\t\t\tthis.newUser.groups.push(this.groups.find(group => group.id === gid))\n\t\t\t\t\tthis.loading.groups = false\n\t\t\t\t})\n\t\t\t\t.catch(() => {\n\t\t\t\t\tthis.loading.groups = false\n\t\t\t\t})\n\t\t\treturn this.$store.getters.getGroups[this.groups.length]\n\t\t},\n\n\t\t/**\n\t\t * If the selected group is the disabled group but the count is 0\n\t\t * redirect to the all users page.\n\t\t * we only check for 0 because we don\'t have the count on ldap\n\t\t * and we therefore set the usercount to -1 in this specific case\n\t\t */\n\t\tredirectIfDisabled() {\n\t\t\tconst allGroups = this.$store.getters.getGroups\n\t\t\tif (this.selectedGroup === \'disabled\'\n\t\t\t\t\t\t&& allGroups.findIndex(group => group.id === \'disabled\' && group.usercount === 0) > -1) {\n\t\t\t\t// disabled group is empty, redirection to all users\n\t\t\t\tthis.$router.push({ name: \'users\' })\n\t\t\t\tthis.$refs.infiniteLoading.stateChanger.reset()\n\t\t\t}\n\t\t},\n\t\tcloseModal() {\n\t\t\t// eslint-disable-next-line vue/no-mutating-props\n\t\t\tthis.showConfig.showNewUserForm = false\n\t\t},\n\t},\n}\n<\/script>\n<style scoped>\n\t.modal-wrapper {\n\t\tmargin: 2vh 0;\n\t\talign-items: flex-start;\n\t}\n\t.modal__content {\n\t\tdisplay: flex;\n\t\tpadding: 20px;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\ttext-align: center;\n\t}\n\t.modal__item {\n\t\tmargin-bottom: 16px;\n\t\twidth: 100%;\n\t}\n\t.modal__item:not(:focus):not(:active) {\n\t\tborder-color: var(--color-border-dark);\n\t}\n\t.modal__item::v-deep .multiselect {\n\t\twidth: 100%;\n\t}\n\t.user-actions {\n\t\tmargin-top: 20px;\n\t}\n\t.modal__content::v-deep .multiselect__single {\n\t\ttext-align: left;\n\t\tbox-sizing: border-box;\n\t}\n\t.modal__content::v-deep .multiselect__content-wrapper {\n\t\tbox-sizing: border-box;\n\t}\n\t.row::v-deep .multiselect__single {\n\t\tz-index: auto !important;\n\t}\n\n\t/* fake input for groups validation */\n\tinput#newgroups {\n\t\tposition: absolute;\n\t\topacity: 0;\n\t\t/* The "hidden" input is behind the Multiselect, so in general it does\n\t\t * not receives clicks. However, with Firefox, after the validation\n\t\t * fails, it will receive the first click done on it, so its width needs\n\t\t * to be set to 0 to prevent that ("pointer-events: none" does not\n\t\t * prevent it). */\n\t\twidth: 0;\n\t}\n\n\t#app-content tbody tr {\n\t\t&:hover,\n\t\t&:focus,\n\t\t&:active {\n\t\t\tbackground-color: var(--color-main-background);\n\t\t}\n\t}\n</style>\n'],sourceRoot:""}]);const o=r},26390:(e,s,n)=>{n.r(s),n.d(s,{default:()=>xt});var a=n(69680),i=n.n(a),r=n(55209),o=n.n(r),l=n(88696),d=n.n(l),u=n(53110),c=n.n(u),g=n(14032),p=n.n(g),h=n(73190),m=n.n(h),v=n(93041),f=n.n(v),w=n(4820),A=n(27472),b=n.n(A),_=n(79753),C=n(98266),y=n.n(C),U=n(20144),k=n(87369),N=n.n(k),L=n(79570),G=n.n(L),M=n(45400),x=n.n(M),S=n(97039),q=n.n(S);const $={name:"GroupListItem",components:{NcActionInput:G(),NcActionButton:x(),NcCounterBubble:q(),NcAppNavigationItem:p()},props:{id:{type:String,required:!0},title:{type:String,required:!0},count:{type:Number,required:!1}},data:()=>({loadingRenameGroup:!1,openGroupMenu:!1}),computed:{settings(){return this.$store.getters.getServerData}},methods:{handleGroupMenuOpen(){this.openGroupMenu=!0},async renameGroup(t){if(""===t.trim())return;const e=this.$refs.displayNameInput.$el.querySelector('input[type="text"]').value;if(""!==e.trim())try{this.openGroupMenu=!1,this.loadingRenameGroup=!0,await this.$store.dispatch("renameGroup",{groupid:t.trim(),displayName:e.trim()}),this.loadingRenameGroup=!1}catch{this.openGroupMenu=!0,this.loadingRenameGroup=!1}},removeGroup(e){const 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)}))}}};var O=n(51900);const D=(0,O.Z)($,(function(){var t=this,e=t._self._c;return e("NcAppNavigationItem",{key:t.id,attrs:{exact:!0,title:t.title,to:{name:"group",params:{selectedGroup:encodeURIComponent(t.id)}},icon:"icon-group",loading:t.loadingRenameGroup,"menu-open":t.openGroupMenu},on:{"update:menuOpen":t.handleGroupMenuOpen},scopedSlots:t._u([{key:"counter",fn:function(){return[t.count?e("NcCounterBubble",[t._v("\n\t\t\t"+t._s(t.count)+"\n\t\t")]):t._e()]},proxy:!0},{key:"actions",fn:function(){return["admin"!==t.id&&"disabled"!==t.id&&t.settings.isAdmin?e("NcActionInput",{ref:"displayNameInput",attrs:{icon:"icon-edit",type:"text",value:t.title},on:{submit:function(e){return t.renameGroup(t.id)}}},[t._v("\n\t\t\t"+t._s(t.t("settings","Rename group"))+"\n\t\t")]):t._e(),t._v(" "),"admin"!==t.id&&"disabled"!==t.id&&t.settings.isAdmin?e("NcActionButton",{attrs:{icon:"icon-delete"},on:{click:function(e){return t.removeGroup(t.id)}}},[t._v("\n\t\t\t"+t._s(t.t("settings","Remove group"))+"\n\t\t")]):t._e()]},proxy:!0}])})}),[],!1,null,null,null).exports;var P=n(78595),B=n(30306),Q=n.n(B),R=n(70110),z=n.n(R),I=n(10861),T=n.n(I),F=n(2649),E=n.n(F),j=n(15961),W=n(32996),Z=n.n(W),H=n(12945),Y=n.n(H),V=n(45994);const J={props:{user:{type:Object,required:!0},settings:{type:Object,default:()=>({})},groups:{type:Array,default:()=>[]},subAdminsGroups:{type:Array,default:()=>[]},quotaOptions:{type:Array,default:()=>[]},showConfig:{type:Object,default:()=>({})},languages:{type:Array,required:!0},externalActions:{type:Array,default:()=>[]}},computed:{userGroups(){return this.groups.filter((t=>this.user.groups.includes(t.id)))},userSubAdminsGroups(){return this.subAdminsGroups.filter((t=>this.user.subadmin.includes(t.id)))},availableGroups(){return this.groups.map((t=>{const e=Object.assign({},t);return e.$isDisabled=!1===t.canAdd&&!this.user.groups.includes(t.id)||!1===t.canRemove&&this.user.groups.includes(t.id),e}))},usedSpace(){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(){let t=this.user.quota.quota;return t=t>0?Math.min(100,Math.round(this.user.quota.used/t*100)):95*(1-1/(this.user.quota.used/(10*Math.pow(2,30))+1)),isNaN(t)?0:t},userQuota(){if(this.user.quota.quota>=0){const t=OC.Util.humanFileSize(this.user.quota.quota);return this.quotaOptions.find((e=>e.id===t))||{id:t,label:t}}return"default"===this.user.quota.quota?this.quotaOptions[0]:this.quotaOptions[1]},minPasswordLength(){return this.$store.getters.getPasswordPolicyMinLength},userLanguage(){const t=this.languages[0].languages.concat(this.languages[1].languages).find((t=>t.code===this.user.language));return"object"!=typeof t&&""!==this.user.language?{code:this.user.language,name:this.user.language}:""!==this.user.language&&t},userLastLoginTooltip(){return this.user.lastLogin>0?OC.Util.formatDate(this.user.lastLogin):""},userLastLogin(){return this.user.lastLogin>0?OC.Util.relativeModifiedDate(this.user.lastLogin):t("settings","Never")}},methods:{generateAvatar:(t,e)=>e?(0,_.generateUrl)("/avatar/{user}/64/dark?v={version}",{user:t,version:oc_userconfig.avatar.version}):(0,_.generateUrl)("/avatar/{user}/64?v={version}",{user:t,version:oc_userconfig.avatar.version})}},K={name:"UserRowSimple",components:{NcPopoverMenu:Z(),NcActionButton:x(),NcActions:Y()},directives:{ClickOutside:E()},mixins:[J],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},isDarkTheme:{type:Boolean,required:!0}},computed:{userGroupsLabels(){return this.userGroups.map((t=>t.name)).join(", ")},userSubAdminsGroupsLabels(){return this.userSubAdminsGroups.map((t=>t.name)).join(", ")},usedSpace(){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(){return(0,V.ts)().uid!==this.user.id||this.settings.isAdmin},userQuota(){let e=this.user.quota.quota;return"default"===e&&(e=this.settings.defaultQuota,"none"!==e&&(e=OC.Util.computerFileSize(e))),"none"===e||-3===e?t("settings","Unlimited"):e>=0?OC.Util.humanFileSize(e):OC.Util.humanFileSize(0)}},methods:{toggleMenu(){this.$emit("update:openedMenu",!this.openedMenu)},hideMenu(){this.$emit("update:openedMenu",!1)},toggleEdit(){this.$emit("update:editing",!0)}}};var X=n(93379),tt=n.n(X),et=n(7795),st=n.n(et),nt=n(90569),at=n.n(nt),it=n(3565),rt=n.n(it),ot=n(19216),lt=n.n(ot),dt=n(44589),ut=n.n(dt),ct=n(79600),gt={};gt.styleTagTransform=ut(),gt.setAttributes=rt(),gt.insert=at().bind(null,"head"),gt.domAPI=st(),gt.insertStyleElement=lt(),tt()(ct.Z,gt),ct.Z&&ct.Z.locals&&ct.Z.locals;const pt=(0,O.Z)(K,(function(){var t=this,e=t._self._c;return e("tr",{staticClass:"row",class:{disabled:t.loading.delete||t.loading.disable},attrs:{"data-id":t.user.id}},[e("td",{staticClass:"avatar",class:{"icon-loading-small":t.loading.delete||t.loading.disable||t.loading.wipe}},[t.loading.delete||t.loading.disable||t.loading.wipe?t._e():e("img",{attrs:{alt:"",width:"32",height:"32",src:t.generateAvatar(t.user.id,t.isDarkTheme)}})]),t._v(" "),e("td",{staticClass:"name"},[e("div",{staticClass:"displayName subtitle"},[e("div",{staticClass:"cellText",attrs:{title:t.user.displayname.length>20?t.user.displayname:""}},[e("strong",[t._v("\n\t\t\t\t\t"+t._s(t.user.displayname)+"\n\t\t\t\t")])])]),t._v("\n\t\t"+t._s(t.user.id)+"\n\t")]),t._v(" "),e("td"),t._v(" "),e("td",{staticClass:"mailAddress"},[e("div",{staticClass:"cellText",attrs:{title:null!==t.user.email&&t.user.email.length>20?t.user.email:""}},[t._v("\n\t\t\t"+t._s(t.user.email)+"\n\t\t")])]),t._v(" "),e("td",{staticClass:"groups"},[t._v("\n\t\t"+t._s(t.userGroupsLabels)+"\n\t")]),t._v(" "),t.subAdminsGroups.length>0&&t.settings.isAdmin?e("td",{staticClass:"subAdminsGroups"},[t._v("\n\t\t"+t._s(t.userSubAdminsGroupsLabels)+"\n\t")]):t._e(),t._v(" "),e("td",{staticClass:"userQuota"},[e("div",{staticClass:"quota"},[t._v("\n\t\t\t"+t._s(t.userQuota)+" ("+t._s(t.usedSpace)+")\n\t\t\t"),e("progress",{staticClass:"quota-user-progress",class:{warn:t.usedQuota>80},attrs:{max:"100"},domProps:{value:t.usedQuota}})])]),t._v(" "),t.showConfig.showLanguages?e("td",{staticClass:"languages"},[t._v("\n\t\t"+t._s(t.userLanguage.name)+"\n\t")]):t._e(),t._v(" "),t.showConfig.showUserBackend||t.showConfig.showStoragePath?e("td",{staticClass:"userBackend"},[t.showConfig.showUserBackend?e("div",{staticClass:"userBackend"},[t._v("\n\t\t\t"+t._s(t.user.backend)+"\n\t\t")]):t._e(),t._v(" "),t.showConfig.showStoragePath?e("div",{staticClass:"storageLocation subtitle",attrs:{title:t.user.storageLocation}},[t._v("\n\t\t\t"+t._s(t.user.storageLocation)+"\n\t\t")]):t._e()]):t._e(),t._v(" "),t.showConfig.showLastLogin?e("td",{staticClass:"lastLogin",attrs:{title:t.userLastLoginTooltip}},[t._v("\n\t\t"+t._s(t.userLastLogin)+"\n\t")]):t._e(),t._v(" "),e("td",{staticClass:"managers"},[t._v("\n\t\t"+t._s(t.user.manager)+"\n\t")]),t._v(" "),e("td",{staticClass:"userActions"},[t.canEdit&&!t.loading.all?e("div",{staticClass:"toggleUserActions"},[e("NcActions",[e("NcActionButton",{attrs:{icon:"icon-rename",title:t.t("settings","Edit User"),"aria-label":t.t("settings","Edit User")},on:{click:t.toggleEdit}})],1),t._v(" "),e("div",{staticClass:"userPopoverMenuWrapper"},[e("button",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.hideMenu,expression:"hideMenu"}],staticClass:"icon-more",attrs:{"aria-label":t.t("settings","Toggle user actions menu")},on:{click:function(e){return e.preventDefault(),t.toggleMenu.apply(null,arguments)}}}),t._v(" "),e("div",{staticClass:"popovermenu",class:{open:t.openedMenu},attrs:{"aria-expanded":t.openedMenu}},[e("NcPopoverMenu",{attrs:{menu:t.userActions}})],1)])],1):t._e(),t._v(" "),e("div",{staticClass:"feedback",style:{opacity:""!==t.feedbackMessage?1:0}},[e("div",{staticClass:"icon-checkmark"}),t._v("\n\t\t\t"+t._s(t.feedbackMessage)+"\n\t\t")])])])}),[],!1,null,null,null).exports;var ht=n(25108);const mt={name:"UserRow",components:{UserRowSimple:pt,NcPopoverMenu:j.Rs,NcActions:j.O3,NcActionButton:j.Js,NcMultiselect:j.Z2},directives:{ClickOutside:E()},mixins:[J],props:{users:{type:Array,required:!0},user:{type:Object,required:!0},settings:{type:Object,default:()=>({})},groups:{type:Array,default:()=>[]},subAdminsGroups:{type:Array,default:()=>[]},quotaOptions:{type:Array,default:()=>[]},showConfig:{type:Object,default:()=>({})},languages:{type:Array,required:!0},externalActions:{type:Array,default:()=>[]},isDarkTheme:{type:Boolean,required:!0}},data:()=>({rand:parseInt(1e3*Math.random()),openedMenu:!1,feedbackMessage:"",possibleManagers:[],currentManager:"",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,manager:!1}}),computed:{userActions(){const 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)}},async beforeMount(){await this.searchUserManager(),this.user.manager&&await this.initManager(this.user.manager)},methods:{toggleMenu(){this.openedMenu=!this.openedMenu},hideMenu(){this.openedMenu=!1},wipeUserDevices(){const e=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:e}),t("settings","Remote wipe of devices"),{type:OC.dialogs.YES_NO_BUTTONS,confirm:t("settings","Wipe {userid}'s devices",{userid:e}),confirmClasses:"error",cancel:t("settings","Cancel")},(t=>{t&&(this.loading.wipe=!0,this.loading.all=!0,this.$store.dispatch("wipeUserDevices",e).then((()=>{this.loading.wipe=!1,this.loading.all=!1})))}),!0)},filterManagers(t){return t.filter((t=>t.id!==this.user.id))},async initManager(t){await this.$store.dispatch("getUser",t).then((t=>{this.currentManager=null==t?void 0:t.data.ocs.data}))},async searchUserManager(t){await this.$store.dispatch("searchUsers",{offset:0,limit:10,search:t}).then((t=>{const e=null!=t&&t.data?this.filterManagers(Object.values(null==t?void 0:t.data.ocs.data.users)):[];e.length>0&&(this.possibleManagers=e)}))},updateUserManager(t){this.loading.manager=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"manager",value:this.currentManager?this.currentManager.id:""}).then((()=>{this.loading.manager=!1}))},deleteUser(){const e=this.user.id;OC.dialogs.confirmDestructive(t("settings","Fully delete {userid}'s account including all their personal files, app data, etc.",{userid:e}),t("settings","Account deletion"),{type:OC.dialogs.YES_NO_BUTTONS,confirm:t("settings","Delete {userid}'s account",{userid:e}),confirmClasses:"error",cancel:t("settings","Cancel")},(t=>{if(t)return this.loading.delete=!0,this.loading.all=!0,this.$store.dispatch("deleteUser",e).then((()=>{this.loading.delete=!1,this.loading.all=!1}))}),!0)},enableDisableUser(){this.loading.delete=!0,this.loading.all=!0;const t=this.user.id,e=!this.user.enabled;return this.$store.dispatch("enableDisableUser",{userid:t,enabled:e}).then((()=>{this.loading.delete=!1,this.loading.all=!1}))},updateDisplayName(){const t=this.$refs.displayName.value;this.loading.displayName=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"displayname",value:t}).then((()=>{this.loading.displayName=!1,this.$refs.displayName.value=t}))},updatePassword(){const t=this.$refs.password.value;this.loading.password=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"password",value:t}).then((()=>{this.loading.password=!1,this.$refs.password.value=""}))},updateEmail(){const t=this.$refs.mailAddress.value;this.loading.mailAddress=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"email",value:t}).then((()=>{this.loading.mailAddress=!1,this.$refs.mailAddress.value=t}))},async createGroup(t){this.loading={groups:!0,subadmins:!0};try{await this.$store.dispatch("addGroup",t);const e=this.user.id;await this.$store.dispatch("addUserGroup",{userid:e,gid:t})}catch(t){ht.error(t)}finally{this.loading={groups:!1,subadmins:!1}}return this.$store.getters.getGroups[this.groups.length]},async addUserGroup(t){if(!1===t.canAdd)return!1;this.loading.groups=!0;const e=this.user.id,s=t.id;try{await this.$store.dispatch("addUserGroup",{userid:e,gid:s})}catch(t){ht.error(t)}finally{this.loading.groups=!1}},async removeUserGroup(t){if(!1===t.canRemove)return!1;this.loading.groups=!0;const e=this.user.id,s=t.id;try{await this.$store.dispatch("removeUserGroup",{userid:e,gid:s}),this.loading.groups=!1,this.$route.params.selectedGroup===s&&this.$store.commit("deleteUser",e)}catch{this.loading.groups=!1}},async addUserSubAdmin(t){this.loading.subadmins=!0;const e=this.user.id,s=t.id;try{await this.$store.dispatch("addUserSubAdmin",{userid:e,gid:s}),this.loading.subadmins=!1}catch(t){ht.error(t)}},async removeUserSubAdmin(t){this.loading.subadmins=!0;const e=this.user.id,s=t.id;try{await this.$store.dispatch("removeUserSubAdmin",{userid:e,gid:s})}catch(t){ht.error(t)}finally{this.loading.subadmins=!1}},async setUserQuota(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";this.loading.quota=!0,t=t.id?t.id:t;try{await this.$store.dispatch("setUserData",{userid:this.user.id,key:"quota",value:t})}catch(t){ht.error(t)}finally{this.loading.quota=!1}return t},validateQuota(t){const e=OC.Util.computerFileSize(t);return null!==e&&e>=0&&this.setUserQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(t)))},async setUserLanguage(t){this.loading.languages=!0;try{await this.$store.dispatch("setUserData",{userid:this.user.id,key:"language",value:t.code})}catch(t){ht.error(t)}finally{this.loading.languages=!1}return t},sendWelcomeMail(){this.loading.all=!0,this.$store.dispatch("sendWelcomeMail",this.user.id).then((e=>{e&&(this.feedbackMessage=t("setting","Welcome mail sent!"),setTimeout((()=>{this.feedbackMessage=""}),2e3)),this.loading.all=!1}))}}};var vt=n(91491),ft={};ft.styleTagTransform=ut(),ft.setAttributes=rt(),ft.insert=at().bind(null,"head"),ft.domAPI=st(),ft.insertStyleElement=lt(),tt()(vt.Z,ft),vt.Z&&vt.Z.locals&&vt.Z.locals;const wt=(0,O.Z)(mt,(function(){var t=this,e=t._self._c;return 1===Object.keys(t.user).length?e("div",{staticClass:"row",attrs:{"data-id":t.user.id}},[e("div",{staticClass:"avatar",class:{"icon-loading-small":t.loading.delete||t.loading.disable||t.loading.wipe}},[t.loading.delete||t.loading.disable||t.loading.wipe?t._e():e("img",{attrs:{src:t.generateAvatar(t.user.id,t.isDarkTheme),alt:"",height:"32",width:"32"}})]),t._v(" "),e("div",{staticClass:"name"},[t._v("\n\t\t"+t._s(t.user.id)+"\n\t")]),t._v(" "),e("div",{staticClass:"obfuscated"},[t._v("\n\t\t"+t._s(t.t("settings","You do not have permissions to see the details of this user"))+"\n\t")])]):t.editing?e("tr",{staticClass:"row row--editable",class:{disabled:t.loading.delete||t.loading.disable,"row--menu-opened":t.openedMenu},attrs:{"data-id":t.user.id}},[e("td",{staticClass:"avatar",class:{"icon-loading-small":t.loading.delete||t.loading.disable||t.loading.wipe}},[t.loading.delete||t.loading.disable||t.loading.wipe?t._e():e("img",{attrs:{src:t.generateAvatar(t.user.id,t.isDarkTheme),alt:"",height:"32",width:"32"}})]),t._v(" "),t.user.backendCapabilities.setDisplayName?e("td",{staticClass:"displayName"},[e("form",{staticClass:"displayName",class:{"icon-loading-small":t.loading.displayName},on:{submit:function(e){return e.preventDefault(),t.updateDisplayName.apply(null,arguments)}}},[e("label",{staticClass:"hidden-visually",attrs:{for:"displayName"+t.user.id+t.rand}},[t._v(t._s(t.t("settings","Edit display name")))]),t._v(" "),e("input",{ref:"displayName",attrs:{id:"displayName"+t.user.id+t.rand,disabled:t.loading.displayName||t.loading.all,autocapitalize:"off",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text"},domProps:{value:t.user.displayname}}),t._v(" "),e("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})])]):e("td",{staticClass:"name"},[t._v("\n\t\t"+t._s(t.user.id)+"\n\t\t"),e("div",{staticClass:"displayName subtitle"},[e("div",{staticClass:"cellText",attrs:{title:t.user.displayname.length>20?t.user.displayname:""}},[t._v("\n\t\t\t\t"+t._s(t.user.displayname)+"\n\t\t\t")])])]),t._v(" "),t.settings.canChangePassword&&t.user.backendCapabilities.setPassword?e("td",[e("form",{staticClass:"password",class:{"icon-loading-small":t.loading.password},on:{submit:function(e){return e.preventDefault(),t.updatePassword.apply(null,arguments)}}},[e("label",{staticClass:"hidden-visually",attrs:{for:"password"+t.user.id+t.rand}},[t._v(t._s(t.t("settings","Add new password")))]),t._v(" "),e("input",{ref:"password",attrs:{id:"password"+t.user.id+t.rand,disabled:t.loading.password||t.loading.all,minlength:t.minPasswordLength,maxlength:"469",placeholder:t.t("settings","Add new password"),autocapitalize:"off",autocomplete:"new-password",autocorrect:"off",required:"",spellcheck:"false",type:"password",value:""}}),t._v(" "),e("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})])]):e("td"),t._v(" "),e("td",[e("form",{staticClass:"mailAddress",class:{"icon-loading-small":t.loading.mailAddress},on:{submit:function(e){return e.preventDefault(),t.updateEmail.apply(null,arguments)}}},[e("label",{staticClass:"hidden-visually",attrs:{for:"mailAddress"+t.user.id+t.rand}},[t._v(t._s(t.t("settings","Add new email address")))]),t._v(" "),e("input",{ref:"mailAddress",attrs:{id:"mailAddress"+t.user.id+t.rand,disabled:t.loading.mailAddress||t.loading.all,placeholder:t.t("settings","Add new email address"),autocapitalize:"off",autocomplete:"new-password",autocorrect:"off",spellcheck:"false",type:"email"},domProps:{value:t.user.email}}),t._v(" "),e("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})])]),t._v(" "),e("td",{staticClass:"groups",class:{"icon-loading-small":t.loading.groups}},[e("label",{staticClass:"hidden-visually",attrs:{for:"groups"+t.user.id+t.rand}},[t._v(t._s(t.t("settings","Add user to group")))]),t._v(" "),e("NcMultiselect",{staticClass:"multiselect-vue",attrs:{id:"groups"+t.user.id+t.rand,"close-on-select":!1,disabled:t.loading.groups||t.loading.all,limit:2,multiple:!0,options:t.availableGroups,placeholder:t.t("settings","Add user to group"),"tag-width":60,taggable:t.settings.isAdmin,value:t.userGroups,label:"name","tag-placeholder":"create","track-by":"id"},on:{remove:t.removeUserGroup,select:t.addUserGroup,tag:t.createGroup}},[e("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1),t._v(" "),t.subAdminsGroups.length>0&&t.settings.isAdmin?e("td",{staticClass:"subadmins",class:{"icon-loading-small":t.loading.subadmins}},[e("label",{staticClass:"hidden-visually",attrs:{for:"subadmins"+t.user.id+t.rand}},[t._v(t._s(t.t("settings","Set user as admin for")))]),t._v(" "),e("NcMultiselect",{staticClass:"multiselect-vue",attrs:{id:"subadmins"+t.user.id+t.rand,"close-on-select":!1,disabled:t.loading.subadmins||t.loading.all,limit:2,multiple:!0,options:t.subAdminsGroups,placeholder:t.t("settings","Set user as admin for"),"tag-width":60,value:t.userSubAdminsGroups,label:"name","track-by":"id"},on:{remove:t.removeUserSubAdmin,select:t.addUserSubAdmin}},[e("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1):t._e(),t._v(" "),e("td",{staticClass:"quota",class:{"icon-loading-small":t.loading.quota},attrs:{title:t.usedSpace}},[e("label",{staticClass:"hidden-visually",attrs:{for:"quota"+t.user.id+t.rand}},[t._v(t._s(t.t("settings","Select user quota")))]),t._v(" "),e("NcMultiselect",{staticClass:"multiselect-vue",attrs:{id:"quota"+t.user.id+t.rand,"allow-empty":!1,disabled:t.loading.quota||t.loading.all,options:t.quotaOptions,placeholder:t.t("settings","Select user quota"),taggable:!0,value:t.userQuota,label:"label","tag-placeholder":"create","track-by":"id"},on:{input:t.setUserQuota,tag:t.validateQuota}})],1),t._v(" "),t.showConfig.showLanguages?e("td",{staticClass:"languages",class:{"icon-loading-small":t.loading.languages}},[e("label",{staticClass:"hidden-visually",attrs:{for:"language"+t.user.id+t.rand}},[t._v(t._s(t.t("settings","Set the language")))]),t._v(" "),e("NcMultiselect",{staticClass:"multiselect-vue",attrs:{id:"language"+t.user.id+t.rand,"allow-empty":!1,disabled:t.loading.languages||t.loading.all,options:t.languages,placeholder:t.t("settings","No language set"),value:t.userLanguage,"group-label":"label","group-values":"languages",label:"name","track-by":"code"},on:{input:t.setUserLanguage}})],1):t._e(),t._v(" "),e("td",{staticClass:"managers",class:{"icon-loading-small":t.loading.manager}},[e("NcMultiselect",{ref:"manager",staticClass:"multiselect-vue",attrs:{"close-on-select":!0,"user-select":!0,options:t.possibleManagers,placeholder:t.t("settings","Select manager"),label:"displayname","track-by":"id"},on:{"search-change":t.searchUserManager,remove:t.updateUserManager,select:t.updateUserManager},model:{value:t.currentManager,callback:function(e){t.currentManager=e},expression:"currentManager"}},[e("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1),t._v(" "),t.showConfig.showStoragePath||t.showConfig.showUserBackend?e("td",{staticClass:"storageLocation"}):t._e(),t._v(" "),t.showConfig.showLastLogin?e("td"):t._e(),t._v(" "),e("td",{staticClass:"userActions"},[t.loading.all?t._e():e("div",{staticClass:"toggleUserActions"},[e("NcActions",[e("NcActionButton",{attrs:{icon:"icon-checkmark",title:t.t("settings","Done"),"aria-label":t.t("settings","Done")},on:{click:function(e){t.editing=!1}}})],1),t._v(" "),e("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.hideMenu,expression:"hideMenu"}],staticClass:"userPopoverMenuWrapper"},[e("button",{staticClass:"icon-more",on:{click:function(e){return e.preventDefault(),t.toggleMenu.apply(null,arguments)}}}),t._v(" "),e("div",{staticClass:"popovermenu",class:{open:t.openedMenu}},[e("NcPopoverMenu",{attrs:{menu:t.userActions}})],1)])],1),t._v(" "),e("div",{staticClass:"feedback",style:{opacity:""!==t.feedbackMessage?1:0}},[e("div",{staticClass:"icon-checkmark"}),t._v("\n\t\t\t"+t._s(t.feedbackMessage)+"\n\t\t")])])]):e("UserRowSimple",{class:{"row--menu-opened":t.openedMenu},attrs:{editing:t.editing,"feedback-message":t.feedbackMessage,groups:t.groups,languages:t.languages,loading:t.loading,"opened-menu":t.openedMenu,settings:t.settings,"show-config":t.showConfig,"sub-admins-groups":t.subAdminsGroups,"user-actions":t.userActions,user:t.user,"is-dark-theme":t.isDarkTheme},on:{"update:editing":function(e){t.editing=e},"update:openedMenu":function(e){t.openedMenu=e},"update:opened-menu":function(e){t.openedMenu=e}}})}),[],!1,null,"8360d33a",null).exports,At={id:"none",label:t("settings","Unlimited")},bt={id:"default",label:t("settings","Default quota")},_t={id:"",displayName:"",password:"",mailAddress:"",groups:[],manager:"",subAdminsGroups:[],quota:bt,language:{code:"en",name:t("settings","Default language")}},Ct={name:"UserList",components:{NcModal:z(),userRow:wt,NcMultiselect:y(),InfiniteLoading:Q(),NcButton:T()},props:{users:{type:Array,default:()=>[]},showConfig:{type:Object,required:!0},selectedGroup:{type:String,default:null},externalActions:{type:Array,default:()=>[]}},data:()=>({unlimitedQuota:At,defaultQuota:bt,loading:{all:!1,groups:!1},scrolled:!1,possibleManagers:[],searchQuery:"",newUser:Object.assign({},_t)}),computed:{settings(){return this.$store.getters.getServerData},selectedGroupDecoded(){return decodeURIComponent(this.selectedGroup)},filteredUsers(){return"disabled"===this.selectedGroup?this.users.filter((t=>!1===t.enabled)):(this.settings.isAdmin,this.users.filter((t=>!1!==t.enabled)))},groups(){return this.$store.getters.getGroups.filter((t=>"disabled"!==t.id)).sort(((t,e)=>t.name.localeCompare(e.name)))},canAddGroups(){return this.groups.map((t=>((t=Object.assign({},t)).$isDisabled=!1===t.canAdd,t)))},subAdminsGroups(){return this.$store.getters.getSubadminGroups},quotaOptions(){const t=this.settings.quotaPreset.reduce(((t,e)=>t.concat({id:e,label:e})),[]);return this.settings.allowUnlimitedQuota&&t.unshift(this.unlimitedQuota),t.unshift(this.defaultQuota),t},minPasswordLength(){return this.$store.getters.getPasswordPolicyMinLength},usersOffset(){return this.$store.getters.getUsersOffset},usersLimit(){return this.$store.getters.getUsersLimit},usersCount(){return this.users.length},languages(){return[{label:t("settings","Common languages"),languages:this.settings.languages.commonLanguages},{label:t("settings","Other languages"),languages:this.settings.languages.otherLanguages}]},isDarkTheme(){return"invert(100%)"===window.getComputedStyle(this.$el).getPropertyValue("--background-invert-if-dark")}},watch:{selectedGroup(t,e){this.redirectIfDisabled(),this.$store.commit("resetUsers"),this.$refs.infiniteLoading.stateChanger.reset(),this.setNewUserDefaultGroup(t)},usersCount(t,e){0===t&&1===e?this.$refs.infiniteLoading.stateChanger.reset():1===t&&0===e&&this.$refs.infiniteLoading.stateChanger.loaded()}},async beforeMount(){await this.searchUserManager()},mounted(){this.settings.canChangePassword||OC.Notification.showTemporary(t("settings","Password change is disabled because the master key is disabled")),this.resetForm(),(0,P.Ld)("nextcloud:unified-search.search",this.search),(0,P.Ld)("nextcloud:unified-search.reset",this.resetSearch),this.redirectIfDisabled()},beforeDestroy(){(0,P.r1)("nextcloud:unified-search.search",this.search),(0,P.r1)("nextcloud:unified-search.reset",this.resetSearch)},methods:{async searchUserManager(t){await this.$store.dispatch("searchUsers",{offset:0,limit:10,search:t}).then((t=>{const e=null!=t&&t.data?Object.values(null==t?void 0:t.data.ocs.data.users):[];e.length>0&&(this.possibleManagers=e)}))},onScroll(t){this.scrolled=t.target.scrollTo>0},validateQuota(t){const e=OC.Util.computerFileSize(t);return null!==e&&e>=0?(t=OC.Util.humanFileSize(OC.Util.computerFileSize(t)),this.newUser.quota={id:t,label:t},this.newUser.quota):(this.newUser.quota=this.quotaOptions[0],this.quotaOptions[0])},infiniteHandler(t){this.$store.dispatch("getUsers",{offset:this.usersOffset,limit:this.usersLimit,group:"disabled"!==this.selectedGroup?this.selectedGroup:"",search:this.searchQuery}).then((e=>{e>0&&t.loaded(),e<this.usersLimit&&t.complete()}))},search(t){let{query:e}=t;this.searchQuery=e,this.$store.commit("resetUsers"),this.$refs.infiniteLoading.stateChanger.reset()},resetSearch(){this.search({query:""})},resetForm(){this.newUser=Object.assign({},_t),this.settings.defaultLanguage&&U.default.set(this.newUser.language,"code",this.settings.defaultLanguage),this.setNewUserDefaultGroup(this.selectedGroup),this.loading.all=!1},createUser(){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((t=>t.id)),subadmin:this.newUser.subAdminsGroups.map((t=>t.id)),quota:this.newUser.quota.id,language:this.newUser.language.code,manager:this.newUser.manager.id}).then((()=>{this.resetForm(),this.$refs.newusername.focus(),this.closeModal()})).catch((t=>{if(this.loading.all=!1,t.response&&t.response.data&&t.response.data.ocs&&t.response.data.ocs.meta){const e=t.response.data.ocs.meta.statuscode;102===e?this.$refs.newusername.focus():107===e&&this.$refs.newuserpassword.focus()}}))},setNewUserDefaultGroup(t){if(t&&t.length>0){const e=this.groups.find((e=>e.id===t));if(e)return void(this.newUser.groups=[e])}this.newUser.groups=[]},createGroup(t){return this.loading.groups=!0,this.$store.dispatch("addGroup",t).then((e=>{this.newUser.groups.push(this.groups.find((e=>e.id===t))),this.loading.groups=!1})).catch((()=>{this.loading.groups=!1})),this.$store.getters.getGroups[this.groups.length]},redirectIfDisabled(){const t=this.$store.getters.getGroups;"disabled"===this.selectedGroup&&t.findIndex((t=>"disabled"===t.id&&0===t.usercount))>-1&&(this.$router.push({name:"users"}),this.$refs.infiniteLoading.stateChanger.reset())},closeModal(){this.showConfig.showNewUserForm=!1}}};var yt=n(26280),Ut={};Ut.styleTagTransform=ut(),Ut.setAttributes=rt(),Ut.insert=at().bind(null,"head"),Ut.domAPI=st(),Ut.insertStyleElement=lt(),tt()(yt.Z,Ut),yt.Z&&yt.Z.locals&&yt.Z.locals;const kt=(0,O.Z)(Ct,(function(){var t=this,e=t._self._c;return e("table",{staticClass:"user-list-grid",attrs:{id:"app-content",role:"grid","aria-label":t.t("settings","User's table")},on:{"&scroll":function(e){return t.onScroll.apply(null,arguments)}}},[t.showConfig.showNewUserForm?e("NcModal",{attrs:{size:"small"},on:{close:t.closeModal}},[e("form",{staticClass:"modal__content",attrs:{id:"new-user",disabled:t.loading.all},on:{submit:function(e){return e.preventDefault(),t.createUser.apply(null,arguments)}}},[e("h2",[t._v(t._s(t.t("settings","New user")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.newUser.id,expression:"newUser.id"}],ref:"newusername",staticClass:"modal__item",attrs:{id:"newusername",disabled:t.settings.newUserGenerateUserID,placeholder:t.settings.newUserGenerateUserID?t.t("settings","Will be autogenerated"):t.t("settings","Username"),autocapitalize:"none",autocomplete:"off",autocorrect:"off",name:"username",pattern:"[a-zA-Z0-9 _\\.@\\-']+",required:"",type:"text"},domProps:{value:t.newUser.id},on:{input:function(e){e.target.composing||t.$set(t.newUser,"id",e.target.value)}}}),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.newUser.displayName,expression:"newUser.displayName"}],staticClass:"modal__item",attrs:{id:"newdisplayname",placeholder:t.t("settings","Display name"),autocapitalize:"none",autocomplete:"off",autocorrect:"off",name:"displayname",type:"text"},domProps:{value:t.newUser.displayName},on:{input:function(e){e.target.composing||t.$set(t.newUser,"displayName",e.target.value)}}}),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.newUser.password,expression:"newUser.password"}],ref:"newuserpassword",staticClass:"modal__item",attrs:{id:"newuserpassword",minlength:t.minPasswordLength,maxlength:469,placeholder:t.t("settings","Password"),required:""===t.newUser.mailAddress,autocapitalize:"none",autocomplete:"new-password",autocorrect:"off",name:"password",type:"password"},domProps:{value:t.newUser.password},on:{input:function(e){e.target.composing||t.$set(t.newUser,"password",e.target.value)}}}),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.newUser.mailAddress,expression:"newUser.mailAddress"}],staticClass:"modal__item",attrs:{id:"newemail",placeholder:t.t("settings","Email"),required:""===t.newUser.password||t.settings.newUserRequireEmail,autocapitalize:"none",autocomplete:"off",autocorrect:"off",name:"email",type:"email"},domProps:{value:t.newUser.mailAddress},on:{input:function(e){e.target.composing||t.$set(t.newUser,"mailAddress",e.target.value)}}}),t._v(" "),e("div",{staticClass:"groups modal__item"},[t.settings.isAdmin?t._e():e("input",{class:{"icon-loading-small":t.loading.groups},attrs:{id:"newgroups",required:!t.settings.isAdmin,tabindex:"-1",type:"text"},domProps:{value:t.newUser.groups}}),t._v(" "),e("NcMultiselect",{staticClass:"multiselect-vue",attrs:{"close-on-select":!1,disabled:t.loading.groups||t.loading.all,multiple:!0,options:t.canAddGroups,placeholder:t.t("settings","Add user to group"),"tag-width":60,taggable:!0,label:"name","tag-placeholder":"create","track-by":"id"},on:{tag:t.createGroup},model:{value:t.newUser.groups,callback:function(e){t.$set(t.newUser,"groups",e)},expression:"newUser.groups"}},[e("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1),t._v(" "),t.subAdminsGroups.length>0&&t.settings.isAdmin?e("div",{staticClass:"subadmins modal__item"},[e("NcMultiselect",{staticClass:"multiselect-vue",attrs:{"close-on-select":!1,multiple:!0,options:t.subAdminsGroups,placeholder:t.t("settings","Set user as admin for"),"tag-width":60,label:"name","track-by":"id"},model:{value:t.newUser.subAdminsGroups,callback:function(e){t.$set(t.newUser,"subAdminsGroups",e)},expression:"newUser.subAdminsGroups"}},[e("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1):t._e(),t._v(" "),e("div",{staticClass:"quota modal__item"},[e("NcMultiselect",{staticClass:"multiselect-vue",attrs:{"allow-empty":!1,options:t.quotaOptions,placeholder:t.t("settings","Select user quota"),taggable:!0,label:"label","track-by":"id"},on:{tag:t.validateQuota},model:{value:t.newUser.quota,callback:function(e){t.$set(t.newUser,"quota",e)},expression:"newUser.quota"}})],1),t._v(" "),t.showConfig.showLanguages?e("div",{staticClass:"languages modal__item"},[e("NcMultiselect",{staticClass:"multiselect-vue",attrs:{"allow-empty":!1,options:t.languages,placeholder:t.t("settings","Default language"),"group-label":"label","group-values":"languages",label:"name","track-by":"code"},model:{value:t.newUser.language,callback:function(e){t.$set(t.newUser,"language",e)},expression:"newUser.language"}})],1):t._e(),t._v(" "),t.showConfig.showStoragePath?e("div",{staticClass:"storageLocation"}):t._e(),t._v(" "),t.showConfig.showUserBackend?e("div",{staticClass:"userBackend"}):t._e(),t._v(" "),t.showConfig.showLastLogin?e("div",{staticClass:"lastLogin"}):t._e(),t._v(" "),e("div",{staticClass:"modal__item managers",class:{"icon-loading-small":t.loading.manager}},[e("NcMultiselect",{ref:"manager",staticClass:"multiselect-vue",attrs:{"close-on-select":!0,"user-select":!0,options:t.possibleManagers,placeholder:t.t("settings","Select user manager"),label:"displayname","track-by":"id"},on:{"search-change":t.searchUserManager},model:{value:t.newUser.manager,callback:function(e){t.$set(t.newUser,"manager",e)},expression:"newUser.manager"}},[e("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1),t._v(" "),e("div",{staticClass:"user-actions"},[e("NcButton",{attrs:{id:"newsubmit",type:"primary","native-type":"submit",value:""}},[t._v("\n\t\t\t\t\t"+t._s(t.t("settings","Add a new user"))+"\n\t\t\t\t")])],1)])]):t._e(),t._v(" "),e("tbody",[e("tr",{staticClass:"row",class:{sticky:t.scrolled&&!t.showConfig.showNewUserForm},attrs:{id:"grid-header"}},[e("th",{staticClass:"avatar",attrs:{id:"headerAvatar"}},[e("span",{staticClass:"hidden-visually"},[t._v(" "+t._s(t.t("settings","Avatar"))+" ")])]),t._v(" "),e("th",{staticClass:"name",attrs:{id:"headerName"}},[e("div",{staticClass:"subtitle"},[e("strong",[t._v("\n\t\t\t\t\t\t"+t._s(t.t("settings","Display name"))+"\n\t\t\t\t\t")])]),t._v("\n\t\t\t\t"+t._s(t.t("settings","Username"))+"\n\t\t\t")]),t._v(" "),e("th",{staticClass:"password",attrs:{id:"headerPassword"}},[t._v("\n\t\t\t\t"+t._s(t.t("settings","Password"))+"\n\t\t\t")]),t._v(" "),e("th",{staticClass:"mailAddress",attrs:{id:"headerAddress"}},[t._v("\n\t\t\t\t"+t._s(t.t("settings","Email"))+"\n\t\t\t")]),t._v(" "),e("th",{staticClass:"groups",attrs:{id:"headerGroups"}},[t._v("\n\t\t\t\t"+t._s(t.t("settings","Groups"))+"\n\t\t\t")]),t._v(" "),t.subAdminsGroups.length>0&&t.settings.isAdmin?e("th",{staticClass:"subadmins",attrs:{id:"headerSubAdmins"}},[t._v("\n\t\t\t\t"+t._s(t.t("settings","Group admin for"))+"\n\t\t\t")]):t._e(),t._v(" "),e("th",{staticClass:"quota",attrs:{id:"headerQuota"}},[t._v("\n\t\t\t\t"+t._s(t.t("settings","Quota"))+"\n\t\t\t")]),t._v(" "),t.showConfig.showLanguages?e("th",{staticClass:"languages",attrs:{id:"headerLanguages"}},[t._v("\n\t\t\t\t"+t._s(t.t("settings","Language"))+"\n\t\t\t")]):t._e(),t._v(" "),t.showConfig.showUserBackend||t.showConfig.showStoragePath?e("th",{staticClass:"headerUserBackend userBackend"},[t.showConfig.showUserBackend?e("div",{staticClass:"userBackend"},[t._v("\n\t\t\t\t\t"+t._s(t.t("settings","User backend"))+"\n\t\t\t\t")]):t._e(),t._v(" "),t.showConfig.showStoragePath?e("div",{staticClass:"subtitle storageLocation"},[t._v("\n\t\t\t\t\t"+t._s(t.t("settings","Storage location"))+"\n\t\t\t\t")]):t._e()]):t._e(),t._v(" "),t.showConfig.showLastLogin?e("th",{staticClass:"headerLastLogin lastLogin"},[t._v("\n\t\t\t\t"+t._s(t.t("settings","Last login"))+"\n\t\t\t")]):t._e(),t._v(" "),e("th",{staticClass:"manager",attrs:{id:"headerManager"}},[t._v("\n\t\t\t\t"+t._s(t.t("settings","Manager"))+"\n\t\t\t")]),t._v(" "),e("th",{staticClass:"userActions hidden-visually"},[t._v("\n\t\t\t\t"+t._s(t.t("settings","User actions"))+"\n\t\t\t")])]),t._v(" "),t._l(t.filteredUsers,(function(s){return e("user-row",{key:s.id,attrs:{"external-actions":t.externalActions,groups:t.groups,languages:t.languages,"quota-options":t.quotaOptions,settings:t.settings,"show-config":t.showConfig,"sub-admins-groups":t.subAdminsGroups,user:s,users:t.users,"is-dark-theme":t.isDarkTheme}})})),t._v(" "),e("InfiniteLoading",{ref:"infiniteLoading",on:{infinite:t.infiniteHandler}},[e("div",{attrs:{slot:"spinner"},slot:"spinner"},[e("div",{staticClass:"users-icon-loading icon-loading"})]),t._v(" "),e("div",{attrs:{slot:"no-more"},slot:"no-more"},[e("div",{staticClass:"users-list-end"})]),t._v(" "),e("div",{attrs:{slot:"no-results"},slot:"no-results"},[e("div",{attrs:{id:"emptycontent"}},[e("div",{staticClass:"icon-contacts-dark"}),t._v(" "),e("h2",[t._v(t._s(t.t("settings","No users in here")))])])])])],2)],1)}),[],!1,null,"84f756a4",null).exports;var Nt=n(25108);U.default.use(N());const Lt={name:"Users",components:{NcAppContent:i(),NcAppNavigation:o(),NcAppNavigationCaption:d(),NcAppNavigationCounter:c(),NcAppNavigationItem:p(),NcAppNavigationNew:m(),NcAppNavigationSettings:f(),NcContent:b(),GroupListItem:D,NcMultiselect:y(),UserList:kt},props:{selectedGroup:{type:String,default:null}},data:()=>({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:{selectedGroupDecoded(){return this.selectedGroup?decodeURIComponent(this.selectedGroup):null},users(){return this.$store.getters.getUsers},groups(){return this.$store.getters.getGroups},usersOffset(){return this.$store.getters.getUsersOffset},usersLimit(){return this.$store.getters.getUsersLimit},showLanguages:{get(){return this.getLocalstorage("showLanguages")},set(t){this.setLocalStorage("showLanguages",t)}},showLastLogin:{get(){return this.getLocalstorage("showLastLogin")},set(t){this.setLocalStorage("showLastLogin",t)}},showUserBackend:{get(){return this.getLocalstorage("showUserBackend")},set(t){this.setLocalStorage("showUserBackend",t)}},showStoragePath:{get(){return this.getLocalstorage("showStoragePath")},set(t){this.setLocalStorage("showStoragePath",t)}},userCount(){return this.$store.getters.getUserCount},settings(){return this.$store.getters.getServerData},quotaOptions(){const t=this.settings.quotaPreset.reduce(((t,e)=>t.concat({id:e,label:e})),[]);return this.settings.allowUnlimitedQuota&&t.unshift(this.unlimitedQuota),t},defaultQuota:{get(){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(t){this.selectedQuota=t}},sendWelcomeMail:{get(){return this.settings.newUserSendEmail},async set(t){try{this.loadingSendMail=!0,this.$store.commit("setServerData",{...this.settings,newUserSendEmail:t}),await w.default.post((0,_.generateUrl)("/settings/users/preferences/newUser.sendEmail"),{value:t?"yes":"no"})}catch(t){Nt.error("could not update newUser.sendEmail preference: "+t.message,t)}finally{this.loadingSendMail=!1}}},groupList(){return(Array.isArray(this.groups)?this.groups:[]).filter((t=>"disabled"!==t.id&&"admin"!==t.id)).map((t=>this.formatGroupMenu(t)))},adminGroupMenu(){return this.formatGroupMenu(this.groups.find((t=>"admin"===t.id)))},disabledGroupMenu(){return this.formatGroupMenu(this.groups.find((t=>"disabled"===t.id)))}},beforeMount(){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(){Object.assign(OCA,{Settings:{UserList:{registerAction:this.registerAction}}})},methods:{showNewUserMenu(){this.showConfig.showNewUserForm=!0,this.showConfig.showNewUserForm&&U.default.nextTick((()=>{window.newusername.focus()}))},getLocalstorage(t){const e=this.$localStorage.get(t);return this.showConfig[t]=null!==e?"true"===e:this.showConfig[t],this.showConfig[t]},setLocalStorage(t,e){return this.showConfig[t]=e,this.$localStorage.set(t,e),e},setDefaultQuota(){let 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((()=>{"object"!=typeof t&&(t={id:t,label:t}),this.defaultQuota=t}))},validateQuota(t){return null===OC.Util.computerFileSize(t)?this.setDefaultQuota("none"):this.setDefaultQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(t)))},registerAction(t,e,s){return this.externalActions.push({icon:t,text:e,action:s}),this.externalActions},async createGroup(t){if(""!==t.trim())try{this.loadingAddGroup=!0,await this.$store.dispatch("addGroup",t.trim()),this.hideAddGroupForm(),await this.$router.push({name:"group",params:{selectedGroup:encodeURIComponent(t.trim())}})}catch{this.showAddGroupForm()}finally{this.loadingAddGroup=!1}},showAddGroupForm(){this.$refs.addGroup.editingActive=!0,this.$refs.addGroup.onMenuToggle(!1),this.$nextTick((()=>{this.$refs.addGroup.$refs.editingInput.focusInput()}))},hideAddGroupForm(){this.$refs.addGroup.editingActive=!1,this.$refs.addGroup.editingValue=""},formatGroupMenu(t){const e={};return void 0===t?{}:(e.id=t.id,e.title=t.name,e.usercount=t.usercount,t.usercount-t.disabled>0&&(e.count=t.usercount-t.disabled),e)}}};var Gt=n(40551),Mt={};Mt.styleTagTransform=ut(),Mt.setAttributes=rt(),Mt.insert=at().bind(null,"head"),Mt.domAPI=st(),Mt.insertStyleElement=lt(),tt()(Gt.Z,Mt),Gt.Z&&Gt.Z.locals&&Gt.Z.locals;const xt=(0,O.Z)(Lt,(function(){var t=this,e=t._self._c;return e("NcContent",{attrs:{"app-name":"settings","navigation-class":{"icon-loading":t.loadingAddGroup}}},[e("NcAppNavigation",{scopedSlots:t._u([{key:"list",fn:function(){return[e("NcAppNavigationItem",{ref:"addGroup",attrs:{id:"addgroup","edit-placeholder":t.t("settings","Enter group name"),editable:!0,loading:t.loadingAddGroup,title:t.t("settings","Add group"),icon:"icon-add"},on:{click:t.showAddGroupForm,"update:title":t.createGroup}}),t._v(" "),e("NcAppNavigationItem",{attrs:{id:"everyone",exact:!0,title:t.t("settings","Active users"),to:{name:"users"},icon:"icon-contacts-dark"}},[t.userCount>0?e("NcAppNavigationCounter",{attrs:{slot:"counter"},slot:"counter"},[t._v("\n\t\t\t\t\t"+t._s(t.userCount)+"\n\t\t\t\t")]):t._e()],1),t._v(" "),t.settings.isAdmin?e("NcAppNavigationItem",{attrs:{id:"admin",exact:!0,title:t.t("settings","Admins"),to:{name:"group",params:{selectedGroup:"admin"}},icon:"icon-user-admin"}},[t.adminGroupMenu.count?e("NcAppNavigationCounter",{attrs:{slot:"counter"},slot:"counter"},[t._v("\n\t\t\t\t\t"+t._s(t.adminGroupMenu.count)+"\n\t\t\t\t")]):t._e()],1):t._e(),t._v(" "),t.disabledGroupMenu.usercount>0||-1===t.disabledGroupMenu.usercount?e("NcAppNavigationItem",{attrs:{id:"disabled",exact:!0,title:t.t("settings","Disabled users"),to:{name:"group",params:{selectedGroup:"disabled"}},icon:"icon-disabled-users"}},[t.disabledGroupMenu.usercount>0?e("NcAppNavigationCounter",{attrs:{slot:"counter"},slot:"counter"},[t._v("\n\t\t\t\t\t"+t._s(t.disabledGroupMenu.usercount)+"\n\t\t\t\t")]):t._e()],1):t._e(),t._v(" "),t.groupList.length>0?e("NcAppNavigationCaption",{attrs:{title:t.t("settings","Groups")}}):t._e(),t._v(" "),t._l(t.groupList,(function(t){return e("GroupListItem",{key:t.id,attrs:{id:t.id,title:t.title,count:t.count}})}))]},proxy:!0},{key:"footer",fn:function(){return[e("NcAppNavigationSettings",[e("div",[e("p",[t._v(t._s(t.t("settings","Default quota:")))]),t._v(" "),e("NcMultiselect",{attrs:{value:t.defaultQuota,options:t.quotaOptions,"tag-placeholder":"create",placeholder:t.t("settings","Select default quota"),label:"label","track-by":"id","allow-empty":!1,taggable:!0},on:{tag:t.validateQuota,input:t.setDefaultQuota}})],1),t._v(" "),e("div",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.showLanguages,expression:"showLanguages"}],staticClass:"checkbox",attrs:{id:"showLanguages",type:"checkbox"},domProps:{checked:Array.isArray(t.showLanguages)?t._i(t.showLanguages,null)>-1:t.showLanguages},on:{change:function(e){var s=t.showLanguages,n=e.target,a=!!n.checked;if(Array.isArray(s)){var i=t._i(s,null);n.checked?i<0&&(t.showLanguages=s.concat([null])):i>-1&&(t.showLanguages=s.slice(0,i).concat(s.slice(i+1)))}else t.showLanguages=a}}}),t._v(" "),e("label",{attrs:{for:"showLanguages"}},[t._v(t._s(t.t("settings","Show Languages")))])]),t._v(" "),e("div",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.showLastLogin,expression:"showLastLogin"}],staticClass:"checkbox",attrs:{id:"showLastLogin",type:"checkbox"},domProps:{checked:Array.isArray(t.showLastLogin)?t._i(t.showLastLogin,null)>-1:t.showLastLogin},on:{change:function(e){var s=t.showLastLogin,n=e.target,a=!!n.checked;if(Array.isArray(s)){var i=t._i(s,null);n.checked?i<0&&(t.showLastLogin=s.concat([null])):i>-1&&(t.showLastLogin=s.slice(0,i).concat(s.slice(i+1)))}else t.showLastLogin=a}}}),t._v(" "),e("label",{attrs:{for:"showLastLogin"}},[t._v(t._s(t.t("settings","Show last login")))])]),t._v(" "),e("div",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.showUserBackend,expression:"showUserBackend"}],staticClass:"checkbox",attrs:{id:"showUserBackend",type:"checkbox"},domProps:{checked:Array.isArray(t.showUserBackend)?t._i(t.showUserBackend,null)>-1:t.showUserBackend},on:{change:function(e){var s=t.showUserBackend,n=e.target,a=!!n.checked;if(Array.isArray(s)){var i=t._i(s,null);n.checked?i<0&&(t.showUserBackend=s.concat([null])):i>-1&&(t.showUserBackend=s.slice(0,i).concat(s.slice(i+1)))}else t.showUserBackend=a}}}),t._v(" "),e("label",{attrs:{for:"showUserBackend"}},[t._v(t._s(t.t("settings","Show user backend")))])]),t._v(" "),e("div",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.showStoragePath,expression:"showStoragePath"}],staticClass:"checkbox",attrs:{id:"showStoragePath",type:"checkbox"},domProps:{checked:Array.isArray(t.showStoragePath)?t._i(t.showStoragePath,null)>-1:t.showStoragePath},on:{change:function(e){var s=t.showStoragePath,n=e.target,a=!!n.checked;if(Array.isArray(s)){var i=t._i(s,null);n.checked?i<0&&(t.showStoragePath=s.concat([null])):i>-1&&(t.showStoragePath=s.slice(0,i).concat(s.slice(i+1)))}else t.showStoragePath=a}}}),t._v(" "),e("label",{attrs:{for:"showStoragePath"}},[t._v(t._s(t.t("settings","Show storage path")))])]),t._v(" "),e("div",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.sendWelcomeMail,expression:"sendWelcomeMail"}],staticClass:"checkbox",attrs:{id:"sendWelcomeMail",disabled:t.loadingSendMail,type:"checkbox"},domProps:{checked:Array.isArray(t.sendWelcomeMail)?t._i(t.sendWelcomeMail,null)>-1:t.sendWelcomeMail},on:{change:function(e){var s=t.sendWelcomeMail,n=e.target,a=!!n.checked;if(Array.isArray(s)){var i=t._i(s,null);n.checked?i<0&&(t.sendWelcomeMail=s.concat([null])):i>-1&&(t.sendWelcomeMail=s.slice(0,i).concat(s.slice(i+1)))}else t.sendWelcomeMail=a}}}),t._v(" "),e("label",{attrs:{for:"sendWelcomeMail"}},[t._v(t._s(t.t("settings","Send email to new user")))])])])]},proxy:!0}])},[e("NcAppNavigationNew",{attrs:{"button-id":"new-user-button",text:t.t("settings","New user"),"button-class":"icon-add"},on:{click:t.showNewUserMenu,keyup:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.showNewUserMenu.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:t.showNewUserMenu.apply(null,arguments)}]}})],1),t._v(" "),e("NcAppContent",[e("UserList",{attrs:{users:t.users,"show-config":t.showConfig,"selected-group":t.selectedGroupDecoded,"external-actions":t.externalActions}})],1)],1)}),[],!1,null,"76897a76",null).exports}}]); -//# sourceMappingURL=settings-users-8351.js.map?v=c6826ea064a072689c83
\ No newline at end of file +"use strict";(self.webpackChunknextcloud=self.webpackChunknextcloud||[]).push([[8351],{47671:(e,t,s)=>{s.d(t,{Z:()=>o});var a=s(87537),i=s.n(a),n=s(23645),r=s.n(n)()(i());r.push([e.id,".modal-wrapper[data-v-a4fba162]{margin:2vh 0;align-items:flex-start}.modal__content[data-v-a4fba162]{display:flex;padding:20px;flex-direction:column;align-items:center;text-align:center}.modal__item[data-v-a4fba162]{margin-bottom:16px;width:100%}.modal__item[data-v-a4fba162]:not(:focus):not(:active){border-color:var(--color-border-dark)}.modal__item[data-v-a4fba162] .multiselect{width:100%}.user-actions[data-v-a4fba162]{margin-top:20px}.modal__content[data-v-a4fba162] .multiselect__single{text-align:left;box-sizing:border-box}.modal__content[data-v-a4fba162] .multiselect__content-wrapper{box-sizing:border-box}.row[data-v-a4fba162] .multiselect__single{z-index:auto !important}input#newgroups[data-v-a4fba162]{position:absolute;opacity:0;width:0}#app-content tbody tr[data-v-a4fba162]:hover,#app-content tbody tr[data-v-a4fba162]:focus,#app-content tbody tr[data-v-a4fba162]:active{background-color:var(--color-main-background)}","",{version:3,sources:["webpack://./apps/settings/src/components/UserList.vue"],names:[],mappings:"AACA,gCACC,YAAA,CACA,sBAAA,CAED,iCACC,YAAA,CACA,YAAA,CACA,qBAAA,CACA,kBAAA,CACA,iBAAA,CAED,8BACC,kBAAA,CACA,UAAA,CAED,uDACC,qCAAA,CAED,2CACC,UAAA,CAED,+BACC,eAAA,CAED,sDACC,eAAA,CACA,qBAAA,CAED,+DACC,qBAAA,CAED,2CACC,uBAAA,CAID,iCACC,iBAAA,CACA,SAAA,CAMA,OAAA,CAIA,wIAGC,6CAAA",sourcesContent:['\n.modal-wrapper {\n\tmargin: 2vh 0;\n\talign-items: flex-start;\n}\n.modal__content {\n\tdisplay: flex;\n\tpadding: 20px;\n\tflex-direction: column;\n\talign-items: center;\n\ttext-align: center;\n}\n.modal__item {\n\tmargin-bottom: 16px;\n\twidth: 100%;\n}\n.modal__item:not(:focus):not(:active) {\n\tborder-color: var(--color-border-dark);\n}\n.modal__item::v-deep .multiselect {\n\twidth: 100%;\n}\n.user-actions {\n\tmargin-top: 20px;\n}\n.modal__content::v-deep .multiselect__single {\n\ttext-align: left;\n\tbox-sizing: border-box;\n}\n.modal__content::v-deep .multiselect__content-wrapper {\n\tbox-sizing: border-box;\n}\n.row::v-deep .multiselect__single {\n\tz-index: auto !important;\n}\n\n/* fake input for groups validation */\ninput#newgroups {\n\tposition: absolute;\n\topacity: 0;\n\t/* The "hidden" input is behind the Multiselect, so in general it does\n\t * not receives clicks. However, with Firefox, after the validation\n\t * fails, it will receive the first click done on it, so its width needs\n\t * to be set to 0 to prevent that ("pointer-events: none" does not\n\t * prevent it). */\n\twidth: 0;\n}\n\n#app-content tbody tr {\n\t&:hover,\n\t&:focus,\n\t&:active {\n\t\tbackground-color: var(--color-main-background);\n\t}\n}\n'],sourceRoot:""}]);const o=r},91491:(e,t,s)=>{s.d(t,{Z:()=>o});var a=s(87537),i=s.n(a),n=s(23645),r=s.n(n)()(i());r.push([e.id,".row--menu-opened[data-v-8360d33a]{z-index:1 !important}.row[data-v-8360d33a] .multiselect__single{z-index:auto !important}.displayName input[data-v-8360d33a],.password input[data-v-8360d33a],.mailAddress input[data-v-8360d33a]{width:100%;height:44px !important;border:2px solid var(--color-border-dark)}","",{version:3,sources:["webpack://./apps/settings/src/components/UserList/UserRow.vue"],names:[],mappings:"AAEA,mCACC,oBAAA,CAED,2CACC,uBAAA,CAED,yGAGE,UAAA,CACA,sBAAA,CACD,yCAAA",sourcesContent:["\n// Force menu to be above other rows\n.row--menu-opened {\n\tz-index: 1 !important;\n}\n.row::v-deep .multiselect__single {\n\tz-index: auto !important;\n}\n.displayName input,\n.password input,\n.mailAddress input {\n width: 100%;\n height: 44px!important;\n\tborder: 2px solid var(--color-border-dark);\n}\n"],sourceRoot:""}]);const o=r},79600:(e,t,s)=>{s.d(t,{Z:()=>o});var a=s(87537),i=s.n(a),n=s(23645),r=s.n(n)()(i());r.push([e.id,".cellText{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-more{background-color:var(--color-main-background);border:0}.row .name{padding-left:0px !important}","",{version:3,sources:["webpack://./apps/settings/src/components/UserList/UserRowSimple.vue"],names:[],mappings:"AACC,UACC,eAAA,CACA,sBAAA,CACA,kBAAA,CAED,WACC,6CAAA,CACA,QAAA,CAED,WACC,2BAAA",sourcesContent:["\n\t.cellText {\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n}\n\t.icon-more {\n\t\tbackground-color: var(--color-main-background);\n\t\tborder: 0;\n\t}\n\t.row .name {\n\t\tpadding-left: 0px!important;\n\t}\n"],sourceRoot:""}]);const o=r},40551:(e,t,s)=>{s.d(t,{Z:()=>o});var a=s(87537),i=s.n(a),n=s(23645),r=s.n(n)()(i());r.push([e.id,".app-navigation__list #addgroup[data-v-76897a76] .app-navigation-entry__utils{display:none}","",{version:3,sources:["webpack://./apps/settings/src/views/Users.vue"],names:[],mappings:"AAEA,8EACC,YAAA",sourcesContent:["\n// force hiding the editing action for the add group entry\n.app-navigation__list #addgroup::v-deep .app-navigation-entry__utils {\n\tdisplay: none;\n}\n"],sourceRoot:""}]);const o=r},3685:(e,s,a)=>{a.r(s),a.d(s,{default:()=>xe});var i=a(69680),n=a.n(i),r=a(55209),o=a.n(r),l=a(88696),d=a.n(l),u=a(53110),c=a.n(u),g=a(14032),p=a.n(g),h=a(73190),m=a.n(h),v=a(93041),w=a.n(v),f=a(4820),A=a(27472),b=a.n(A),_=a(79753),C=a(98266),y=a.n(C),U=a(20144),k=a(87369),N=a.n(k),M=a(79570),L=a.n(M),G=a(45400),x=a.n(G),S=a(97039),$=a.n(S);const q={name:"GroupListItem",components:{NcActionInput:L(),NcActionButton:x(),NcCounterBubble:$(),NcAppNavigationItem:p()},props:{id:{type:String,required:!0},title:{type:String,required:!0},count:{type:Number,required:!1}},data:()=>({loadingRenameGroup:!1,openGroupMenu:!1}),computed:{settings(){return this.$store.getters.getServerData}},methods:{handleGroupMenuOpen(){this.openGroupMenu=!0},async renameGroup(e){if(""===e.trim())return;const t=this.$refs.displayNameInput.$el.querySelector('input[type="text"]').value;if(""!==t.trim())try{this.openGroupMenu=!1,this.loadingRenameGroup=!0,await this.$store.dispatch("renameGroup",{groupid:e.trim(),displayName:t.trim()}),this.loadingRenameGroup=!1}catch{this.openGroupMenu=!0,this.loadingRenameGroup=!1}},removeGroup(e){const 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)}))}}};var D=a(51900);const O=(0,D.Z)(q,(function(){var e=this,t=e._self._c;return t("NcAppNavigationItem",{key:e.id,attrs:{exact:!0,title:e.title,to:{name:"group",params:{selectedGroup:encodeURIComponent(e.id)}},icon:"icon-group",loading:e.loadingRenameGroup,"menu-open":e.openGroupMenu},on:{"update:menuOpen":e.handleGroupMenuOpen},scopedSlots:e._u([{key:"counter",fn:function(){return[e.count?t("NcCounterBubble",[e._v("\n\t\t\t"+e._s(e.count)+"\n\t\t")]):e._e()]},proxy:!0},{key:"actions",fn:function(){return["admin"!==e.id&&"disabled"!==e.id&&e.settings.isAdmin?t("NcActionInput",{ref:"displayNameInput",attrs:{icon:"icon-edit",type:"text",value:e.title},on:{submit:function(t){return e.renameGroup(e.id)}}},[e._v("\n\t\t\t"+e._s(e.t("settings","Rename group"))+"\n\t\t")]):e._e(),e._v(" "),"admin"!==e.id&&"disabled"!==e.id&&e.settings.isAdmin?t("NcActionButton",{attrs:{icon:"icon-delete"},on:{click:function(t){return e.removeGroup(e.id)}}},[e._v("\n\t\t\t"+e._s(e.t("settings","Remove group"))+"\n\t\t")]):e._e()]},proxy:!0}])})}),[],!1,null,null,null).exports;var P=a(78595),B=a(30306),Q=a.n(B),z=a(70110),E=a.n(z),R=a(10861),I=a.n(R),T=a(2649),F=a.n(T),Z=a(15961),j=a(32996),W=a.n(j),Y=a(12945),H=a.n(Y),V=a(45994);const J={props:{user:{type:Object,required:!0},settings:{type:Object,default:()=>({})},groups:{type:Array,default:()=>[]},subAdminsGroups:{type:Array,default:()=>[]},quotaOptions:{type:Array,default:()=>[]},showConfig:{type:Object,default:()=>({})},languages:{type:Array,required:!0},externalActions:{type:Array,default:()=>[]}},computed:{userGroups(){return this.groups.filter((e=>this.user.groups.includes(e.id)))},userSubAdminsGroups(){return this.subAdminsGroups.filter((e=>this.user.subadmin.includes(e.id)))},availableGroups(){return this.groups.map((e=>{const t=Object.assign({},e);return t.$isDisabled=!1===e.canAdd&&!this.user.groups.includes(e.id)||!1===e.canRemove&&this.user.groups.includes(e.id),t}))},usedSpace(){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(){let e=this.user.quota.quota;return e=e>0?Math.min(100,Math.round(this.user.quota.used/e*100)):95*(1-1/(this.user.quota.used/(10*Math.pow(2,30))+1)),isNaN(e)?0:e},userQuota(){if(this.user.quota.quota>=0){const e=OC.Util.humanFileSize(this.user.quota.quota);return this.quotaOptions.find((t=>t.id===e))||{id:e,label:e}}return"default"===this.user.quota.quota?this.quotaOptions[0]:this.quotaOptions[1]},minPasswordLength(){return this.$store.getters.getPasswordPolicyMinLength},userLanguage(){const e=this.languages[0].languages.concat(this.languages[1].languages).find((e=>e.code===this.user.language));return"object"!=typeof e&&""!==this.user.language?{code:this.user.language,name:this.user.language}:""!==this.user.language&&e},userLastLoginTooltip(){return this.user.lastLogin>0?OC.Util.formatDate(this.user.lastLogin):""},userLastLogin(){return this.user.lastLogin>0?OC.Util.relativeModifiedDate(this.user.lastLogin):t("settings","Never")}},methods:{generateAvatar:(e,t)=>t?(0,_.generateUrl)("/avatar/{user}/64/dark?v={version}",{user:e,version:oc_userconfig.avatar.version}):(0,_.generateUrl)("/avatar/{user}/64?v={version}",{user:e,version:oc_userconfig.avatar.version})}},K={name:"UserRowSimple",components:{NcPopoverMenu:W(),NcActionButton:x(),NcActions:H()},directives:{ClickOutside:F()},mixins:[J],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},isDarkTheme:{type:Boolean,required:!0}},computed:{userGroupsLabels(){return this.userGroups.map((e=>e.name)).join(", ")},userSubAdminsGroupsLabels(){return this.userSubAdminsGroups.map((e=>e.name)).join(", ")},usedSpace(){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(){return(0,V.ts)().uid!==this.user.id||this.settings.isAdmin},userQuota(){let e=this.user.quota.quota;return"default"===e&&(e=this.settings.defaultQuota,"none"!==e&&(e=OC.Util.computerFileSize(e))),"none"===e||-3===e?t("settings","Unlimited"):e>=0?OC.Util.humanFileSize(e):OC.Util.humanFileSize(0)}},methods:{toggleMenu(){this.$emit("update:openedMenu",!this.openedMenu)},hideMenu(){this.$emit("update:openedMenu",!1)},toggleEdit(){this.$emit("update:editing",!0)}}};var X=a(93379),ee=a.n(X),te=a(7795),se=a.n(te),ae=a(90569),ie=a.n(ae),ne=a(3565),re=a.n(ne),oe=a(19216),le=a.n(oe),de=a(44589),ue=a.n(de),ce=a(79600),ge={};ge.styleTagTransform=ue(),ge.setAttributes=re(),ge.insert=ie().bind(null,"head"),ge.domAPI=se(),ge.insertStyleElement=le(),ee()(ce.Z,ge),ce.Z&&ce.Z.locals&&ce.Z.locals;const pe=(0,D.Z)(K,(function(){var e=this,t=e._self._c;return t("tr",{staticClass:"row",class:{disabled:e.loading.delete||e.loading.disable},attrs:{"data-id":e.user.id}},[t("td",{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():t("img",{attrs:{alt:"",width:"32",height:"32",src:e.generateAvatar(e.user.id,e.isDarkTheme)}})]),e._v(" "),t("td",{staticClass:"name"},[t("div",{staticClass:"displayName subtitle"},[t("div",{staticClass:"cellText",attrs:{title:e.user.displayname.length>20?e.user.displayname:""}},[t("strong",[e._v("\n\t\t\t\t\t"+e._s(e.user.displayname)+"\n\t\t\t\t")])])]),e._v("\n\t\t"+e._s(e.user.id)+"\n\t")]),e._v(" "),t("td"),e._v(" "),t("td",{staticClass:"mailAddress"},[t("div",{staticClass:"cellText",attrs:{title:null!==e.user.email&&e.user.email.length>20?e.user.email:""}},[e._v("\n\t\t\t"+e._s(e.user.email)+"\n\t\t")])]),e._v(" "),t("td",{staticClass:"groups"},[e._v("\n\t\t"+e._s(e.userGroupsLabels)+"\n\t")]),e._v(" "),e.subAdminsGroups.length>0&&e.settings.isAdmin?t("td",{staticClass:"subAdminsGroups"},[e._v("\n\t\t"+e._s(e.userSubAdminsGroupsLabels)+"\n\t")]):e._e(),e._v(" "),t("td",{staticClass:"userQuota"},[t("div",{staticClass:"quota"},[e._v("\n\t\t\t"+e._s(e.userQuota)+" ("+e._s(e.usedSpace)+")\n\t\t\t"),t("progress",{staticClass:"quota-user-progress",class:{warn:e.usedQuota>80},attrs:{max:"100"},domProps:{value:e.usedQuota}})])]),e._v(" "),e.showConfig.showLanguages?t("td",{staticClass:"languages"},[e._v("\n\t\t"+e._s(e.userLanguage.name)+"\n\t")]):e._e(),e._v(" "),e.showConfig.showUserBackend||e.showConfig.showStoragePath?t("td",{staticClass:"userBackend"},[e.showConfig.showUserBackend?t("div",{staticClass:"userBackend"},[e._v("\n\t\t\t"+e._s(e.user.backend)+"\n\t\t")]):e._e(),e._v(" "),e.showConfig.showStoragePath?t("div",{staticClass:"storageLocation subtitle",attrs:{title:e.user.storageLocation}},[e._v("\n\t\t\t"+e._s(e.user.storageLocation)+"\n\t\t")]):e._e()]):e._e(),e._v(" "),e.showConfig.showLastLogin?t("td",{staticClass:"lastLogin",attrs:{title:e.userLastLoginTooltip}},[e._v("\n\t\t"+e._s(e.userLastLogin)+"\n\t")]):e._e(),e._v(" "),t("td",{staticClass:"managers"},[e._v("\n\t\t"+e._s(e.user.manager)+"\n\t")]),e._v(" "),t("td",{staticClass:"userActions"},[e.canEdit&&!e.loading.all?t("div",{staticClass:"toggleUserActions"},[t("NcActions",[t("NcActionButton",{attrs:{icon:"icon-rename",title:e.t("settings","Edit User"),"aria-label":e.t("settings","Edit User")},on:{click:e.toggleEdit}})],1),e._v(" "),t("div",{staticClass:"userPopoverMenuWrapper"},[t("button",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.hideMenu,expression:"hideMenu"}],staticClass:"icon-more",attrs:{"aria-label":e.t("settings","Toggle user actions menu")},on:{click:function(t){return t.preventDefault(),e.toggleMenu.apply(null,arguments)}}}),e._v(" "),t("div",{staticClass:"popovermenu",class:{open:e.openedMenu},attrs:{"aria-expanded":e.openedMenu}},[t("NcPopoverMenu",{attrs:{menu:e.userActions}})],1)])],1):e._e(),e._v(" "),t("div",{staticClass:"feedback",style:{opacity:""!==e.feedbackMessage?1:0}},[t("div",{staticClass:"icon-checkmark"}),e._v("\n\t\t\t"+e._s(e.feedbackMessage)+"\n\t\t")])])])}),[],!1,null,null,null).exports;var he=a(25108);const me={name:"UserRow",components:{UserRowSimple:pe,NcPopoverMenu:Z.Rs,NcActions:Z.O3,NcActionButton:Z.Js,NcMultiselect:Z.Z2},directives:{ClickOutside:F()},mixins:[J],props:{users:{type:Array,required:!0},user:{type:Object,required:!0},settings:{type:Object,default:()=>({})},groups:{type:Array,default:()=>[]},subAdminsGroups:{type:Array,default:()=>[]},quotaOptions:{type:Array,default:()=>[]},showConfig:{type:Object,default:()=>({})},languages:{type:Array,required:!0},externalActions:{type:Array,default:()=>[]},isDarkTheme:{type:Boolean,required:!0}},data:()=>({rand:parseInt(1e3*Math.random()),openedMenu:!1,feedbackMessage:"",possibleManagers:[],currentManager:"",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,manager:!1}}),computed:{userActions(){const 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)}},async beforeMount(){await this.searchUserManager(),this.user.manager&&await this.initManager(this.user.manager)},methods:{toggleMenu(){this.openedMenu=!this.openedMenu},hideMenu(){this.openedMenu=!1},wipeUserDevices(){const e=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:e}),t("settings","Remote wipe of devices"),{type:OC.dialogs.YES_NO_BUTTONS,confirm:t("settings","Wipe {userid}'s devices",{userid:e}),confirmClasses:"error",cancel:t("settings","Cancel")},(t=>{t&&(this.loading.wipe=!0,this.loading.all=!0,this.$store.dispatch("wipeUserDevices",e).then((()=>{this.loading.wipe=!1,this.loading.all=!1})))}),!0)},filterManagers(e){return e.filter((e=>e.id!==this.user.id))},async initManager(e){await this.$store.dispatch("getUser",e).then((e=>{this.currentManager=null==e?void 0:e.data.ocs.data}))},async searchUserManager(e){await this.$store.dispatch("searchUsers",{offset:0,limit:10,search:e}).then((e=>{const t=null!=e&&e.data?this.filterManagers(Object.values(null==e?void 0:e.data.ocs.data.users)):[];t.length>0&&(this.possibleManagers=t)}))},updateUserManager(e){this.loading.manager=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"manager",value:this.currentManager?this.currentManager.id:""}).then((()=>{this.loading.manager=!1}))},deleteUser(){const e=this.user.id;OC.dialogs.confirmDestructive(t("settings","Fully delete {userid}'s account including all their personal files, app data, etc.",{userid:e}),t("settings","Account deletion"),{type:OC.dialogs.YES_NO_BUTTONS,confirm:t("settings","Delete {userid}'s account",{userid:e}),confirmClasses:"error",cancel:t("settings","Cancel")},(t=>{if(t)return this.loading.delete=!0,this.loading.all=!0,this.$store.dispatch("deleteUser",e).then((()=>{this.loading.delete=!1,this.loading.all=!1}))}),!0)},enableDisableUser(){this.loading.delete=!0,this.loading.all=!0;const e=this.user.id,t=!this.user.enabled;return this.$store.dispatch("enableDisableUser",{userid:e,enabled:t}).then((()=>{this.loading.delete=!1,this.loading.all=!1}))},updateDisplayName(){const e=this.$refs.displayName.value;this.loading.displayName=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"displayname",value:e}).then((()=>{this.loading.displayName=!1,this.$refs.displayName.value=e}))},updatePassword(){const e=this.$refs.password.value;this.loading.password=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"password",value:e}).then((()=>{this.loading.password=!1,this.$refs.password.value=""}))},updateEmail(){const e=this.$refs.mailAddress.value;this.loading.mailAddress=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"email",value:e}).then((()=>{this.loading.mailAddress=!1,this.$refs.mailAddress.value=e}))},async createGroup(e){this.loading={groups:!0,subadmins:!0};try{await this.$store.dispatch("addGroup",e);const t=this.user.id;await this.$store.dispatch("addUserGroup",{userid:t,gid:e})}catch(e){he.error(e)}finally{this.loading={groups:!1,subadmins:!1}}return this.$store.getters.getGroups[this.groups.length]},async addUserGroup(e){if(!1===e.canAdd)return!1;this.loading.groups=!0;const t=this.user.id,s=e.id;try{await this.$store.dispatch("addUserGroup",{userid:t,gid:s})}catch(e){he.error(e)}finally{this.loading.groups=!1}},async removeUserGroup(e){if(!1===e.canRemove)return!1;this.loading.groups=!0;const t=this.user.id,s=e.id;try{await this.$store.dispatch("removeUserGroup",{userid:t,gid:s}),this.loading.groups=!1,this.$route.params.selectedGroup===s&&this.$store.commit("deleteUser",t)}catch{this.loading.groups=!1}},async addUserSubAdmin(e){this.loading.subadmins=!0;const t=this.user.id,s=e.id;try{await this.$store.dispatch("addUserSubAdmin",{userid:t,gid:s}),this.loading.subadmins=!1}catch(e){he.error(e)}},async removeUserSubAdmin(e){this.loading.subadmins=!0;const t=this.user.id,s=e.id;try{await this.$store.dispatch("removeUserSubAdmin",{userid:t,gid:s})}catch(e){he.error(e)}finally{this.loading.subadmins=!1}},async setUserQuota(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";this.loading.quota=!0,e=e.id?e.id:e;try{await this.$store.dispatch("setUserData",{userid:this.user.id,key:"quota",value:e})}catch(e){he.error(e)}finally{this.loading.quota=!1}return e},validateQuota(e){const t=OC.Util.computerFileSize(e);return null!==t&&t>=0&&this.setUserQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(e)))},async setUserLanguage(e){this.loading.languages=!0;try{await this.$store.dispatch("setUserData",{userid:this.user.id,key:"language",value:e.code})}catch(e){he.error(e)}finally{this.loading.languages=!1}return e},sendWelcomeMail(){this.loading.all=!0,this.$store.dispatch("sendWelcomeMail",this.user.id).then((e=>{e&&(this.feedbackMessage=t("setting","Welcome mail sent!"),setTimeout((()=>{this.feedbackMessage=""}),2e3)),this.loading.all=!1}))}}};var ve=a(91491),we={};we.styleTagTransform=ue(),we.setAttributes=re(),we.insert=ie().bind(null,"head"),we.domAPI=se(),we.insertStyleElement=le(),ee()(ve.Z,we),ve.Z&&ve.Z.locals&&ve.Z.locals;const fe=(0,D.Z)(me,(function(){var e=this,t=e._self._c;return 1===Object.keys(e.user).length?t("div",{staticClass:"row",attrs:{"data-id":e.user.id}},[t("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():t("img",{attrs:{src:e.generateAvatar(e.user.id,e.isDarkTheme),alt:"",height:"32",width:"32"}})]),e._v(" "),t("div",{staticClass:"name"},[e._v("\n\t\t"+e._s(e.user.id)+"\n\t")]),e._v(" "),t("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?t("tr",{staticClass:"row row--editable",class:{disabled:e.loading.delete||e.loading.disable,"row--menu-opened":e.openedMenu},attrs:{"data-id":e.user.id}},[t("td",{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():t("img",{attrs:{src:e.generateAvatar(e.user.id,e.isDarkTheme),alt:"",height:"32",width:"32"}})]),e._v(" "),e.user.backendCapabilities.setDisplayName?t("td",{staticClass:"displayName"},[t("form",{staticClass:"displayName",class:{"icon-loading-small":e.loading.displayName},on:{submit:function(t){return t.preventDefault(),e.updateDisplayName.apply(null,arguments)}}},[t("label",{staticClass:"hidden-visually",attrs:{for:"displayName"+e.user.id+e.rand}},[e._v(e._s(e.t("settings","Edit display name")))]),e._v(" "),t("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(" "),t("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})])]):t("td",{staticClass:"name"},[e._v("\n\t\t"+e._s(e.user.id)+"\n\t\t"),t("div",{staticClass:"displayName subtitle"},[t("div",{staticClass:"cellText",attrs:{title:e.user.displayname.length>20?e.user.displayname:""}},[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?t("td",[t("form",{staticClass:"password",class:{"icon-loading-small":e.loading.password},on:{submit:function(t){return t.preventDefault(),e.updatePassword.apply(null,arguments)}}},[t("label",{staticClass:"hidden-visually",attrs:{for:"password"+e.user.id+e.rand}},[e._v(e._s(e.t("settings","Add new password")))]),e._v(" "),t("input",{ref:"password",attrs:{id:"password"+e.user.id+e.rand,disabled:e.loading.password||e.loading.all,minlength:e.minPasswordLength,maxlength:"469",placeholder:e.t("settings","Add new password"),autocapitalize:"off",autocomplete:"new-password",autocorrect:"off",required:"",spellcheck:"false",type:"password",value:""}}),e._v(" "),t("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})])]):t("td"),e._v(" "),t("td",[t("form",{staticClass:"mailAddress",class:{"icon-loading-small":e.loading.mailAddress},on:{submit:function(t){return t.preventDefault(),e.updateEmail.apply(null,arguments)}}},[t("label",{staticClass:"hidden-visually",attrs:{for:"mailAddress"+e.user.id+e.rand}},[e._v(e._s(e.t("settings","Add new email address")))]),e._v(" "),t("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(" "),t("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})])]),e._v(" "),t("td",{staticClass:"groups",class:{"icon-loading-small":e.loading.groups}},[t("label",{staticClass:"hidden-visually",attrs:{for:"groups"+e.user.id+e.rand}},[e._v(e._s(e.t("settings","Add user to group")))]),e._v(" "),t("NcMultiselect",{staticClass:"multiselect-vue",attrs:{id:"groups"+e.user.id+e.rand,"close-on-select":!1,disabled:e.loading.groups||e.loading.all,limit:2,multiple:!0,options:e.availableGroups,placeholder:e.t("settings","Add user to 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}},[t("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?t("td",{staticClass:"subadmins",class:{"icon-loading-small":e.loading.subadmins}},[t("label",{staticClass:"hidden-visually",attrs:{for:"subadmins"+e.user.id+e.rand}},[e._v(e._s(e.t("settings","Set user as admin for")))]),e._v(" "),t("NcMultiselect",{staticClass:"multiselect-vue",attrs:{id:"subadmins"+e.user.id+e.rand,"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}},[t("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v(e._s(e.t("settings","No results")))])])],1):e._e(),e._v(" "),t("td",{staticClass:"quota",class:{"icon-loading-small":e.loading.quota},attrs:{title:e.usedSpace}},[t("label",{staticClass:"hidden-visually",attrs:{for:"quota"+e.user.id+e.rand}},[e._v(e._s(e.t("settings","Select user quota")))]),e._v(" "),t("NcMultiselect",{staticClass:"multiselect-vue",attrs:{id:"quota"+e.user.id+e.rand,"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?t("td",{staticClass:"languages",class:{"icon-loading-small":e.loading.languages}},[t("label",{staticClass:"hidden-visually",attrs:{for:"language"+e.user.id+e.rand}},[e._v(e._s(e.t("settings","Set the language")))]),e._v(" "),t("NcMultiselect",{staticClass:"multiselect-vue",attrs:{id:"language"+e.user.id+e.rand,"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(" "),t("td",{staticClass:"managers",class:{"icon-loading-small":e.loading.manager}},[t("NcMultiselect",{ref:"manager",staticClass:"multiselect-vue",attrs:{"close-on-select":!0,"user-select":!0,options:e.possibleManagers,placeholder:e.t("settings","Select manager"),label:"displayname","track-by":"id"},on:{"search-change":e.searchUserManager,remove:e.updateUserManager,select:e.updateUserManager},model:{value:e.currentManager,callback:function(t){e.currentManager=t},expression:"currentManager"}},[t("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v(e._s(e.t("settings","No results")))])])],1),e._v(" "),e.showConfig.showStoragePath||e.showConfig.showUserBackend?t("td",{staticClass:"storageLocation"}):e._e(),e._v(" "),e.showConfig.showLastLogin?t("td"):e._e(),e._v(" "),t("td",{staticClass:"userActions"},[e.loading.all?e._e():t("div",{staticClass:"toggleUserActions"},[t("NcActions",[t("NcActionButton",{attrs:{icon:"icon-checkmark",title:e.t("settings","Done"),"aria-label":e.t("settings","Done")},on:{click:function(t){e.editing=!1}}})],1),e._v(" "),t("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.hideMenu,expression:"hideMenu"}],staticClass:"userPopoverMenuWrapper"},[t("button",{staticClass:"icon-more",on:{click:function(t){return t.preventDefault(),e.toggleMenu.apply(null,arguments)}}}),e._v(" "),t("div",{staticClass:"popovermenu",class:{open:e.openedMenu}},[t("NcPopoverMenu",{attrs:{menu:e.userActions}})],1)])],1),e._v(" "),t("div",{staticClass:"feedback",style:{opacity:""!==e.feedbackMessage?1:0}},[t("div",{staticClass:"icon-checkmark"}),e._v("\n\t\t\t"+e._s(e.feedbackMessage)+"\n\t\t")])])]):t("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,"is-dark-theme":e.isDarkTheme},on:{"update:editing":function(t){e.editing=t},"update:openedMenu":function(t){e.openedMenu=t},"update:opened-menu":function(t){e.openedMenu=t}}})}),[],!1,null,"8360d33a",null).exports,Ae={id:"none",label:t("settings","Unlimited")},be={id:"default",label:t("settings","Default quota")},_e={id:"",displayName:"",password:"",mailAddress:"",groups:[],manager:"",subAdminsGroups:[],quota:be,language:{code:"en",name:t("settings","Default language")}},Ce={name:"UserList",components:{NcModal:E(),userRow:fe,NcMultiselect:y(),InfiniteLoading:Q(),NcButton:I()},props:{users:{type:Array,default:()=>[]},showConfig:{type:Object,required:!0},selectedGroup:{type:String,default:null},externalActions:{type:Array,default:()=>[]}},data:()=>({unlimitedQuota:Ae,defaultQuota:be,loading:{all:!1,groups:!1},scrolled:!1,possibleManagers:[],searchQuery:"",newUser:Object.assign({},_e)}),computed:{settings(){return this.$store.getters.getServerData},selectedGroupDecoded(){return decodeURIComponent(this.selectedGroup)},filteredUsers(){return"disabled"===this.selectedGroup?this.users.filter((e=>!1===e.enabled)):(this.settings.isAdmin,this.users.filter((e=>!1!==e.enabled)))},groups(){return this.$store.getters.getGroups.filter((e=>"disabled"!==e.id)).sort(((e,t)=>e.name.localeCompare(t.name)))},canAddGroups(){return this.groups.map((e=>((e=Object.assign({},e)).$isDisabled=!1===e.canAdd,e)))},subAdminsGroups(){return this.$store.getters.getSubadminGroups},quotaOptions(){const e=this.settings.quotaPreset.reduce(((e,t)=>e.concat({id:t,label:t})),[]);return this.settings.allowUnlimitedQuota&&e.unshift(this.unlimitedQuota),e.unshift(this.defaultQuota),e},minPasswordLength(){return this.$store.getters.getPasswordPolicyMinLength},usersOffset(){return this.$store.getters.getUsersOffset},usersLimit(){return this.$store.getters.getUsersLimit},usersCount(){return this.users.length},languages(){return[{label:t("settings","Common languages"),languages:this.settings.languages.commonLanguages},{label:t("settings","Other languages"),languages:this.settings.languages.otherLanguages}]},isDarkTheme(){return"invert(100%)"===window.getComputedStyle(this.$el).getPropertyValue("--background-invert-if-dark")}},watch:{selectedGroup(e,t){this.redirectIfDisabled(),this.$store.commit("resetUsers"),this.$refs.infiniteLoading.stateChanger.reset(),this.setNewUserDefaultGroup(e)},usersCount(e,t){0===e&&1===t?this.$refs.infiniteLoading.stateChanger.reset():1===e&&0===t&&this.$refs.infiniteLoading.stateChanger.loaded()}},async beforeMount(){await this.searchUserManager()},mounted(){this.settings.canChangePassword||OC.Notification.showTemporary(t("settings","Password change is disabled because the master key is disabled")),this.resetForm(),(0,P.Ld)("nextcloud:unified-search.search",this.search),(0,P.Ld)("nextcloud:unified-search.reset",this.resetSearch),this.redirectIfDisabled()},beforeDestroy(){(0,P.r1)("nextcloud:unified-search.search",this.search),(0,P.r1)("nextcloud:unified-search.reset",this.resetSearch)},methods:{async searchUserManager(e){await this.$store.dispatch("searchUsers",{offset:0,limit:10,search:e}).then((e=>{const t=null!=e&&e.data?Object.values(null==e?void 0:e.data.ocs.data.users):[];t.length>0&&(this.possibleManagers=t)}))},onScroll(e){this.scrolled=e.target.scrollTo>0},validateQuota(e){const 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(e){this.$store.dispatch("getUsers",{offset:this.usersOffset,limit:this.usersLimit,group:"disabled"!==this.selectedGroup?this.selectedGroup:"",search:this.searchQuery}).then((t=>{t>0&&e.loaded(),t<this.usersLimit&&e.complete()}))},search(e){let{query:t}=e;this.searchQuery=t,this.$store.commit("resetUsers"),this.$refs.infiniteLoading.stateChanger.reset()},resetSearch(){this.search({query:""})},resetForm(){this.newUser=Object.assign({},_e),this.settings.defaultLanguage&&U.default.set(this.newUser.language,"code",this.settings.defaultLanguage),this.setNewUserDefaultGroup(this.selectedGroup),this.loading.all=!1},createUser(){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((e=>e.id)),subadmin:this.newUser.subAdminsGroups.map((e=>e.id)),quota:this.newUser.quota.id,language:this.newUser.language.code,manager:this.newUser.manager.id}).then((()=>{this.resetForm(),this.$refs.newusername.focus(),this.closeModal()})).catch((e=>{if(this.loading.all=!1,e.response&&e.response.data&&e.response.data.ocs&&e.response.data.ocs.meta){const t=e.response.data.ocs.meta.statuscode;102===t?this.$refs.newusername.focus():107===t&&this.$refs.newuserpassword.focus()}}))},setNewUserDefaultGroup(e){if(e&&e.length>0){const t=this.groups.find((t=>t.id===e));if(t)return void(this.newUser.groups=[t])}this.newUser.groups=[]},createGroup(e){return this.loading.groups=!0,this.$store.dispatch("addGroup",e).then((t=>{this.newUser.groups.push(this.groups.find((t=>t.id===e))),this.loading.groups=!1})).catch((()=>{this.loading.groups=!1})),this.$store.getters.getGroups[this.groups.length]},redirectIfDisabled(){const e=this.$store.getters.getGroups;"disabled"===this.selectedGroup&&e.findIndex((e=>"disabled"===e.id&&0===e.usercount))>-1&&(this.$router.push({name:"users"}),this.$refs.infiniteLoading.stateChanger.reset())},closeModal(){this.showConfig.showNewUserForm=!1}}};var ye=a(47671),Ue={};Ue.styleTagTransform=ue(),Ue.setAttributes=re(),Ue.insert=ie().bind(null,"head"),Ue.domAPI=se(),Ue.insertStyleElement=le(),ee()(ye.Z,Ue),ye.Z&&ye.Z.locals&&ye.Z.locals;const ke=(0,D.Z)(Ce,(function(){var e=this,t=e._self._c;return t("table",{staticClass:"user-list-grid",attrs:{id:"app-content",role:"grid","aria-label":e.t("settings","User's table")},on:{"&scroll":function(t){return e.onScroll.apply(null,arguments)}}},[e.showConfig.showNewUserForm?t("NcModal",{attrs:{size:"small"},on:{close:e.closeModal}},[t("form",{staticClass:"modal__content",attrs:{id:"new-user",disabled:e.loading.all},on:{submit:function(t){return t.preventDefault(),e.createUser.apply(null,arguments)}}},[t("h2",[e._v(e._s(e.t("settings","New user")))]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.newUser.id,expression:"newUser.id"}],ref:"newusername",staticClass:"modal__item",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(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.newUser.displayName,expression:"newUser.displayName"}],staticClass:"modal__item",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(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.newUser.password,expression:"newUser.password"}],ref:"newuserpassword",staticClass:"modal__item",attrs:{id:"newuserpassword",minlength:e.minPasswordLength,maxlength:469,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(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.newUser.mailAddress,expression:"newUser.mailAddress"}],staticClass:"modal__item",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(" "),t("div",{staticClass:"groups modal__item"},[e.settings.isAdmin?e._e():t("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(" "),t("NcMultiselect",{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 to 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"}},[t("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?t("div",{staticClass:"subadmins modal__item"},[t("NcMultiselect",{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"}},[t("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v(e._s(e.t("settings","No results")))])])],1):e._e(),e._v(" "),t("div",{staticClass:"quota modal__item"},[t("NcMultiselect",{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?t("div",{staticClass:"languages modal__item"},[t("NcMultiselect",{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?t("div",{staticClass:"storageLocation"}):e._e(),e._v(" "),e.showConfig.showUserBackend?t("div",{staticClass:"userBackend"}):e._e(),e._v(" "),e.showConfig.showLastLogin?t("div",{staticClass:"lastLogin"}):e._e(),e._v(" "),t("div",{staticClass:"modal__item managers",class:{"icon-loading-small":e.loading.manager}},[t("NcMultiselect",{ref:"manager",staticClass:"multiselect-vue",attrs:{"close-on-select":!0,"user-select":!0,options:e.possibleManagers,placeholder:e.t("settings","Select user manager"),label:"displayname","track-by":"id"},on:{"search-change":e.searchUserManager},model:{value:e.newUser.manager,callback:function(t){e.$set(e.newUser,"manager",t)},expression:"newUser.manager"}},[t("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v(e._s(e.t("settings","No results")))])])],1),e._v(" "),t("div",{staticClass:"user-actions"},[t("NcButton",{attrs:{id:"newsubmit",type:"primary","native-type":"submit",value:""}},[e._v("\n\t\t\t\t\t"+e._s(e.t("settings","Add a new user"))+"\n\t\t\t\t")])],1)])]):e._e(),e._v(" "),t("tbody",[t("tr",{staticClass:"row",class:{sticky:e.scrolled&&!e.showConfig.showNewUserForm},attrs:{id:"grid-header"}},[t("th",{staticClass:"avatar",attrs:{id:"headerAvatar"}},[t("span",{staticClass:"hidden-visually"},[e._v(" "+e._s(e.t("settings","Avatar"))+" ")])]),e._v(" "),t("th",{staticClass:"name",attrs:{id:"headerName"}},[t("div",{staticClass:"subtitle"},[t("strong",[e._v("\n\t\t\t\t\t\t"+e._s(e.t("settings","Display name"))+"\n\t\t\t\t\t")])]),e._v("\n\t\t\t\t"+e._s(e.t("settings","Username"))+"\n\t\t\t")]),e._v(" "),t("th",{staticClass:"password",attrs:{id:"headerPassword"}},[e._v("\n\t\t\t\t"+e._s(e.t("settings","Password"))+"\n\t\t\t")]),e._v(" "),t("th",{staticClass:"mailAddress",attrs:{id:"headerAddress"}},[e._v("\n\t\t\t\t"+e._s(e.t("settings","Email"))+"\n\t\t\t")]),e._v(" "),t("th",{staticClass:"groups",attrs:{id:"headerGroups"}},[e._v("\n\t\t\t\t"+e._s(e.t("settings","Groups"))+"\n\t\t\t")]),e._v(" "),e.subAdminsGroups.length>0&&e.settings.isAdmin?t("th",{staticClass:"subadmins",attrs:{id:"headerSubAdmins"}},[e._v("\n\t\t\t\t"+e._s(e.t("settings","Group admin for"))+"\n\t\t\t")]):e._e(),e._v(" "),t("th",{staticClass:"quota",attrs:{id:"headerQuota"}},[e._v("\n\t\t\t\t"+e._s(e.t("settings","Quota"))+"\n\t\t\t")]),e._v(" "),e.showConfig.showLanguages?t("th",{staticClass:"languages",attrs:{id:"headerLanguages"}},[e._v("\n\t\t\t\t"+e._s(e.t("settings","Language"))+"\n\t\t\t")]):e._e(),e._v(" "),e.showConfig.showUserBackend||e.showConfig.showStoragePath?t("th",{staticClass:"headerUserBackend userBackend"},[e.showConfig.showUserBackend?t("div",{staticClass:"userBackend"},[e._v("\n\t\t\t\t\t"+e._s(e.t("settings","User backend"))+"\n\t\t\t\t")]):e._e(),e._v(" "),e.showConfig.showStoragePath?t("div",{staticClass:"subtitle storageLocation"},[e._v("\n\t\t\t\t\t"+e._s(e.t("settings","Storage location"))+"\n\t\t\t\t")]):e._e()]):e._e(),e._v(" "),e.showConfig.showLastLogin?t("th",{staticClass:"headerLastLogin lastLogin"},[e._v("\n\t\t\t\t"+e._s(e.t("settings","Last login"))+"\n\t\t\t")]):e._e(),e._v(" "),t("th",{staticClass:"manager",attrs:{id:"headerManager"}},[e._v("\n\t\t\t\t"+e._s(e.t("settings","Manager"))+"\n\t\t\t")]),e._v(" "),t("th",{staticClass:"userActions hidden-visually"},[e._v("\n\t\t\t\t"+e._s(e.t("settings","User actions"))+"\n\t\t\t")])]),e._v(" "),e._l(e.filteredUsers,(function(s){return t("user-row",{key:s.id,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:s,users:e.users,"is-dark-theme":e.isDarkTheme}})})),e._v(" "),t("InfiniteLoading",{ref:"infiniteLoading",on:{infinite:e.infiniteHandler}},[t("div",{attrs:{slot:"spinner"},slot:"spinner"},[t("div",{staticClass:"users-icon-loading icon-loading"})]),e._v(" "),t("div",{attrs:{slot:"no-more"},slot:"no-more"},[t("div",{staticClass:"users-list-end"})]),e._v(" "),t("div",{attrs:{slot:"no-results"},slot:"no-results"},[t("div",{attrs:{id:"emptycontent"}},[t("div",{staticClass:"icon-contacts-dark"}),e._v(" "),t("h2",[e._v(e._s(e.t("settings","No users in here")))])])])])],2)],1)}),[],!1,null,"a4fba162",null).exports;var Ne=a(25108);U.default.use(N());const Me={name:"Users",components:{NcAppContent:n(),NcAppNavigation:o(),NcAppNavigationCaption:d(),NcAppNavigationCounter:c(),NcAppNavigationItem:p(),NcAppNavigationNew:m(),NcAppNavigationSettings:w(),NcContent:b(),GroupListItem:O,NcMultiselect:y(),UserList:ke},props:{selectedGroup:{type:String,default:null}},data:()=>({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:{selectedGroupDecoded(){return this.selectedGroup?decodeURIComponent(this.selectedGroup):null},users(){return this.$store.getters.getUsers},groups(){return this.$store.getters.getGroups},usersOffset(){return this.$store.getters.getUsersOffset},usersLimit(){return this.$store.getters.getUsersLimit},showLanguages:{get(){return this.getLocalstorage("showLanguages")},set(e){this.setLocalStorage("showLanguages",e)}},showLastLogin:{get(){return this.getLocalstorage("showLastLogin")},set(e){this.setLocalStorage("showLastLogin",e)}},showUserBackend:{get(){return this.getLocalstorage("showUserBackend")},set(e){this.setLocalStorage("showUserBackend",e)}},showStoragePath:{get(){return this.getLocalstorage("showStoragePath")},set(e){this.setLocalStorage("showStoragePath",e)}},userCount(){return this.$store.getters.getUserCount},settings(){return this.$store.getters.getServerData},quotaOptions(){const e=this.settings.quotaPreset.reduce(((e,t)=>e.concat({id:t,label:t})),[]);return this.settings.allowUnlimitedQuota&&e.unshift(this.unlimitedQuota),e},defaultQuota:{get(){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(e){this.selectedQuota=e}},sendWelcomeMail:{get(){return this.settings.newUserSendEmail},async set(e){try{this.loadingSendMail=!0,this.$store.commit("setServerData",{...this.settings,newUserSendEmail:e}),await f.default.post((0,_.generateUrl)("/settings/users/preferences/newUser.sendEmail"),{value:e?"yes":"no"})}catch(e){Ne.error("could not update newUser.sendEmail preference: "+e.message,e)}finally{this.loadingSendMail=!1}}},groupList(){return(Array.isArray(this.groups)?this.groups:[]).filter((e=>"disabled"!==e.id&&"admin"!==e.id)).map((e=>this.formatGroupMenu(e)))},adminGroupMenu(){return this.formatGroupMenu(this.groups.find((e=>"admin"===e.id)))},disabledGroupMenu(){return this.formatGroupMenu(this.groups.find((e=>"disabled"===e.id)))}},beforeMount(){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(){Object.assign(OCA,{Settings:{UserList:{registerAction:this.registerAction}}})},methods:{showNewUserMenu(){this.showConfig.showNewUserForm=!0,this.showConfig.showNewUserForm&&U.default.nextTick((()=>{window.newusername.focus()}))},getLocalstorage(e){const t=this.$localStorage.get(e);return this.showConfig[e]=null!==t?"true"===t:this.showConfig[e],this.showConfig[e]},setLocalStorage(e,t){return this.showConfig[e]=t,this.$localStorage.set(e,t),t},setDefaultQuota(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";this.$store.dispatch("setAppConfig",{app:"files",key:"default_quota",value:e.id?e.id:e}).then((()=>{"object"!=typeof e&&(e={id:e,label:e}),this.defaultQuota=e}))},validateQuota(e){return null===OC.Util.computerFileSize(e)?this.setDefaultQuota("none"):this.setDefaultQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(e)))},registerAction(e,t,s){return this.externalActions.push({icon:e,text:t,action:s}),this.externalActions},async createGroup(e){if(""!==e.trim())try{this.loadingAddGroup=!0,await this.$store.dispatch("addGroup",e.trim()),this.hideAddGroupForm(),await this.$router.push({name:"group",params:{selectedGroup:encodeURIComponent(e.trim())}})}catch{this.showAddGroupForm()}finally{this.loadingAddGroup=!1}},showAddGroupForm(){this.$refs.addGroup.editingActive=!0,this.$refs.addGroup.onMenuToggle(!1),this.$nextTick((()=>{this.$refs.addGroup.$refs.editingInput.focusInput()}))},hideAddGroupForm(){this.$refs.addGroup.editingActive=!1,this.$refs.addGroup.editingValue=""},formatGroupMenu(e){const t={};return void 0===e?{}:(t.id=e.id,t.title=e.name,t.usercount=e.usercount,e.usercount-e.disabled>0&&(t.count=e.usercount-e.disabled),t)}}};var Le=a(40551),Ge={};Ge.styleTagTransform=ue(),Ge.setAttributes=re(),Ge.insert=ie().bind(null,"head"),Ge.domAPI=se(),Ge.insertStyleElement=le(),ee()(Le.Z,Ge),Le.Z&&Le.Z.locals&&Le.Z.locals;const xe=(0,D.Z)(Me,(function(){var e=this,t=e._self._c;return t("NcContent",{attrs:{"app-name":"settings","navigation-class":{"icon-loading":e.loadingAddGroup}}},[t("NcAppNavigation",{scopedSlots:e._u([{key:"list",fn:function(){return[t("NcAppNavigationItem",{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:e.showAddGroupForm,"update:title":e.createGroup}}),e._v(" "),t("NcAppNavigationItem",{attrs:{id:"everyone",exact:!0,title:e.t("settings","Active users"),to:{name:"users"},icon:"icon-contacts-dark"}},[e.userCount>0?t("NcAppNavigationCounter",{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(" "),e.settings.isAdmin?t("NcAppNavigationItem",{attrs:{id:"admin",exact:!0,title:e.t("settings","Admins"),to:{name:"group",params:{selectedGroup:"admin"}},icon:"icon-user-admin"}},[e.adminGroupMenu.count?t("NcAppNavigationCounter",{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._e(),e._v(" "),e.disabledGroupMenu.usercount>0||-1===e.disabledGroupMenu.usercount?t("NcAppNavigationItem",{attrs:{id:"disabled",exact:!0,title:e.t("settings","Disabled users"),to:{name:"group",params:{selectedGroup:"disabled"}},icon:"icon-disabled-users"}},[e.disabledGroupMenu.usercount>0?t("NcAppNavigationCounter",{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?t("NcAppNavigationCaption",{attrs:{title:e.t("settings","Groups")}}):e._e(),e._v(" "),e._l(e.groupList,(function(e){return t("GroupListItem",{key:e.id,attrs:{id:e.id,title:e.title,count:e.count}})}))]},proxy:!0},{key:"footer",fn:function(){return[t("NcAppNavigationSettings",[t("div",[t("p",[e._v(e._s(e.t("settings","Default quota:")))]),e._v(" "),t("NcMultiselect",{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(" "),t("div",[t("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,a=t.target,i=!!a.checked;if(Array.isArray(s)){var n=e._i(s,null);a.checked?n<0&&(e.showLanguages=s.concat([null])):n>-1&&(e.showLanguages=s.slice(0,n).concat(s.slice(n+1)))}else e.showLanguages=i}}}),e._v(" "),t("label",{attrs:{for:"showLanguages"}},[e._v(e._s(e.t("settings","Show Languages")))])]),e._v(" "),t("div",[t("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,a=t.target,i=!!a.checked;if(Array.isArray(s)){var n=e._i(s,null);a.checked?n<0&&(e.showLastLogin=s.concat([null])):n>-1&&(e.showLastLogin=s.slice(0,n).concat(s.slice(n+1)))}else e.showLastLogin=i}}}),e._v(" "),t("label",{attrs:{for:"showLastLogin"}},[e._v(e._s(e.t("settings","Show last login")))])]),e._v(" "),t("div",[t("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,a=t.target,i=!!a.checked;if(Array.isArray(s)){var n=e._i(s,null);a.checked?n<0&&(e.showUserBackend=s.concat([null])):n>-1&&(e.showUserBackend=s.slice(0,n).concat(s.slice(n+1)))}else e.showUserBackend=i}}}),e._v(" "),t("label",{attrs:{for:"showUserBackend"}},[e._v(e._s(e.t("settings","Show user backend")))])]),e._v(" "),t("div",[t("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,a=t.target,i=!!a.checked;if(Array.isArray(s)){var n=e._i(s,null);a.checked?n<0&&(e.showStoragePath=s.concat([null])):n>-1&&(e.showStoragePath=s.slice(0,n).concat(s.slice(n+1)))}else e.showStoragePath=i}}}),e._v(" "),t("label",{attrs:{for:"showStoragePath"}},[e._v(e._s(e.t("settings","Show storage path")))])]),e._v(" "),t("div",[t("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,a=t.target,i=!!a.checked;if(Array.isArray(s)){var n=e._i(s,null);a.checked?n<0&&(e.sendWelcomeMail=s.concat([null])):n>-1&&(e.sendWelcomeMail=s.slice(0,n).concat(s.slice(n+1)))}else e.sendWelcomeMail=i}}}),e._v(" "),t("label",{attrs:{for:"sendWelcomeMail"}},[e._v(e._s(e.t("settings","Send email to new user")))])])])]},proxy:!0}])},[t("NcAppNavigationNew",{attrs:{"button-id":"new-user-button",text:e.t("settings","New user"),"button-class":"icon-add"},on:{click:e.showNewUserMenu,keyup:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.showNewUserMenu.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])?null:e.showNewUserMenu.apply(null,arguments)}]}})],1),e._v(" "),t("NcAppContent",[t("UserList",{attrs:{users:e.users,"show-config":e.showConfig,"selected-group":e.selectedGroupDecoded,"external-actions":e.externalActions}})],1)],1)}),[],!1,null,"76897a76",null).exports}}]); +//# sourceMappingURL=settings-users-8351.js.map?v=37f24579d44077c6fb59
\ No newline at end of file |