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 show : function (_self)
56 _this.form_pw.fireEvent('actioncomplete', _this.form, { type: 'setdata', data: _this.data });
60 '|xns' : 'Roo.bootstrap',
64 html : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
66 click : function (_self, e)
68 _this.dialog.hide({});
70 render : function (_self)
72 _this.cancel_btn = this;
76 '|xns' : 'Roo.bootstrap'
80 changeStatus : function(status)
86 this.setText('sending...');
98 html : _this._strings['bb78dd7992509064b8044b7afe6ec9ed'] /* Update Password */,
101 click : function (_self, e)
103 var p1 = _this.form.findField('passwd1').getValue();
104 var p2 = _this.form.findField('passwd2').getValue();
111 Roo.bootstrap.MessageBox.alert("Error", "Passwords do not match");
115 _this.form.findField('changePassword').setValue(1);
117 this.changeStatus('submit');
119 _this.form.doAction('submit');
121 render : function (_self)
123 _this.submit_button = this;
127 '|xns' : 'Roo.bootstrap'
133 style : 'width: 100%',
135 '|xns' : 'Roo.bootstrap',
140 url : baseURL+'/Login',
142 actioncomplete : function (_self, action)
144 if(action.type == 'setdata'){
146 _this.form_pw.reset();
148 _this.form_pw.clearInvalid();
150 _this.form_pw.findField('_enable_oath_key').setChecked(false,true);
153 url: baseURL + '/Login.php',
158 success: function(res) {
160 if(res.data.oath_key_enable) {
161 _this.form_pw.findField('_enable_oath_key').setChecked(true,true);
167 if (action.type == 'load') {
169 Roo.log('invalid usage');
172 if (action.type =='submit') {
174 if (_this.callback) {
175 _this.callback.call(_this, action.result);
180 _this.submit_button.changeStatus('loaded');
182 _this.dialog.hide({});
187 actionfailed : function (_self, action)
189 if (action.type =='submit') {
191 _this.submit_button.changeStatus('loaded');
193 if (_this.callback) {
194 _this.callback.call(_this, action.result);
198 render : function (_self)
200 _this.form_pw = this;
204 '|xns' : 'Roo.bootstrap',
209 '|xns' : 'Roo.bootstrap',
215 '|xns' : 'Roo.bootstrap',
220 fieldLabel : _this._strings['ae3bb2a1ac61750150b606298091d38a'] /* New Password */,
221 inputType : 'password',
225 change : function (_self, newValue, oldValue)
227 _this.form.findField('passwd2').markInvalid();
231 '|xns' : 'Roo.bootstrap'
236 fieldLabel : _this._strings['9182ecb4943f2724adde82c820702555'] /* Retype New Password */,
237 inputType : 'password',
241 valid : function (_self)
243 if (_this.form.findField('passwd1').getValue() !== _this.form.findField('passwd2').getValue()){
244 _this.form.findField('passwd2').markInvalid();
249 '|xns' : 'Roo.bootstrap'
254 inputType : 'hidden',
256 name : 'changePassword',
257 placeholder : _this._strings['51eea3dc60ae3a0b1bb8188bc6337dc2'] /* enter password */,
259 '|xns' : 'Roo.bootstrap'
263 boxLabel : _this._strings['828e70f83623b262e14187c039df99c0'] /* Enable Two-Factor Authentication */,
265 name : '_enable_oath_key',
267 check : function (_self, checked)
269 // keep firing when showing a dialog with checked checkbox...
271 Roo.log(_this.dialog.getEl().isVisible());
273 if(!_this.dialog.getEl().isVisible()) {
279 Roo.log('who keep firing the check....');
281 Pman.Dialog.BAdminStaffTwoFactorQRCode.show({});
283 this.setBoxLabel('Untick to disable Two Factor authentication');
288 this.setBoxLabel('Enable Two Factor Authentication');
292 '|xns' : 'Roo.bootstrap'
306 Roo.apply(Pman.Dialog.BAdminPassword, Pman.Dialog.BAdminPassword.prototype);