From 2883a6e5ffd988d7f72e551dfbea30efa429cc6e Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 7 Jun 2021 09:49:55 +0800 Subject: [PATCH] update save password --- Pman.Dialog.AdminPerson.bjs | 2 +- Pman.Dialog.AdminPerson.js | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Pman.Dialog.AdminPerson.bjs b/Pman.Dialog.AdminPerson.bjs index 9cd317c..9b42c4f 100644 --- a/Pman.Dialog.AdminPerson.bjs +++ b/Pman.Dialog.AdminPerson.bjs @@ -348,7 +348,7 @@ }, { "listeners" : { - "click" : "function (_self, e)\n{\n // do some checks?\n if (this.form.findField('passwd1')) {\n \n var p1 = this.form.findField('passwd1').getValue();\n var p2 = this.form.findField('passwd2').getValue();\n \n if (this.sendAfterSave && !p1.length) {\n Ext.MessageBox.alert(\"Error\", \"You must create a password to send introduction mail\");\n return;\n }\n \n if (Pman.Login.authUser.id < 0 && !p1.length) {\n Ext.MessageBox.alert(\"Error\", \"You must create a password for the admin account\");\n return;\n }\n \n \n if (p1.length || p2.length) {\n if (p1 != p2) {\n Ext.MessageBox.alert(\"Error\", \"Passwords do not match\");\n return;\n }\n }\n \n \n }\n \n \n _this.form.doAction(\"submit\");\n\n}" + "click" : "function (_self, e)\n{\n // do some checks?\n if (_this.form.findField('passwd1')) {\n \n var p1 = _this.form.findField('passwd1').getValue();\n var p2 = _this.form.findField('passwd2').getValue();\n \n if (_this.sendAfterSave && !p1.length) {\n Roo.MessageBox.alert(\"Error\", \"You must create a password to send introduction mail\");\n return;\n }\n \n if (Pman.Login.authUser.id < 0 && !p1.length) {\n Roo.MessageBox.alert(\"Error\", \"You must create a password for the admin account\");\n return;\n }\n \n \n if (p1.length || p2.length) {\n if (p1 != p2) {\n Roo.MessageBox.alert(\"Error\", \"Passwords do not match\");\n return;\n }\n }\n \n \n }\n \n \n _this.form.doAction(\"submit\");\n\n}" }, "text" : "Save", "xtype" : "Button", diff --git a/Pman.Dialog.AdminPerson.js b/Pman.Dialog.AdminPerson.js index 1b5cc68..f317fc2 100644 --- a/Pman.Dialog.AdminPerson.js +++ b/Pman.Dialog.AdminPerson.js @@ -102,25 +102,25 @@ Pman.Dialog.AdminPerson = { click : function (_self, e) { // do some checks? - if (this.form.findField('passwd1')) { + if (_this.form.findField('passwd1')) { - var p1 = this.form.findField('passwd1').getValue(); - var p2 = this.form.findField('passwd2').getValue(); + var p1 = _this.form.findField('passwd1').getValue(); + var p2 = _this.form.findField('passwd2').getValue(); - if (this.sendAfterSave && !p1.length) { - Ext.MessageBox.alert("Error", "You must create a password to send introduction mail"); + if (_this.sendAfterSave && !p1.length) { + Roo.MessageBox.alert("Error", "You must create a password to send introduction mail"); return; } if (Pman.Login.authUser.id < 0 && !p1.length) { - Ext.MessageBox.alert("Error", "You must create a password for the admin account"); + Roo.MessageBox.alert("Error", "You must create a password for the admin account"); return; } if (p1.length || p2.length) { if (p1 != p2) { - Ext.MessageBox.alert("Error", "Passwords do not match"); + Roo.MessageBox.alert("Error", "Passwords do not match"); return; } } -- 2.39.2