Pman.Dialog.VerifyAccess.bjs
[Pman.Core] / Pman.Dialog.VerifyAccess.bjs
1 {
2  "name" : "Pman.Dialog.VerifyAccess",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/edward/gitlive/Pman.Core/Pman.Dialog.VerifyAccess.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "e2c9d024b79dfb48b42a7807206c6aed" : "Verify New IP Access",
10   "d41d8cd98f00b204e9800998ecf8427e" : "",
11   "f6039d44b29456b20f8f373155ae4973" : "Username",
12   "51eea3dc60ae3a0b1bb8188bc6337dc2" : "enter password",
13   "dfb790522fdea3859af206d32916fe77" : "User Agent",
14   "1849ffc8731b5e74ae6157c91ba73575" : "Please confirm your password",
15   "d71940f24ee38ee09f6e06b908480bcf" : "Resend email",
16   "14cf5e829f5cb6fbf8cb54f7c5ff4ca9" : "Start the application process   "
17  },
18  "items" : [
19   {
20    "listeners" : {
21     "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            Roo.log(res);\n            return;\n            _this.form.setValues(res.data);\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}"
22    },
23    "String cls" : "enable-overflow",
24    "Boolean allow_close" : false,
25    "xtype" : "Modal",
26    "$ xns" : "Roo.bootstrap",
27    "String title" : "Verify New IP Access",
28    "items" : [
29     {
30      "listeners" : {
31       "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}",
32       "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}",
33       "render" : "function (_self,e)\n{\n    _this.form = _self;\n    \n}"
34      },
35      "$ string url" : "baseURL + '/Core/VerifyAccess'",
36      "Boolean errorMask" : true,
37      "xtype" : "Form",
38      "$ xns" : "Roo.bootstrap",
39      "Boolean loadMask" : false,
40      "items" : [
41       {
42        "xtype" : "Row",
43        "$ xns" : "Roo.bootstrap",
44        "items" : [
45         {
46          "xtype" : "Column",
47          "Number xs" : 12,
48          "$ xns" : "Roo.bootstrap",
49          "items" : [
50           {
51            "String name" : "email",
52            "Boolean readOnly" : true,
53            "xtype" : "Input",
54            "string fieldLabel" : "Username",
55            "String labelAlign" : "top",
56            "$ xns" : "Roo.bootstrap"
57           }
58          ]
59         }
60        ]
61       },
62       {
63        "listeners" : {
64         "render" : "function (_self)\n{\n    _this.row_pwd_label = _self;\n}"
65        },
66        "xtype" : "Row",
67        "$ xns" : "Roo.bootstrap",
68        "items" : [
69         {
70          "xtype" : "Column",
71          "Number xs" : 12,
72          "$ xns" : "Roo.bootstrap",
73          "items" : [
74           {
75            "String name" : "user_agent",
76            "Boolean readOnly" : true,
77            "xtype" : "TextArea",
78            "string fieldLabel" : "User Agent",
79            "$ xns" : "Roo.bootstrap"
80           }
81          ]
82         }
83        ]
84       },
85       {
86        "listeners" : {
87         "render" : "function (_self)\n{\n    _this.row_pwd1 = _self;\n}"
88        },
89        "xtype" : "Row",
90        "$ xns" : "Roo.bootstrap",
91        "items" : [
92         {
93          "xtype" : "Column",
94          "Number xs" : 12,
95          "$ xns" : "Roo.bootstrap",
96          "items" : [
97           {
98            "Boolean allowBlank" : false,
99            "String name" : "password",
100            "xtype" : "SecurePass",
101            "String labelAlign" : "top",
102            "string placeholder" : "enter password",
103            "String inputType" : "password",
104            "$ xns" : "Roo.bootstrap"
105           }
106          ]
107         }
108        ]
109       },
110       {
111        "listeners" : {
112         "render" : "function (_self)\n{\n    _this.row_pwd2 = _self;\n}"
113        },
114        "xtype" : "Row",
115        "$ xns" : "Roo.bootstrap",
116        "items" : [
117         {
118          "xtype" : "Column",
119          "Number xs" : 12,
120          "$ xns" : "Roo.bootstrap",
121          "items" : [
122           {
123            "Boolean allowBlank" : false,
124            "string invalidText" : "The passwords you entered do not match",
125            "String name" : "password1",
126            "xtype" : "Input",
127            "string placeholder" : "Please confirm your password",
128            "String inputType" : "password",
129            "$ xns" : "Roo.bootstrap",
130            "$ Function validator" : "function(v){\n    \n    if(_this.form.findField('password').getValue() == v) {\n        \n        return true;\n    }\n    \n    return false;\n}"
131           }
132          ]
133         }
134        ]
135       },
136       {
137        "xtype" : "Row",
138        "$ xns" : "Roo.bootstrap",
139        "items" : [
140         {
141          "xtype" : "Column",
142          "Number xs" : 8,
143          "$ xns" : "Roo.bootstrap",
144          "items" : [
145           {
146            "String name" : "id",
147            "xtype" : "Input",
148            "String inputType" : "hidden",
149            "$ xns" : "Roo.bootstrap"
150           },
151           {
152            "String name" : "authorized_key",
153            "xtype" : "Input",
154            "String inputType" : "hidden",
155            "$ xns" : "Roo.bootstrap"
156           }
157          ]
158         }
159        ]
160       }
161      ]
162     },
163     {
164      "listeners" : {
165       "render" : "function (_self)\n{\n    _this.error_row = this;\n    \n    this.el.setVisibilityMode(Roo.Element.DISPLAY);\n    \n    this.el.hide();\n}"
166      },
167      "xtype" : "Row",
168      "$ xns" : "Roo.bootstrap",
169      "items" : [
170       {
171        "xtype" : "Column",
172        "Number xs" : 12,
173        "$ xns" : "Roo.bootstrap",
174        "items" : [
175         {
176          "listeners" : {
177           "render" : "function (_self)\n{\n    _this.text_el = _self;\n}"
178          },
179          "xtype" : "Element",
180          "$ xns" : "Roo.bootstrap",
181          "String html" : ""
182         }
183        ]
184       }
185      ]
186     },
187     {
188      "listeners" : {
189       "render" : "function (_self)\n{\n    _this.btn_ok = _self;\n}",
190       "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}"
191      },
192      "String weight" : "primary",
193      "xtype" : "Button",
194      "$ xns" : "Roo.bootstrap",
195      "String html" : "Start the application process   ",
196      "* prop" : "buttons[]"
197     },
198     {
199      "listeners" : {
200       "render" : "function (_self)\n{\n    _this.btn_resend = _self;\n     this.el.setVisibilityMode(Roo.Element.DISPLAY);\n     this.el.hide();\n}",
201       "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                        \"<br/><br/>\" + \n                        \"Please check your inbox for the final registration step.\" + \n                         \"<br/><br/>\" + \n                        \"<B>(Note. emails may accidentally be sent to your Spam Folder)</B>\";\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}"
202      },
203      "String weight" : "primary",
204      "xtype" : "Button",
205      "$ xns" : "Roo.bootstrap",
206      "String html" : "Resend email",
207      "* prop" : "buttons[]"
208     }
209    ]
210   }
211  ]
212 }