1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Dialog');
7 Pman.Dialog.BAdminPassword= function() {}
8 Roo.apply(Pman.Dialog.BAdminPassword.prototype, {
11 '9182ecb4943f2724adde82c820702555' :"Retype New Password",
12 '8f1e77e0d2be21da93cd4d9a939148f7' :"Change Password",
13 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
14 'ae3bb2a1ac61750150b606298091d38a' :"New Password",
15 '51eea3dc60ae3a0b1bb8188bc6337dc2' :"enter password",
16 'bb78dd7992509064b8044b7afe6ec9ed' :"Update Password",
17 '828e70f83623b262e14187c039df99c0' :"Enable Two-Factor Authentication"
20 'changePassword_placeholder' : '51eea3dc60ae3a0b1bb8188bc6337dc2' /* enter password */ ,
21 'passwd2_fieldLabel' : '9182ecb4943f2724adde82c820702555' /* Retype New Password */ ,
22 'passwd1_fieldLabel' : 'ae3bb2a1ac61750150b606298091d38a' /* New Password */ ,
23 '_enable_oath_key_boxLabel' : '828e70f83623b262e14187c039df99c0' /* Enable Two-Factor Authentication */
29 show : function(data, cb)
37 this.dialog.show(this.data._el);
40 this.form.setValues(data);
41 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
49 this.dialog = Roo.factory({
51 cls : 'enable-overflow',
52 title : _this._strings['8f1e77e0d2be21da93cd4d9a939148f7'] /* Change Password */,
54 '|xns' : 'Roo.bootstrap',
58 html : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
60 click : function (_self, e)
62 _this.dialog.hide({});
64 render : function (_self)
66 _this.cancel_btn = this;
70 '|xns' : 'Roo.bootstrap'
74 changeStatus : function(status)
80 this.setText('sending...');
92 html : _this._strings['bb78dd7992509064b8044b7afe6ec9ed'] /* Update Password */,
95 click : function (_self, e)
97 var p1 = _this.form.findField('passwd1').getValue();
98 var p2 = _this.form.findField('passwd2').getValue();
105 Roo.bootstrap.MessageBox.alert("Error", "Passwords do not match");
109 _this.form.findField('changePassword').setValue(1);
111 this.changeStatus('submit');
113 _this.form.doAction('submit');
115 render : function (_self)
117 _this.submit_button = this;
121 '|xns' : 'Roo.bootstrap'
127 style : 'width: 100%',
129 '|xns' : 'Roo.bootstrap',
134 url : baseURL+'/Login',
136 actioncomplete : function (_self, action)
138 if(action.type == 'setdata'){
142 _this.form.clearInvalid();
144 _this.form.findField('_enable_oath_key').setChecked(false,false);
147 url: baseURL + '/Login.php',
152 success: function(res) {
154 if(res.data.oath_key_enable) {
155 _this.form.findField('_enable_oath_key').setChecked(true,false);
161 if (action.type == 'load') {
163 Roo.log('invalid usage');
166 if (action.type =='submit') {
168 if (_this.callback) {
169 _this.callback.call(_this, action.result);
174 _this.submit_button.changeStatus('loaded');
176 _this.dialog.hide({});
181 actionfailed : function (_self, action)
183 if (action.type =='submit') {
185 _this.submit_button.changeStatus('loaded');
187 if (_this.callback) {
188 _this.callback.call(_this, action.result);
192 render : function (_self)
198 '|xns' : 'Roo.bootstrap',
203 '|xns' : 'Roo.bootstrap',
209 '|xns' : 'Roo.bootstrap',
214 fieldLabel : _this._strings['ae3bb2a1ac61750150b606298091d38a'] /* New Password */,
215 inputType : 'password',
219 change : function (_self, newValue, oldValue)
221 _this.form.findField('passwd2').markInvalid();
225 '|xns' : 'Roo.bootstrap'
230 fieldLabel : _this._strings['9182ecb4943f2724adde82c820702555'] /* Retype New Password */,
231 inputType : 'password',
235 valid : function (_self)
237 if (_this.form.findField('passwd1').getValue() !== _this.form.findField('passwd2').getValue()){
238 _this.form.findField('passwd2').markInvalid();
243 '|xns' : 'Roo.bootstrap'
248 inputType : 'hidden',
250 name : 'changePassword',
251 placeholder : _this._strings['51eea3dc60ae3a0b1bb8188bc6337dc2'] /* enter password */,
253 '|xns' : 'Roo.bootstrap'
257 boxLabel : _this._strings['828e70f83623b262e14187c039df99c0'] /* Enable Two-Factor Authentication */,
259 name : '_enable_oath_key',
261 check : function (_self, checked)
264 this.setBoxLabel('Untick to disable Two Factor authentication');
268 this.setBoxLabel('Enable Two Factor Authentication');
270 click : function (_self, e)
272 if(!Pman.Login.authUser) {
273 Roo.bootstrap.MessageBox.alert('Error', 'Please login again');
280 Pman.Dialog.BAdminStaffTwoFactorQRCode.show({
281 id: Pman.Login.authUser.id,
286 _this.dialog.hide({});
290 _this.form.findField('_enable_oath_key').setChecked(false,false);
297 url : baseURL + '/Roo/Core_person',
301 id: Pman.Login.authUser.id
304 success : function(res)
308 Roo.bootstrap.MessageBox.alert('Success', 'The two factor authentication has been disabled');
311 Roo.log('invalid usage');
316 failure : function(res)
318 Roo.bootstrap.MessageBox.alert('Error', res);
324 '|xns' : 'Roo.bootstrap'
338 Roo.apply(Pman.Dialog.BAdminPassword, Pman.Dialog.BAdminPassword.prototype);