PHP8
[Pman.BAdmin] / Pman.Dialog.BAdminPasswordReset.bjs
1 {
2  "name" : "Pman.Dialog.BAdminPasswordReset",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/Pman.BAdmin/Pman.Dialog.BAdminPasswordReset.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "acd43bedab51b6704bf10d9ac136a032" : "Reset management password",
10   "10ac3d04253ef7e1ddc73e6091c0cd55" : "Next",
11   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
12   "bbddd6ba0948d79e55486e615a265b56" : "Enter your new password",
13   "c4ca4238a0b923820dcc509a6f75849b" : "1",
14   "6d70a993714d2699e1d30e03d2753850" : "Please enter again to confirm"
15  },
16  "named_strings" : {
17   "ResetPassword_value" : "c4ca4238a0b923820dcc509a6f75849b",
18   "ok_html" : "10ac3d04253ef7e1ddc73e6091c0cd55",
19   "cancel_html" : "ea4788705e6873b424c65e91c2846b19",
20   "password2_fieldLabel" : "6d70a993714d2699e1d30e03d2753850",
21   "password1_fieldLabel" : "bbddd6ba0948d79e55486e615a265b56"
22  },
23  "items" : [
24   {
25    "listeners" : {
26     "show" : "function (_self)\n{\n    _this.dialog.el.select('.modal-content', true).first().unmask();\n    var p1 =     _this.form.findField('password1');\n    p1.focus.defer(100, p1);\n}"
27    },
28    "String cls" : "enable-overflow roo-bootstrap-dialog",
29    "Boolean animate" : false,
30    "Boolean allow_close" : false,
31    "title" : "Reset management password",
32    "xtype" : "Modal",
33    "buttonPosition" : "center",
34    "$ xns" : "Roo.bootstrap",
35    "items" : [
36     {
37      "listeners" : {
38       "click" : "function (_self, e)\n{\n    _this.callback.call(_this, false);\n}"
39      },
40      "String weight" : "default",
41      "xtype" : "Button",
42      "$ xns" : "Roo.bootstrap",
43      "String html" : "Cancel",
44      "* prop" : "buttons[]",
45      "string name" : "cancel"
46     },
47     {
48      "listeners" : {
49       "click" : "function (_self, e)\n{\n    _this.dialog.el.select('.modal-content', true).first().mask('Sending...');\n    _this.form.doAction('submit');\n}"
50      },
51      "String weight" : "primary",
52      "xtype" : "Button",
53      "$ xns" : "Roo.bootstrap",
54      "String html" : "Next",
55      "* prop" : "buttons[]",
56      "string name" : "ok"
57     },
58     {
59      "xtype" : "Row",
60      "$ xns" : "Roo.bootstrap",
61      "items" : [
62       {
63        "xtype" : "Container",
64        "cls" : "col-md-12",
65        "$ xns" : "Roo.bootstrap",
66        "items" : [
67         {
68          "listeners" : {
69           "|render" : "function (_self) {\n    _this.form = _self;\n}",
70           "|actionfailed" : "function (_self, action) {\n\n    Roo.log('action fail?');\n    Roo.log(action);\n    \n    _this.dialog.el.select('.modal-content', true).first().unmask();\n    \n    var err = 'Fill in all the required fields';\n    \n    if (typeof(action) != 'undefined' && action.failureType == 'server') {\n        err = action.result.errorMsg;\n    }\n    \n    Roo.bootstrap.MessageBox.alert('Error', err);\n}",
71           "|actioncomplete" : "function (_self, action) {\n\n    if (action.type == 'setdata') {\n        \n        var pathname = window.location.pathname.split('PasswordReset/');\n        \n        if(typeof(pathname[1]) == 'undefined'){\n            return;\n        }\n        \n        var data = pathname[1].split('/');\n        \n        if(data.length != 3){\n            _this.dialog.hide();\n            Roo.bootstrap.MessageBox.alert('Sorry', 'Account reset link is not correct - please try again or paste the link correctly');\n            return;\n        }\n        \n        _this.form.findField('id').setValue(data[0]);\n        _this.form.findField('ts').setValue(data[1]);\n        _this.form.findField('key').setValue(data[2]);\n    \n        _this.form.clearInvalid();\n    \n        _this.form.verifyCheckSum();\n        \n        return;\n    }\n    if (action.type == 'load') {\n         \n        return;\n    }\n    if (action.type =='submit') {\n        \n        _this.dialog.hide();\n        _this.form.reset();        \n        Roo.MessageBox.alert(\"Great\", \"We have successfully updated your password, please use it to login now\",\n           function() {\n                if (_this.callback) {\n                    _this.callback.call(_this, action.result);\n                }\n                \n            }\n        );\n        \n        \n\n        \n        return;\n        \n    }\n}"
72          },
73          "$ url" : "baseURL + '/Login'",
74          "labelAlign" : "top",
75          "xtype" : "Form",
76          "method" : "POST",
77          "| function verifyCheckSum" : "function() \n{ \n    _this.dialog.hide();\n    \n    new Pman.Request({\n        url: baseURL + '/Login',\n        method : 'POST',\n        mask : 'Verifying...',\n        params : {\n            id : _this.form.findField('id').getValue(),\n            ts : _this.form.findField('ts').getValue(),\n            key : _this.form.findField('key').getValue(),\n            _verifyCheckSum : 1\n        },\n        success : function(res) {\n            _this.dialog.show();\n        },\n        failure : function(res)\n        {\n            Roo.log(res);\n            Roo.MessageBox.alert(\"Sorry\", res.message, function() {\n                _this.callback(false,false);\n            });\n            \n        }\n    });\n}",
78          "$ xns" : "Roo.bootstrap",
79          "Boolean loadMask" : false,
80          "String style" : "padding: 10px;",
81          "items" : [
82           {
83            "xtype" : "Row",
84            "$ xns" : "Roo.bootstrap",
85            "items" : [
86             {
87              "xtype" : "Column",
88              "Number xs" : 12,
89              "$ xns" : "Roo.bootstrap",
90              "items" : [
91               {
92                "listeners" : {
93                 "specialkey" : "function (_self, e)\n{\n    if(e.getKey() == 13){\n        _this.dialog.el.select('.modal-content', true).first().mask('Sending...');\n        _this.form.doAction('submit');\n    }\n}"
94                },
95                "inputType" : "password",
96                "xtype" : "Input",
97                "allowBlank" : false,
98                "$ xns" : "Roo.bootstrap",
99                "String fieldLabel" : "Enter your new password",
100                "name" : "password1"
101               },
102               {
103                "listeners" : {
104                 "specialkey" : "function (_self, e)\n{\n    if(e.getKey() == 13){\n        _this.dialog.el.select('.modal-content', true).first().mask('Sending...');\n        _this.form.doAction('submit');\n    }\n}"
105                },
106                "inputType" : "password",
107                "xtype" : "Input",
108                "allowBlank" : false,
109                "$ xns" : "Roo.bootstrap",
110                "String fieldLabel" : "Please enter again to confirm",
111                "name" : "password2"
112               },
113               {
114                "String name" : "id",
115                "xtype" : "Input",
116                "String inputType" : "hidden",
117                "$ xns" : "Roo.bootstrap"
118               },
119               {
120                "String name" : "ts",
121                "xtype" : "Input",
122                "String inputType" : "hidden",
123                "$ xns" : "Roo.bootstrap"
124               },
125               {
126                "String name" : "key",
127                "xtype" : "Input",
128                "String inputType" : "hidden",
129                "$ xns" : "Roo.bootstrap"
130               },
131               {
132                "String name" : "ResetPassword",
133                "xtype" : "Input",
134                "String inputType" : "hidden",
135                "$ xns" : "Roo.bootstrap",
136                "string value" : 1
137               }
138              ]
139             }
140            ]
141           }
142          ]
143         }
144        ]
145       }
146      ]
147     }
148    ]
149   }
150  ]
151 }