From 4cd23fde25f04cd6d4c4f659f4a69d8d105e8bb1 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 1 Feb 2021 13:50:16 +0800 Subject: [PATCH] add styling so forget pass can be disabled --- Pman.Dialog.Login.bjs | 13 +++++++------ Pman.Dialog.Login.js | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Pman.Dialog.Login.bjs b/Pman.Dialog.Login.bjs index c2d4c524..4fd9263a 100644 --- a/Pman.Dialog.Login.bjs +++ b/Pman.Dialog.Login.bjs @@ -2,7 +2,7 @@ "name" : "Pman.Dialog.Login", "parent" : "", "title" : "", - "path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Dialog.Login.bjs", + "path" : "/home/alan/gitlive/Pman.BAdmin/Pman.Dialog.Login.bjs", "permname" : "", "modOrder" : "001", "strings" : { @@ -61,9 +61,9 @@ "items" : [ { "listeners" : { + "|actioncomplete" : "function (_self, action) {\n \n if(action.type == 'setdata'){\n\n if(\n _this.lastLogin && \n _this.lastLogin.login_provider == ''\n ){\n _this.form.findField('username').setValue(_this.lastLogin.email);\n }\n \n Roo.get('login-err').dom.innerHTML = \"\";\n _this.errorRow.hide();\n _this.dialog.el.select('.modal-content', true).first().unmask();\n this.clearInvalid();\n return;\n }\n \n if(action.type == 'load'){\n \n return;\n }\n \n if (action.type =='submit') {\n \n _this.dialog.hide();\n \n var cb = function(){\n if (_this.callback) {\n _this.callback.call(_this, action.result);\n }\n \n _this.form.reset();\n \n return;\n }\n \n if(\n !action.result.data.oath_key_enable &&\n action.result.data.require_oath * 1 == 1\n ) {\n Roo.bootstrap.MessageBox.show({\n title : \"Two Factor Authentication is required\",\n closable : false,\n msg : \"This system requires that you use Google Two Factor Authentication.\",\n buttons : {yes:'Setup Two Factor Authentication'},\n fn : function(ret){\n if(ret != 'yes'){\n return;\n }\n \n Pman.Dialog.BAdminStaffTwoFactorQRCode.show(\n {id: action.result.data.id, allow_close : true },\n cb\n );\n }\n });\n \n return;\n }\n \n cb();\n }\n}", "|render" : "function (_self) {\n _this.form = _self;\n}", - "|actionfailed" : "function (_self, action) {\n Roo.log('action failed?!');\n Roo.log(action);\n \n _this.dialog.el.select('.modal-content', true).first().unmask();\n \n if (typeof(action) != 'undefined' && action.failureType == 'server') {\n \n switch (action.result.errorMsg) {\n \n case 'Authenticated' :\n \n var data = Roo.apply(action.result.errors);\n \n data.target = _this.form.findField('username').getValue();\n \n Roo.bootstrap.MessageBox.alert(\"Error\", \"odd error messages\");\n \n break;\n \n case 'NEW-IP-ADDRESS' :\n case 'PENDING-IP-ADDRESS' :\n case 'BAD-IP-ADDRESS' :\n case 'BLOCKED-IP-ADDRESS' :\n \n _this.dialog.hide();\n \n Pman.Dialog.LoginNotice.show({\n status : action.result.errorMsg,\n ip : action.result.errors.ip\n });\n \n break;\n \n default:\n _this.errorRow.show();\n Roo.get('login-err').dom.innerHTML = action.result.errorMsg;\n break;\n }\n \n return;\n }\n \n Roo.get('login-err').dom.innerHTML = \"Fill in all the required fields\";\n}", - "|actioncomplete" : "function (_self, action) {\n \n if(action.type == 'setdata'){\n\n if(\n _this.lastLogin && \n _this.lastLogin.login_provider == ''\n ){\n _this.form.findField('username').setValue(_this.lastLogin.email);\n }\n \n Roo.get('login-err').dom.innerHTML = \"\";\n _this.errorRow.hide();\n _this.dialog.el.select('.modal-content', true).first().unmask();\n this.clearInvalid();\n return;\n }\n \n if(action.type == 'load'){\n \n return;\n }\n \n if (action.type =='submit') {\n \n _this.dialog.hide();\n \n var cb = function(){\n if (_this.callback) {\n _this.callback.call(_this, action.result);\n }\n \n _this.form.reset();\n \n return;\n }\n \n if(\n !action.result.data.oath_key_enable &&\n action.result.data.require_oath * 1 == 1\n ) {\n Roo.bootstrap.MessageBox.show({\n title : \"Two Factor Authentication is required\",\n closable : false,\n msg : \"This system requires that you use Google Two Factor Authentication.\",\n buttons : {yes:'Setup Two Factor Authentication'},\n fn : function(ret){\n if(ret != 'yes'){\n return;\n }\n \n Pman.Dialog.BAdminStaffTwoFactorQRCode.show(\n {id: action.result.data.id, allow_close : true },\n cb\n );\n }\n });\n \n return;\n }\n \n cb();\n }\n}" + "|actionfailed" : "function (_self, action) {\n Roo.log('action failed?!');\n Roo.log(action);\n \n _this.dialog.el.select('.modal-content', true).first().unmask();\n \n if (typeof(action) != 'undefined' && action.failureType == 'server') {\n \n switch (action.result.errorMsg) {\n \n case 'Authenticated' :\n \n var data = Roo.apply(action.result.errors);\n \n data.target = _this.form.findField('username').getValue();\n \n Roo.bootstrap.MessageBox.alert(\"Error\", \"odd error messages\");\n \n break;\n \n case 'NEW-IP-ADDRESS' :\n case 'PENDING-IP-ADDRESS' :\n case 'BAD-IP-ADDRESS' :\n case 'BLOCKED-IP-ADDRESS' :\n \n _this.dialog.hide();\n \n Pman.Dialog.LoginNotice.show({\n status : action.result.errorMsg,\n ip : action.result.errors.ip\n });\n \n break;\n \n default:\n _this.errorRow.show();\n Roo.get('login-err').dom.innerHTML = action.result.errorMsg;\n break;\n }\n \n return;\n }\n \n Roo.get('login-err').dom.innerHTML = \"Fill in all the required fields\";\n}" }, "$ url" : "baseURL + '/Login'", "labelAlign" : "left", @@ -82,8 +82,8 @@ "specialkey" : "function (_self, e)\n{\n if(e.getKey() == 13){\n _this.dialog.el.select('.modal-content', true).first().mask('Sending...');\n _this.form.doAction('submit');\n }\n \n}" }, "inputType" : "email", - "xtype" : "Input", "vtype" : "email", + "xtype" : "Input", "placeholder" : "Email Address", "allowBlank" : false, "$ xns" : "Roo.bootstrap", @@ -94,8 +94,8 @@ "specialkey" : "function (_self, e)\n{\n if(e.getKey() == 13){\n _this.dialog.el.select('.modal-content', true).first().mask('Sending...');\n _this.form.doAction('submit');\n }\n}" }, "inputType" : "password", - "placeholder" : "Password", "xtype" : "Input", + "placeholder" : "Password", "allowBlank" : false, "$ xns" : "Roo.bootstrap", "name" : "password" @@ -159,8 +159,8 @@ }, { "xtype" : "Button", - "$ string weight" : "'primary'", "html" : "Login", + "$ string weight" : "'primary'", "$ xns" : "Roo.bootstrap", "String style" : "float: right", "* prop" : "buttons[]", @@ -171,6 +171,7 @@ "click" : "function () {\n\n _this.dialog.hide();\n \n var email = _this.form.findField('username').getValue();\n \n var _self = this;\n \n Pman.Dialog.BAdminForgotPassword.show({email : email}, function(){\n Roo.bootstrap.MessageBox.alert(_self._forgot_passwd_success_title, _self._forgot_passwd_success_body, function() {\n _this.dialog.show();\n });\n\n });\n}" }, "String tag" : "a", + "String cls" : "login-forgot-pass-btn", "String href" : "#", "xtype" : "Button", "html" : "Forgot your password ?", diff --git a/Pman.Dialog.Login.js b/Pman.Dialog.Login.js index 6cc42c68..dd76e856 100644 --- a/Pman.Dialog.Login.js +++ b/Pman.Dialog.Login.js @@ -102,6 +102,7 @@ Roo.apply(Pman.Dialog.Login.prototype, { }, { xtype : 'Button', + cls : 'login-forgot-pass-btn', _forgot_passwd_success_body : _this._strings['11163ed17ad9afc7680bb9e92f15d6fd'] /* We have sent you a link to reset your password */, _forgot_passwd_success_title : _this._strings['24efa7ee4511563b16144f39706d594f'] /* Notice */, href : '#', -- 2.39.2