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