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'){
140 _this.form.clearInvalid();
142 _this.form.findField('_enable_oath_key').setChecked(false,true);
145 url: baseURL + '/Login.php',
150 success: function(res) {
152 if(res.data.oath_key_enable) {
153 _this.form.findField('_enable_oath_key').setChecked(true,true);
159 if (action.type == 'load') {
161 Roo.log('invalid usage');
164 if (action.type =='submit') {
166 if (_this.callback) {
167 _this.callback.call(_this, action.result);
172 _this.submit_button.changeStatus('loaded');
174 _this.dialog.hide({});
179 actionfailed : function (_self, action)
181 if (action.type =='submit') {
183 _this.submit_button.changeStatus('loaded');
185 if (_this.callback) {
186 _this.callback.call(_this, action.result);
190 render : function (_self)
196 '|xns' : 'Roo.bootstrap',
201 '|xns' : 'Roo.bootstrap',
207 '|xns' : 'Roo.bootstrap',
212 fieldLabel : _this._strings['ae3bb2a1ac61750150b606298091d38a'] /* New Password */,
213 inputType : 'password',
217 change : function (_self, newValue, oldValue)
219 _this.form.findField('passwd2').markInvalid();
223 '|xns' : 'Roo.bootstrap'
228 fieldLabel : _this._strings['9182ecb4943f2724adde82c820702555'] /* Retype New Password */,
229 inputType : 'password',
233 valid : function (_self)
235 if (_this.form.findField('passwd1').getValue() !== _this.form.findField('passwd2').getValue()){
236 _this.form.findField('passwd2').markInvalid();
241 '|xns' : 'Roo.bootstrap'
246 inputType : 'hidden',
248 name : 'changePassword',
249 placeholder : _this._strings['51eea3dc60ae3a0b1bb8188bc6337dc2'] /* enter password */,
251 '|xns' : 'Roo.bootstrap'
255 boxLabel : _this._strings['828e70f83623b262e14187c039df99c0'] /* Enable Two-Factor Authentication */,
257 name : '_enable_oath_key',
259 check : function (_self, checked)
261 // keep firing when showing a dialog with checked checkbox...
263 if(!_this.dialog.getEl().isVisible()) {
269 Pman.Dialog.BAdminStaffTwoFactorQRCode.show({});
271 this.setBoxLabel('Untick to disable Two Factor authentication');
276 this.setBoxLabel('Enable Two Factor Authentication');
280 '|xns' : 'Roo.bootstrap'
294 Roo.apply(Pman.Dialog.BAdminPassword, Pman.Dialog.BAdminPassword.prototype);