2 "name" : "Pman.Dialog.BAdminPassword",
5 "path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Dialog.BAdminPassword.bjs",
9 "9182ecb4943f2724adde82c820702555" : "Retype New Password",
10 "8f1e77e0d2be21da93cd4d9a939148f7" : "Change Password",
11 "ea4788705e6873b424c65e91c2846b19" : "Cancel",
12 "ae3bb2a1ac61750150b606298091d38a" : "New Password",
13 "51eea3dc60ae3a0b1bb8188bc6337dc2" : "enter password",
14 "bb78dd7992509064b8044b7afe6ec9ed" : "Update Password",
15 "828e70f83623b262e14187c039df99c0" : "Enable Two-Factor Authentication"
18 "changePassword_placeholder" : "51eea3dc60ae3a0b1bb8188bc6337dc2",
19 "passwd2_fieldLabel" : "9182ecb4943f2724adde82c820702555",
20 "passwd1_fieldLabel" : "ae3bb2a1ac61750150b606298091d38a",
21 "_enable_oath_key_boxLabel" : "828e70f83623b262e14187c039df99c0"
25 "String cls" : "enable-overflow",
27 "$ xns" : "Roo.bootstrap",
28 "String title" : "Change Password",
32 "render" : "function (_self)\n{\n _this.cancel_btn = this;\n}",
33 "click" : "function (_self, e)\n{\n _this.dialog.hide({});\n}"
36 "$ xns" : "Roo.bootstrap",
37 "String html" : "Cancel",
38 "* prop" : "buttons[]"
42 "render" : "function (_self)\n{\n _this.submit_button = this;\n}",
43 "click" : "function (_self, e)\n{\n var p1 = _this.form.findField('passwd1').getValue();\n var p2 = _this.form.findField('passwd2').getValue();\n \n if(\n !p1.length ||\n !p2.length ||\n p1 !== p2\n ) {\n Roo.bootstrap.MessageBox.alert(\"Error\", \"Passwords do not match\");\n return;\n }\n \n _this.form.findField('changePassword').setValue(1);\n \n this.changeStatus('submit');\n \n _this.form.doAction('submit');\n}"
45 "String weight" : "primary",
47 "| function changeStatus" : "function(status)\n{\n switch(status) {\n \n case 'submit':\n this.disable();\n this.setText('sending...');\n break;\n \n case 'loaded':\n this.enable();\n this.setText('OK');\n break;\n \n default:\n break;\n }\n}",
48 "$ xns" : "Roo.bootstrap",
49 "String html" : "Update Password",
50 "* prop" : "buttons[]"
53 "xtype" : "Container",
54 "$ xns" : "Roo.bootstrap",
55 "String style" : "width: 100%",
59 "actionfailed" : "function (_self, action)\n{\n if (action.type =='submit') {\n \n _this.submit_button.changeStatus('loaded');\n \n if (_this.callback) {\n _this.callback.call(_this, action.result);\n }\n }\n}",
60 "actioncomplete" : "function (_self, action)\n{\n if(action.type == 'setdata'){\n \n _this.form.reset();\n \n _this.form.clearInvalid();\n \n _this.form.findField('_enable_oath_key').setChecked(false,false);\n \n new Pman.Request({\n url: baseURL + '/Login.php',\n method: 'POST',\n params: {\n getAuthUser: true\n }, \n success: function(res) {\n \n if(res.data.oath_key_enable) {\n _this.form.findField('_enable_oath_key').setChecked(true,false);\n }\n }\n });\n }\n \n if (action.type == 'load') {\n \n Roo.log('invalid usage');\n }\n \n if (action.type =='submit') {\n \n if (_this.callback) {\n _this.callback.call(_this, action.result);\n }\n \n _this.form.reset();\n \n _this.submit_button.changeStatus('loaded');\n \n _this.dialog.hide({});\n \n return;\n }\n}",
61 "render" : "function (_self)\n{\n _this.form = this;\n}"
63 "$ url" : "baseURL+'/Login'",
65 "$ xns" : "Roo.bootstrap",
66 "String method" : "POST",
70 "$ xns" : "Roo.bootstrap",
75 "$ xns" : "Roo.bootstrap",
79 "change" : "function (_self, newValue, oldValue)\n{\n _this.form.findField('passwd2').markInvalid();\n}"
81 "Boolean allowBlank" : false,
82 "String name" : "passwd1",
84 "String labelAlign" : "top",
85 "string fieldLabel" : "New Password",
86 "String inputType" : "password",
87 "$ xns" : "Roo.bootstrap"
91 "valid" : "function (_self)\n{\n if (_this.form.findField('passwd1').getValue() !== _this.form.findField('passwd2').getValue()){\n _this.form.findField('passwd2').markInvalid();\n }\n}"
93 "Boolean allowBlank" : false,
94 "String name" : "passwd2",
96 "String labelAlign" : "top",
97 "string fieldLabel" : "Retype New Password",
98 "String inputType" : "password",
99 "$ xns" : "Roo.bootstrap"
102 "Boolean allowBlank" : false,
103 "String name" : "changePassword",
105 "string placeholder" : "enter password",
106 "String labelAlign" : "top",
107 "String inputType" : "hidden",
108 "$ xns" : "Roo.bootstrap"
112 "check" : "function (_self, checked)\n{\n if(checked) {\n this.setBoxLabel('Untick to disable Two Factor authentication');\n return;\n }\n \n this.setBoxLabel('Enable Two Factor Authentication');\n}",
113 "click" : "function (_self, e)\n{\n if(!Pman.Login.authUser) {\n Roo.bootstrap.MessageBox.alert('Error', 'Please login again');\n return;\n }\n \n e.preventDefault();\n \n if(!this.checked) {\n Pman.Dialog.BAdminStaffTwoFactorQRCode.show({\n id: Pman.Login.authUser.id,\n allow_close: false,\n allow_cancel : true\n }, function(valid){\n if(valid) {\n _this.dialog.hide({});\n return;\n }\n \n _this.form.findField('_enable_oath_key').setChecked(false,false);\n }\n );\n return;\n }\n \n new Pman.Request({\n url : baseURL + '/Roo/Core_person',\n method :'GET',\n params : {\n oath_key_disable: 1,\n id: Pman.Login.authUser.id\n },\n \n success : function(res)\n {\n switch(res.data) {\n case 'DONE':\n Roo.bootstrap.MessageBox.alert('Success', 'The two factor authentication has been disabled');\n break;\n default:\n Roo.log('invalid usage');\n break;\n }\n },\n \n failure : function(res)\n {\n Roo.bootstrap.MessageBox.alert('Error', res);\n }\n });\n}"
115 "String name" : "_enable_oath_key",
116 "Boolean checked" : false,
117 "xtype" : "CheckBox",
118 "String boxLabel" : "Enable Two-Factor Authentication",
119 "$ xns" : "Roo.bootstrap"