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