From: edward Date: Thu, 15 Feb 2018 03:27:22 +0000 (+0800) Subject: Pman.Dialog.VerifyAccess.bjs X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=bd3dd53a98448ac651de2576807674675a938f2e Pman.Dialog.VerifyAccess.bjs Pman.Dialog.VerifyAccess.js --- diff --git a/Pman.Dialog.VerifyAccess.bjs b/Pman.Dialog.VerifyAccess.bjs index ecb8e9f1..8ae50628 100644 --- a/Pman.Dialog.VerifyAccess.bjs +++ b/Pman.Dialog.VerifyAccess.bjs @@ -18,7 +18,7 @@ "items" : [ { "listeners" : { - "show" : "function (_self)\n{\n var path = window.location.pathname.split('/');\n \n var verify_key = path.pop();\n \n var id = path.pop();\n \n var show_err = function(msg,title,show_resend_btn) {\n _this.form.hide();\n _this.btn_ok.hide();\n _this.error_row.el.show();\n _this.text_el.el.dom.innerHTML = msg;\n _this.modal.setTitle(title);\n if(show_resend_btn){\n _this.btn_resend.show();\n }\n }\n \n new Pman.Request({\n url: baseURL + '/Register/Confirm',\n method : 'POST',\n params : {\n id : id,\n verify_key : verify_key,\n _to_data : 1\n }, \n success : function(res) {\n _this.form.setValues(res.data);\n return;\n },\n failure: function(res) {\n \n switch(res.errorMsg) {\n case 'already_registered':\n _this.dialog.hide();\n Coba.Dialog.Login.show({});\n break;\n\n case 'multi_account':\n show_err('This email has been registered for multiple account. Please contact to your distributor to synchronize them',\n 'System Error',\n false);\n break;\n\n case 'broken_link':\n show_err('The link you clicked on was broken, on not complete, please copy and paste the full URL from the email you received',\n 'Invalid Link',\n false);\n break;\n\n case 'expired':\n show_err('This activation link is already expired, please click Resend email to get the updated activated link',\n 'Link Expired',\n true); \n break;\n\n \n default:\n show_err(res.errorMsg,'Error', false);\n break;\n } \n\n \n return;\n }\n });\n}", + "show" : "function (_self)\n{\n var path = window.location.pathname.split('/');\n \n var authorized_key = path.pop();\n \n var id = path.pop();\n \n new Pman.Request({\n url: baseURL + '/Core/VerifyAccess',\n method : 'POST',\n params : {\n id : id,\n authorized_key : authorized_key,\n _to_data : 1\n }, \n success : function(res) {\n _this.form.setValues(res.data);\n return;\n },\n failure: function(res) {\n \n switch(res.errorMsg) {\n case 'already_registered':\n _this.dialog.hide();\n Coba.Dialog.Login.show({});\n break;\n\n case 'multi_account':\n show_err('This email has been registered for multiple account. Please contact to your distributor to synchronize them',\n 'System Error',\n false);\n break;\n\n case 'broken_link':\n show_err('The link you clicked on was broken, on not complete, please copy and paste the full URL from the email you received',\n 'Invalid Link',\n false);\n break;\n\n case 'expired':\n show_err('This activation link is already expired, please click Resend email to get the updated activated link',\n 'Link Expired',\n true); \n break;\n\n \n default:\n show_err(res.errorMsg,'Error', false);\n break;\n } \n\n \n return;\n }\n });\n}", "render" : "function (_self)\n{\n _this.modal = _self;\n}" }, "String cls" : "enable-overflow", diff --git a/Pman.Dialog.VerifyAccess.js b/Pman.Dialog.VerifyAccess.js index 496dc7a9..73bbc4fd 100644 --- a/Pman.Dialog.VerifyAccess.js +++ b/Pman.Dialog.VerifyAccess.js @@ -56,27 +56,16 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, { { var path = window.location.pathname.split('/'); - var verify_key = path.pop(); + var authorized_key = path.pop(); var id = path.pop(); - var show_err = function(msg,title,show_resend_btn) { - _this.form.hide(); - _this.btn_ok.hide(); - _this.error_row.el.show(); - _this.text_el.el.dom.innerHTML = msg; - _this.modal.setTitle(title); - if(show_resend_btn){ - _this.btn_resend.show(); - } - } - new Pman.Request({ - url: baseURL + '/Register/Confirm', + url: baseURL + '/Core/VerifyAccess', method : 'POST', params : { id : id, - verify_key : verify_key, + authorized_key : authorized_key, _to_data : 1 }, success : function(res) {