X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=Pman.Dialog.VerifyAccess.bjs;h=a9fe97d37936c84f76e6f4466150be516c485425;hp=ecb8e9f1e9e4fdef44f7597910aefc4afb23df21;hb=HEAD;hpb=a0bcb1484ee5ec5286a925ed57edeb102fb476f2 diff --git a/Pman.Dialog.VerifyAccess.bjs b/Pman.Dialog.VerifyAccess.bjs index ecb8e9f1..a9fe97d3 100644 --- a/Pman.Dialog.VerifyAccess.bjs +++ b/Pman.Dialog.VerifyAccess.bjs @@ -6,37 +6,35 @@ "permname" : "", "modOrder" : "001", "strings" : { - "d41d8cd98f00b204e9800998ecf8427e" : "", - "b945ed1d61d8edbe16a1192ad6d2fd58" : "Please enter a memorable password for logging into your application", - "07ae22a49223522664766d12c37a4eeb" : "Activate Your account", - "ee7ad62ad69b9ab5f25d273e4e0a1736" : "Your Username", - "51eea3dc60ae3a0b1bb8188bc6337dc2" : "enter password", - "1849ffc8731b5e74ae6157c91ba73575" : "Please confirm your password", - "d71940f24ee38ee09f6e06b908480bcf" : "Resend email", - "14cf5e829f5cb6fbf8cb54f7c5ff4ca9" : "Start the application process " + "e2c9d024b79dfb48b42a7807206c6aed" : "Verify New IP Access", + "a12a3079e14ced46e69ba52b8a90b21a" : "IP", + "f6039d44b29456b20f8f373155ae4973" : "Username", + "004bf6c9a40003140292e97330236c53" : "Action", + "5a787141d53b573ec9b86e900bfe0d79" : "Expire Date", + "dfb790522fdea3859af206d32916fe77" : "User Agent", + "70d9be9b139893aa6c69b5e77e614311" : "Confirm" }, "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}", - "render" : "function (_self)\n{\n _this.modal = _self;\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 mask : 'Loading...',\n params : {\n id : id,\n authorized_key : authorized_key,\n _to_data : 1\n }, \n success : function(res) {\n \n _this.data = res.data;\n \n if(_this.data.status != 0){\n _this.dialog.hide();\n Roo.bootstrap.MessageBox.alert('Notice', 'This IP has been verified [' + _this.data.ip + ']');\n return;\n }\n \n _this.form.setValues(_this.data);\n \n if(_this.data.status * 1 == 0){\n _this.form.findField('status').reset();\n }\n \n _this.form.findField('expire_dt').reset();\n \n _this.form.clearInvalid();\n \n return;\n },\n failure: function(res) {\n \n _this.dialog.hide();\n \n Roo.bootstrap.MessageBox.alert('Error', res.errorMsg);\n \n return;\n }\n });\n}" }, "String cls" : "enable-overflow", - "String size" : "sm", "Boolean allow_close" : false, "xtype" : "Modal", "$ xns" : "Roo.bootstrap", - "String title" : "Activate Your account", + "String title" : "Verify New IP Access", "items" : [ { "listeners" : { "actionfailed" : "function (_self, action)\n{\n _this.dialog.el.unmask();\n Roo.log(\"action failed\");\n Roo.log(action);\n \n if(!action.result.errorMsg){\n Roo.bootstrap.MessageBox.alert(\"Error\", \"Please contact system adminisrator\");\n }\n \n var msg = action.result.errorMsg;\n \n if(msg.length >= 200){\n msg = msg.substring(0,199) + '...'\n }\n \n Roo.bootstrap.MessageBox.alert(\"Error\", msg);\n}", - "actioncomplete" : "function (_self, action)\n{\n if (action.type == 'setdata') {\n \n _this.form.findField('password').focus();\n \n return;\n }\n if (action.type == 'load') {\n \n return;\n }\n if (action.type =='submit') {\n \n _this.dialog.hide();\n \n Roo.get(document.body).mask('Start your Application');\n \n setTimeout(function() {\n window.location.href = baseURL;\n }, 500); \n \n return;\n }\n \n}", + "actioncomplete" : "function (_self, action)\n{\n if (action.type == 'setdata') {\n \n return;\n }\n if (action.type == 'load') {\n \n return;\n }\n if (action.type =='submit') {\n \n _this.dialog.hide();\n \n Roo.bootstrap.MessageBox.alert('Notice', 'You have verified the IP [' + _this.data.ip + ']');\n \n return;\n }\n \n}", "render" : "function (_self,e)\n{\n _this.form = _self;\n \n}" }, - "$ string url" : "baseURL + '/Register/Confirm'", + "$ string url" : "baseURL + '/Core/VerifyAccess'", "Boolean errorMask" : true, "xtype" : "Form", + "String labelAlign" : "top", "$ xns" : "Roo.bootstrap", "Boolean loadMask" : false, "items" : [ @@ -53,81 +51,94 @@ "String name" : "email", "Boolean readOnly" : true, "xtype" : "Input", - "string fieldLabel" : "Your Username", - "String labelAlign" : "top", + "string fieldLabel" : "Username", "$ xns" : "Roo.bootstrap" } ] - } - ] - }, - { - "listeners" : { - "render" : "function (_self)\n{\n _this.row_pwd_label = _self;\n}" - }, - "xtype" : "Row", - "$ xns" : "Roo.bootstrap", - "items" : [ + }, + { + "xtype" : "Column", + "Number xs" : 12, + "$ xns" : "Roo.bootstrap", + "items" : [ + { + "String name" : "ip", + "Boolean readOnly" : true, + "xtype" : "Input", + "string fieldLabel" : "IP", + "$ xns" : "Roo.bootstrap" + } + ] + }, { "xtype" : "Column", "Number xs" : 12, "$ xns" : "Roo.bootstrap", "items" : [ { - "xtype" : "FieldLabel", + "String name" : "user_agent", + "Boolean readOnly" : true, + "xtype" : "TextArea", + "string fieldLabel" : "User Agent", + "Number rows" : 3, "$ xns" : "Roo.bootstrap", - "String html" : "Please enter a memorable password for logging into your application" + "String style" : "margin-bottom: 15px;" } ] - } - ] - }, - { - "listeners" : { - "render" : "function (_self)\n{\n _this.row_pwd1 = _self;\n}" - }, - "xtype" : "Row", - "$ xns" : "Roo.bootstrap", - "items" : [ + }, { "xtype" : "Column", "Number xs" : 12, "$ xns" : "Roo.bootstrap", "items" : [ { + "listeners" : { + "select" : "function (combo, record, index)\n{\n _this.expire_dt.allowBlank = true;\n _this.expire_dt.el.hide();\n \n if(record.data.code == '-2'){\n _this.expire_dt.allowBlank = false;\n _this.expire_dt.el.show();\n }\n}" + }, "Boolean allowBlank" : false, - "String name" : "password", - "xtype" : "SecurePass", - "String labelAlign" : "top", - "string placeholder" : "enter password", - "String inputType" : "password", - "$ xns" : "Roo.bootstrap" + "Boolean selectOnFocus" : true, + "String name" : "status_name", + "String mode" : "local", + "String valueField" : "code", + "Boolean editable" : false, + "xtype" : "ComboBox", + "String triggerAction" : "all", + "string fieldLabel" : "Action", + "Boolean alwaysQuery" : true, + "$ xns" : "Roo.bootstrap", + "String/Roo.Template tpl" : "
{value}
", + "String hiddenName" : "status", + "String displayField" : "value", + "String indicatorpos" : "right", + "Boolean forceSelection" : true, + "items" : [ + { + "$ string data" : "[\n ['1', 'Approve'],\n ['-2', 'Temporary'],\n ['-1', 'Reject']\n] ", + "xtype" : "SimpleStore", + "$ xns" : "Roo.data", + "$ fields" : "[ 'code', 'value' ]", + "* prop" : "store" + } + ] } ] - } - ] - }, - { - "listeners" : { - "render" : "function (_self)\n{\n _this.row_pwd2 = _self;\n}" - }, - "xtype" : "Row", - "$ xns" : "Roo.bootstrap", - "items" : [ + }, { "xtype" : "Column", "Number xs" : 12, "$ xns" : "Roo.bootstrap", "items" : [ { + "listeners" : { + "render" : "function (_self)\n{\n _this.expire_dt = this;\n \n var d = new Date();\n \n d.setDate(d.getDate() - 1);\n\n this.setStartDate(d);\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}" + }, "Boolean allowBlank" : false, - "string invalidText" : "The passwords you entered do not match", - "String name" : "password1", - "xtype" : "Input", - "string placeholder" : "Please confirm your password", - "String inputType" : "password", + "String name" : "expire_dt", + "String format" : "Y-m-d", + "xtype" : "DateField", + "string fieldLabel" : "Expire Date", "$ xns" : "Roo.bootstrap", - "$ Function validator" : "function(v){\n \n if(_this.form.findField('password').getValue() == v) {\n \n return true;\n }\n \n return false;\n}" + "String indicatorpos" : "right" } ] } @@ -139,7 +150,7 @@ "items" : [ { "xtype" : "Column", - "Number xs" : 8, + "Number xs" : 12, "$ xns" : "Roo.bootstrap", "items" : [ { @@ -149,7 +160,7 @@ "$ xns" : "Roo.bootstrap" }, { - "String name" : "verify_key", + "String name" : "authorized_key", "xtype" : "Input", "String inputType" : "hidden", "$ xns" : "Roo.bootstrap" @@ -162,48 +173,12 @@ }, { "listeners" : { - "render" : "function (_self)\n{\n _this.error_row = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}" - }, - "xtype" : "Row", - "$ xns" : "Roo.bootstrap", - "items" : [ - { - "xtype" : "Column", - "Number xs" : 12, - "$ xns" : "Roo.bootstrap", - "items" : [ - { - "listeners" : { - "render" : "function (_self)\n{\n _this.text_el = _self;\n}" - }, - "xtype" : "Element", - "$ xns" : "Roo.bootstrap", - "String html" : "" - } - ] - } - ] - }, - { - "listeners" : { - "render" : "function (_self)\n{\n _this.btn_ok = _self;\n}", - "click" : "function (_self, e)\n{\n if(!_this.form.isValid()){\n return;\n }\n \n var p1 = _this.form.findField('password').getValue();\n var p2 = _this.form.findField('password1').getValue();\n \n if (p1 != p2) {\n _this.form.findField('password1').markInvalid('Password do not match');\n return;\n }\n \n _this.dialog.el.mask('Sending...');\n _this.form.doAction('submit');\n \n}" - }, - "String weight" : "primary", - "xtype" : "Button", - "$ xns" : "Roo.bootstrap", - "String html" : "Start the application process ", - "* prop" : "buttons[]" - }, - { - "listeners" : { - "render" : "function (_self)\n{\n _this.btn_resend = _self;\n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n this.el.hide();\n}", - "click" : "function (_self, e)\n{\n var path = window.location.pathname.split('/');\n \n var verify_key = path.pop();\n \n var id = path.pop();\n \n new Pman.Request({\n url: baseURL + '/Roo/Coba_application_signup',\n method : 'POST',\n mask : 'Sending...',\n params : {\n _resend : id\n }, \n success : function(res) {\n var msg = \"We have re-sent you an invitation via email.\" +\n \"

\" + \n \"Please check your inbox for the final registration step.\" + \n \"

\" + \n \"(Note. emails may accidentally be sent to your Spam Folder)\";\n \n Roo.bootstrap.MessageBox.alert('Please check your email', msg) ;\n },\n failure: function(res) {\n Roo.bootstrap.MessageBox.alert('Error', res.errorMsg) ;\n }\n });\n}" + "click" : "function (_self, e)\n{\n if(!_this.form.isValid()){\n return;\n }\n\n _this.dialog.el.mask('Sending...');\n _this.form.doAction('submit');\n \n}" }, "String weight" : "primary", "xtype" : "Button", "$ xns" : "Roo.bootstrap", - "String html" : "Resend email", + "String html" : "Confirm", "* prop" : "buttons[]" } ]