mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
Merge pull request #52121 from nextcloud/fix/no-issue/use-password-default-sharing-details
fix(files_sharing): Apply default password setting in SharingDetailsTab
This commit is contained in:
commit
e5b34b700d
11 changed files with 30 additions and 46 deletions
|
|
@ -228,7 +228,6 @@ import { showError, showSuccess } from '@nextcloud/dialogs'
|
|||
import { ShareType } from '@nextcloud/sharing'
|
||||
import VueQrcode from '@chenfengyuan/vue-qrcode'
|
||||
import moment from '@nextcloud/moment'
|
||||
import Vue from 'vue'
|
||||
|
||||
import NcActionButton from '@nextcloud/vue/components/NcActionButton'
|
||||
import NcActionCheckbox from '@nextcloud/vue/components/NcActionCheckbox'
|
||||
|
|
@ -391,23 +390,6 @@ export default {
|
|||
}
|
||||
return null
|
||||
},
|
||||
/**
|
||||
* Is the current share password protected ?
|
||||
*
|
||||
* @return {boolean}
|
||||
*/
|
||||
isPasswordProtected: {
|
||||
get() {
|
||||
return this.config.enforcePasswordForPublicLink
|
||||
|| !!this.share.password
|
||||
},
|
||||
async set(enabled) {
|
||||
// TODO: directly save after generation to make sure the share is always protected
|
||||
Vue.set(this.share, 'password', enabled ? await GeneratePassword(true) : '')
|
||||
Vue.set(this.share, 'newPassword', this.share.password)
|
||||
},
|
||||
},
|
||||
|
||||
passwordExpirationTime() {
|
||||
if (this.share.passwordExpirationTime === null) {
|
||||
return null
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import { emit } from '@nextcloud/event-bus'
|
|||
import PQueue from 'p-queue'
|
||||
import debounce from 'debounce'
|
||||
|
||||
import GeneratePassword from '../utils/GeneratePassword.ts'
|
||||
import Share from '../models/Share.ts'
|
||||
import SharesRequests from './ShareRequests.js'
|
||||
import Config from '../services/ConfigService.ts'
|
||||
|
|
@ -156,6 +157,26 @@ export default {
|
|||
}
|
||||
return null
|
||||
},
|
||||
/**
|
||||
* Is the current share password protected ?
|
||||
*
|
||||
* @return {boolean}
|
||||
*/
|
||||
isPasswordProtected: {
|
||||
get() {
|
||||
return this.config.enforcePasswordForPublicLink
|
||||
|| !!this.share.password
|
||||
},
|
||||
async set(enabled) {
|
||||
if (enabled) {
|
||||
this.share.password = await GeneratePassword(true)
|
||||
this.$set(this.share, 'newPassword', this.share.password)
|
||||
} else {
|
||||
this.share.password = ''
|
||||
this.$delete(this.share, 'newPassword')
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -496,26 +496,6 @@ export default {
|
|||
: ''
|
||||
},
|
||||
},
|
||||
/**
|
||||
* Is the current share password protected ?
|
||||
*
|
||||
* @return {boolean}
|
||||
*/
|
||||
isPasswordProtected: {
|
||||
get() {
|
||||
return this.config.enforcePasswordForPublicLink
|
||||
|| !!this.share.password
|
||||
},
|
||||
async set(enabled) {
|
||||
if (enabled) {
|
||||
this.share.password = await GeneratePassword(true)
|
||||
this.$set(this.share, 'newPassword', this.share.password)
|
||||
} else {
|
||||
this.share.password = ''
|
||||
this.$delete(this.share, 'newPassword')
|
||||
}
|
||||
},
|
||||
},
|
||||
/**
|
||||
* Is the current share a folder ?
|
||||
*
|
||||
|
|
@ -873,8 +853,9 @@ export default {
|
|||
async initializeAttributes() {
|
||||
|
||||
if (this.isNewShare) {
|
||||
if (this.isPasswordEnforced && this.isPublicShare) {
|
||||
if ((this.config.enableLinkPasswordByDefault || this.isPasswordEnforced) && this.isPublicShare) {
|
||||
this.$set(this.share, 'newPassword', await GeneratePassword(true))
|
||||
this.$set(this.share, 'password', this.share.newPassword)
|
||||
this.advancedSectionAccordionExpanded = true
|
||||
}
|
||||
/* Set default expiration dates if configured */
|
||||
|
|
|
|||
4
dist/4672-4672.js → dist/4409-4409.js
vendored
4
dist/4672-4672.js → dist/4409-4409.js
vendored
File diff suppressed because one or more lines are too long
1
dist/4409-4409.js.map
vendored
Normal file
1
dist/4409-4409.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/4409-4409.js.map.license
vendored
Symbolic link
1
dist/4409-4409.js.map.license
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
4409-4409.js.license
|
||||
1
dist/4672-4672.js.map
vendored
1
dist/4672-4672.js.map
vendored
File diff suppressed because one or more lines are too long
1
dist/4672-4672.js.map.license
vendored
1
dist/4672-4672.js.map.license
vendored
|
|
@ -1 +0,0 @@
|
|||
4672-4672.js.license
|
||||
4
dist/files_sharing-files_sharing_tab.js
vendored
4
dist/files_sharing-files_sharing_tab.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_sharing-files_sharing_tab.js.map
vendored
2
dist/files_sharing-files_sharing_tab.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue