{ "name" : "Pman.Dialog.BAdminPassword", "parent" : "", "title" : "", "path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Dialog.BAdminPassword.bjs", "permname" : "", "modOrder" : "001", "strings" : { "9182ecb4943f2724adde82c820702555" : "Retype New Password", "8f1e77e0d2be21da93cd4d9a939148f7" : "Change Password", "ea4788705e6873b424c65e91c2846b19" : "Cancel", "ae3bb2a1ac61750150b606298091d38a" : "New Password", "51eea3dc60ae3a0b1bb8188bc6337dc2" : "enter password", "bb78dd7992509064b8044b7afe6ec9ed" : "Update Password", "828e70f83623b262e14187c039df99c0" : "Enable Two-Factor Authentication" }, "named_strings" : { "changePassword_placeholder" : "51eea3dc60ae3a0b1bb8188bc6337dc2", "passwd2_fieldLabel" : "9182ecb4943f2724adde82c820702555", "passwd1_fieldLabel" : "ae3bb2a1ac61750150b606298091d38a", "_enable_oath_key_boxLabel" : "828e70f83623b262e14187c039df99c0" }, "items" : [ { "String cls" : "enable-overflow", "xtype" : "Modal", "$ xns" : "Roo.bootstrap", "String title" : "Change Password", "items" : [ { "listeners" : { "render" : "function (_self)\n{\n _this.cancel_btn = this;\n}", "click" : "function (_self, e)\n{\n _this.dialog.hide({});\n}" }, "xtype" : "Button", "$ xns" : "Roo.bootstrap", "String html" : "Cancel", "* prop" : "buttons[]" }, { "listeners" : { "render" : "function (_self)\n{\n _this.submit_button = this;\n}", "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}" }, "String weight" : "primary", "xtype" : "Button", "| 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}", "$ xns" : "Roo.bootstrap", "String html" : "Update Password", "* prop" : "buttons[]" }, { "xtype" : "Container", "$ xns" : "Roo.bootstrap", "String style" : "width: 100%", "items" : [ { "listeners" : { "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}", "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}", "render" : "function (_self)\n{\n _this.form = this;\n}" }, "$ url" : "baseURL+'/Login'", "xtype" : "Form", "$ xns" : "Roo.bootstrap", "String method" : "POST", "items" : [ { "xtype" : "Row", "$ xns" : "Roo.bootstrap", "items" : [ { "xtype" : "Column", "Number xs" : 12, "$ xns" : "Roo.bootstrap", "items" : [ { "listeners" : { "change" : "function (_self, newValue, oldValue)\n{\n _this.form.findField('passwd2').markInvalid();\n}" }, "Boolean allowBlank" : false, "String name" : "passwd1", "xtype" : "Input", "String labelAlign" : "top", "string fieldLabel" : "New Password", "String inputType" : "password", "$ xns" : "Roo.bootstrap" }, { "listeners" : { "valid" : "function (_self)\n{\n if (_this.form.findField('passwd1').getValue() !== _this.form.findField('passwd2').getValue()){\n _this.form.findField('passwd2').markInvalid();\n }\n}" }, "Boolean allowBlank" : false, "String name" : "passwd2", "xtype" : "Input", "String labelAlign" : "top", "string fieldLabel" : "Retype New Password", "String inputType" : "password", "$ xns" : "Roo.bootstrap" }, { "Boolean allowBlank" : false, "String name" : "changePassword", "xtype" : "Input", "string placeholder" : "enter password", "String labelAlign" : "top", "String inputType" : "hidden", "$ xns" : "Roo.bootstrap" }, { "listeners" : { "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}", "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}" }, "String name" : "_enable_oath_key", "Boolean checked" : false, "xtype" : "CheckBox", "String boxLabel" : "Enable Two-Factor Authentication", "$ xns" : "Roo.bootstrap" } ] } ] } ] } ] } ] } ] }