TT#134650 SIPAuth - As PBXAdmin, I want to change the (SIP)-passwords of all PBXAttendants

AC:
Can see the already existing SIP-password in plain text in the dialog
Can input new SIP-password
Can generate new SIP-password
Can save the new SIP-password
Can see a QNotification after successful save action
Can input only a restricted set of characters as in CSCv1 (NOTE: actually it's very strange and I'm not sure that it works properly in V1. For example it does not react on cyrilyc symbols but requires at least one lowercase english character)

TAC:
Reuse the already existing password input dialog that is used for the webpassword

Change-Id: I2cf3af4a330a9efa4102637b59e8a71ec962bd0e
mr10.0
Sergii Leonenko 4 years ago
parent ecfe57e687
commit e32dd9b56e

@ -9,7 +9,8 @@ import {
setPbxGroupIds,
setSubscriberNumbers,
setPreferenceIntraPbx,
getPreferences
getPreferences,
setPbxSIPPassword
} from './subscriber'
import _ from 'lodash'
import {
@ -231,6 +232,28 @@ export function setSeatWebPassword (options) {
})
}
/**
* @param options
* @param options.seatId
* @param options.seatSIPPassword
*/
export function setSeatSIPPassword (options) {
return new Promise((resolve, reject) => {
Promise.resolve().then(() => {
return setPbxSIPPassword(options.seatId, options.seatSIPPassword)
}).then(() => {
return getSubscriberAndPreferences(options.seatId)
}).then((result) => {
resolve({
seat: result.subscriber,
preferences: result.preferences
})
}).catch((err) => {
reject(err)
})
})
}
/**
* @param seatId
* @param clirIntrapbx

@ -310,6 +310,10 @@ export function setPbxWebPassword (id, pbxWebPassword) {
return setField(id, 'webpassword', pbxWebPassword)
}
export function setPbxSIPPassword (id, pbxWebPassword) {
return setField(id, 'password', pbxWebPassword)
}
export function setPbxHuntPolicy (id, pbxHuntPolicy) {
return setField(id, 'pbx_hunt_policy', pbxHuntPolicy)
}

@ -2,7 +2,7 @@
<csc-dialog
ref="dialog"
title-icon="vpn_key"
:title="$t('Change login password')"
:title="title"
>
<template
v-slot:actions
@ -19,6 +19,8 @@
</template>
<csc-input-password-retype
v-model="passwordRetype"
:password-label="passwordLabel"
:password-confirm-label="passwordConfirmLabel"
dense
@validation-failed="ready=false"
@validation-succeeded="ready=true"
@ -35,6 +37,24 @@ export default {
CscDialog,
CscInputPasswordRetype
},
props: {
title: {
type: String,
default () { return this.$t('Change login password') }
},
passwordLabel: {
type: String,
default () {
return this.$t('Password')
}
},
passwordConfirmLabel: {
type: String,
default () {
return this.$t('Password confirm')
}
}
},
data () {
return {
ready: false,

@ -76,6 +76,12 @@
:label="$t('Change Password')"
@click="showPasswordDialog"
/>
<csc-popup-menu-item
icon="vpn_key"
color="primary"
:label="$t('Change SIP Password')"
@click="showSIPPasswordDialog"
/>
<csc-popup-menu-item-delete
@click="deleteSeat"
/>
@ -477,12 +483,29 @@ export default {
this.changeWebPassword(password)
})
},
showSIPPasswordDialog () {
this.$q.dialog({
component: CscDialogChangePassword,
title: this.$t('Change SIP Password'),
passwordLabel: this.$t('SIP Password'),
passwordConfirmLabel: this.$t('SIP Password confirm'),
parent: this
}).onOk((password) => {
this.changeSIPPassword(password)
})
},
async changeWebPassword (password) {
await this.$store.dispatch('pbxSeats/setSeatWebPassword', {
seatId: this.seat.id,
seatWebPassword: password
})
},
async changeSIPPassword (password) {
await this.$store.dispatch('pbxSeats/setSeatSIPPassword', {
seatId: this.seat.id,
seatSIPPassword: password
})
},
changeIntraPbx () {
this.$emit('save-intra-pbx', {
seatId: this.seat.id,

@ -20,7 +20,8 @@ import {
setSeatSoundSet,
setSeatIntraPbx,
setSeatWebPassword,
getSeatPreferences
getSeatPreferences,
setSeatSIPPassword
} from '../api/pbx-seats'
export default {
@ -353,6 +354,20 @@ export default {
context.commit('seatUpdateFailed', err.message)
})
},
setSeatSIPPassword (context, options) {
context.commit('seatUpdateRequesting', {
seatId: options.seatId,
seatField: i18n.t('SIP Password')
})
setSeatSIPPassword({
seatId: options.seatId,
seatSIPPassword: options.seatSIPPassword
}).then((result) => {
context.commit('seatUpdateSucceeded', result)
}).catch((err) => {
context.commit('seatUpdateFailed', err.message)
})
},
setSeatGroups (context, options) {
context.commit('seatUpdateRequesting', {
seatId: options.seatId,

Loading…
Cancel
Save