From e32dd9b56ebbd24e56757cac03269d391686377e Mon Sep 17 00:00:00 2001 From: Sergii Leonenko Date: Thu, 5 Aug 2021 18:41:44 +0300 Subject: [PATCH] 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 --- src/api/pbx-seats.js | 25 ++++++++++++++++++- src/api/subscriber.js | 4 +++ src/components/CscDialogChangePassword.vue | 22 +++++++++++++++- .../pages/PbxConfiguration/CscPbxSeat.vue | 23 +++++++++++++++++ src/store/pbx-seats.js | 17 ++++++++++++- 5 files changed, 88 insertions(+), 3 deletions(-) diff --git a/src/api/pbx-seats.js b/src/api/pbx-seats.js index 2f615e59..d71e1542 100644 --- a/src/api/pbx-seats.js +++ b/src/api/pbx-seats.js @@ -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 diff --git a/src/api/subscriber.js b/src/api/subscriber.js index fd69452f..f1a8f00c 100644 --- a/src/api/subscriber.js +++ b/src/api/subscriber.js @@ -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) } diff --git a/src/components/CscDialogChangePassword.vue b/src/components/CscDialogChangePassword.vue index 21e8b559..9360536a 100644 --- a/src/components/CscDialogChangePassword.vue +++ b/src/components/CscDialogChangePassword.vue @@ -2,7 +2,7 @@