Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions apps/files_sharing/src/components/SharingEntryLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions apps/files_sharing/src/mixins/SharesMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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: {
Expand Down
23 changes: 2 additions & 21 deletions apps/files_sharing/src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?
*
Expand Down Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions dist/4672-4672.js → dist/4409-4409.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/4409-4409.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/4409-4409.js.map.license
1 change: 0 additions & 1 deletion dist/4672-4672.js.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/4672-4672.js.map.license

This file was deleted.

4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing_tab.js.map

Large diffs are not rendered by default.

Loading