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   "b945ed1d61d8edbe16a1192ad6d2fd58" : "Please enter a memorable password for logging into your application",
12   "f6039d44b29456b20f8f373155ae4973" : "Username",
13   "51eea3dc60ae3a0b1bb8188bc6337dc2" : "enter password",
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            "xtype" : "FieldLabel",
76            "$ xns" : "Roo.bootstrap",
77            "String html" : "Please enter a memorable password for logging into your application"
78           }
79          ]
80         }
81        ]
82       },
83       {
84        "listeners" : {
85         "render" : "function (_self)\n{\n    _this.row_pwd1 = _self;\n}"
86        },
87        "xtype" : "Row",
88        "$ xns" : "Roo.bootstrap",
89        "items" : [
90         {
91          "xtype" : "Column",
92          "Number xs" : 12,
93          "$ xns" : "Roo.bootstrap",
94          "items" : [
95           {
96            "Boolean allowBlank" : false,
97            "String name" : "password",
98            "xtype" : "SecurePass",
99            "String labelAlign" : "top",
100            "string placeholder" : "enter password",
101            "String inputType" : "password",
102            "$ xns" : "Roo.bootstrap"
103           }
104          ]
105         }
106        ]
107       },
108       {
109        "listeners" : {
110         "render" : "function (_self)\n{\n    _this.row_pwd2 = _self;\n}"
111        },
112        "xtype" : "Row",
113        "$ xns" : "Roo.bootstrap",
114        "items" : [
115         {
116          "xtype" : "Column",
117          "Number xs" : 12,
118          "$ xns" : "Roo.bootstrap",
119          "items" : [
120           {
121            "Boolean allowBlank" : false,
122            "string invalidText" : "The passwords you entered do not match",
123            "String name" : "password1",
124            "xtype" : "Input",
125            "string placeholder" : "Please confirm your password",
126            "String inputType" : "password",
127            "$ xns" : "Roo.bootstrap",
128            "$ Function validator" : "function(v){\n    \n    if(_this.form.findField('password').getValue() == v) {\n        \n        return true;\n    }\n    \n    return false;\n}"
129           }
130          ]
131         }
132        ]
133       },
134       {
135        "xtype" : "Row",
136        "$ xns" : "Roo.bootstrap",
137        "items" : [
138         {
139          "xtype" : "Column",
140          "Number xs" : 8,
141          "$ xns" : "Roo.bootstrap",
142          "items" : [
143           {
144            "String name" : "id",
145            "xtype" : "Input",
146            "String inputType" : "hidden",
147            "$ xns" : "Roo.bootstrap"
148           },
149           {
150            "String name" : "authorized_key",
151            "xtype" : "Input",
152            "String inputType" : "hidden",
153            "$ xns" : "Roo.bootstrap"
154           }
155          ]
156         }
157        ]
158       }
159      ]
160     },
161     {
162      "listeners" : {
163       "render" : "function (_self)\n{\n    _this.error_row = this;\n    \n    this.el.setVisibilityMode(Roo.Element.DISPLAY);\n    \n    this.el.hide();\n}"
164      },
165      "xtype" : "Row",
166      "$ xns" : "Roo.bootstrap",
167      "items" : [
168       {
169        "xtype" : "Column",
170        "Number xs" : 12,
171        "$ xns" : "Roo.bootstrap",
172        "items" : [
173         {
174          "listeners" : {
175           "render" : "function (_self)\n{\n    _this.text_el = _self;\n}"
176          },
177          "xtype" : "Element",
178          "$ xns" : "Roo.bootstrap",
179          "String html" : ""
180         }
181        ]
182       }
183      ]
184     },
185     {
186      "listeners" : {
187       "render" : "function (_self)\n{\n    _this.btn_ok = _self;\n}",
188       "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}"
189      },
190      "String weight" : "primary",
191      "xtype" : "Button",
192      "$ xns" : "Roo.bootstrap",
193      "String html" : "Start the application process   ",
194      "* prop" : "buttons[]"
195     },
196     {
197      "listeners" : {
198       "render" : "function (_self)\n{\n    _this.btn_resend = _self;\n     this.el.setVisibilityMode(Roo.Element.DISPLAY);\n     this.el.hide();\n}",
199       "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}"
200      },
201      "String weight" : "primary",
202      "xtype" : "Button",
203      "$ xns" : "Roo.bootstrap",
204      "String html" : "Resend email",
205      "* prop" : "buttons[]"
206     }
207    ]
208   }
209  ]
210 }