From: Edward Date: Fri, 7 Dec 2018 04:35:55 +0000 (+0800) Subject: Pman.Dialog.Login.bjs X-Git-Url: http://git.roojs.org/?p=Pman.BAdmin;a=commitdiff_plain;h=075d3d98553de5d901d99ce079fcd7d12d507d35 Pman.Dialog.Login.bjs Pman.Dialog.Login.js --- diff --git a/Pman.Dialog.Login.bjs b/Pman.Dialog.Login.bjs index d29d6aa3..4b3f5c07 100644 --- a/Pman.Dialog.Login.bjs +++ b/Pman.Dialog.Login.bjs @@ -61,9 +61,9 @@ "items" : [ { "listeners" : { - "|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 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 return;\n }\n \n if(\n !action.result.data.oath_key_enable &&\n action.result.data.require_oath * 1 == 1\n ) {\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,\n allow_close: true,\n allow_cancel : false\n }, cb)\n }\n });\n \n return;\n }\n \n cb();\n \n }\n}", - "|render" : "function (_self) {\n _this.form = _self;\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 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 return;\n }\n \n if(\n !action.result.data.oath_key_enable &&\n action.result.data.require_oath * 1 == 1\n ) {\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,\n allow_close: true,\n allow_cancel : false\n }, cb)\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}" }, "$ url" : "baseURL + '/Login'", "labelAlign" : "left", diff --git a/Pman.Dialog.Login.js b/Pman.Dialog.Login.js index 0ce56cfe..12c278b6 100644 --- a/Pman.Dialog.Login.js +++ b/Pman.Dialog.Login.js @@ -231,7 +231,6 @@ Roo.apply(Pman.Dialog.Login.prototype, { } cb(); - } }, actionfailed : function (_self, action) {