Pman.Dialog.BAdminPassword.bjs
[Pman.BAdmin] / Pman.Dialog.BAdminPassword.bjs
1 {
2  "name" : "Pman.Dialog.BAdminPassword",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/john/gitlive/web.coba/Pman/BAdmin/Pman.Dialog.BAdminPassword.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "9182ecb4943f2724adde82c820702555" : "Retype New Password",
10   "8f1e77e0d2be21da93cd4d9a939148f7" : "Change Password",
11   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
12   "ae3bb2a1ac61750150b606298091d38a" : "New Password",
13   "51eea3dc60ae3a0b1bb8188bc6337dc2" : "enter password",
14   "bb78dd7992509064b8044b7afe6ec9ed" : "Update Password",
15   "828e70f83623b262e14187c039df99c0" : "Enable Two-Factor Authentication"
16  },
17  "named_strings" : {
18   "changePassword_placeholder" : "51eea3dc60ae3a0b1bb8188bc6337dc2",
19   "passwd2_fieldLabel" : "9182ecb4943f2724adde82c820702555",
20   "passwd1_fieldLabel" : "ae3bb2a1ac61750150b606298091d38a",
21   "_enable_oath_key_boxLabel" : "828e70f83623b262e14187c039df99c0"
22  },
23  "items" : [
24   {
25    "listeners" : {
26     "show" : "function (_self)\n{\n    _this.form_pw.fireEvent('actioncomplete', _this.form,  { type: 'setdata', data: data });\n}"
27    },
28    "String cls" : "enable-overflow",
29    "xtype" : "Modal",
30    "$ xns" : "Roo.bootstrap",
31    "String title" : "Change Password",
32    "items" : [
33     {
34      "listeners" : {
35       "render" : "function (_self)\n{\n    _this.cancel_btn = this;\n}",
36       "click" : "function (_self, e)\n{\n    _this.dialog.hide({});\n}"
37      },
38      "xtype" : "Button",
39      "$ xns" : "Roo.bootstrap",
40      "String html" : "Cancel",
41      "* prop" : "buttons[]"
42     },
43     {
44      "listeners" : {
45       "render" : "function (_self)\n{\n    _this.submit_button = this;\n}",
46       "click" : "function (_self, e)\n{\n    var p1 = _this.form.findField('passwd1').getValue();\n    var p2 = _this.form.findField('passwd2').getValue();\n    \n    if(\n        !p1.length ||\n        !p2.length ||\n        p1 !== p2\n    ) {\n        Roo.bootstrap.MessageBox.alert(\"Error\", \"Passwords do not match\");\n        return;\n    }\n    \n    _this.form.findField('changePassword').setValue(1);\n    \n    this.changeStatus('submit');\n    \n    _this.form.doAction('submit');\n}"
47      },
48      "String weight" : "primary",
49      "xtype" : "Button",
50      "| function changeStatus" : "function(status)\n{\n    switch(status) {\n        \n        case 'submit':\n            this.disable();\n            this.setText('sending...');\n            break;\n            \n        case 'loaded':\n            this.enable();\n            this.setText('OK');\n            break;\n        \n        default:\n            break;\n    }\n}",
51      "$ xns" : "Roo.bootstrap",
52      "String html" : "Update Password",
53      "* prop" : "buttons[]"
54     },
55     {
56      "xtype" : "Container",
57      "$ xns" : "Roo.bootstrap",
58      "String style" : "width: 100%",
59      "items" : [
60       {
61        "listeners" : {
62         "actionfailed" : "function (_self, action)\n{\n    if (action.type =='submit') {\n        \n        _this.submit_button.changeStatus('loaded');\n        \n        if (_this.callback) {\n            _this.callback.call(_this, action.result);\n        }\n    }\n}",
63         "actioncomplete" : "function (_self, action)\n{\n    if(action.type == 'setdata'){\n        \n        _this.form.reset();\n        \n        _this.form.clearInvalid();\n        \n        _this.form.findField('_enable_oath_key').setChecked(false,true);\n       \n        new Pman.Request({\n            url: baseURL + '/Login.php',\n            method: 'POST',\n            params: {\n                getAuthUser: true\n            }, \n            success: function(res) {\n                \n                if(res.data.oath_key_enable) {\n                    _this.form.findField('_enable_oath_key').setChecked(true,true);\n                }\n            }\n        });\n    }\n    \n    if (action.type == 'load') {\n        \n        Roo.log('invalid usage');\n    }\n    \n    if (action.type =='submit') {\n        \n        if (_this.callback) {\n            _this.callback.call(_this, action.result);\n        }\n        \n        _this.form.reset();\n        \n        _this.submit_button.changeStatus('loaded');\n        \n        _this.dialog.hide({});\n        \n        return;\n    }\n}",
64         "render" : "function (_self)\n{\n    _this.form_pw = this;\n}"
65        },
66        "$ url" : "baseURL+'/Login'",
67        "xtype" : "Form",
68        "$ xns" : "Roo.bootstrap",
69        "String method" : "POST",
70        "items" : [
71         {
72          "xtype" : "Row",
73          "$ xns" : "Roo.bootstrap",
74          "items" : [
75           {
76            "xtype" : "Column",
77            "Number xs" : 12,
78            "$ xns" : "Roo.bootstrap",
79            "items" : [
80             {
81              "listeners" : {
82               "change" : "function (_self, newValue, oldValue)\n{\n    _this.form.findField('passwd2').markInvalid();\n}"
83              },
84              "Boolean allowBlank" : false,
85              "String name" : "passwd1",
86              "xtype" : "Input",
87              "String labelAlign" : "top",
88              "string fieldLabel" : "New Password",
89              "String inputType" : "password",
90              "$ xns" : "Roo.bootstrap"
91             },
92             {
93              "listeners" : {
94               "valid" : "function (_self)\n{\n    if (_this.form.findField('passwd1').getValue() !== _this.form.findField('passwd2').getValue()){\n        _this.form.findField('passwd2').markInvalid();\n    }\n}"
95              },
96              "Boolean allowBlank" : false,
97              "String name" : "passwd2",
98              "xtype" : "Input",
99              "String labelAlign" : "top",
100              "string fieldLabel" : "Retype New Password",
101              "String inputType" : "password",
102              "$ xns" : "Roo.bootstrap"
103             },
104             {
105              "Boolean allowBlank" : false,
106              "String name" : "changePassword",
107              "xtype" : "Input",
108              "string placeholder" : "enter password",
109              "String labelAlign" : "top",
110              "String inputType" : "hidden",
111              "$ xns" : "Roo.bootstrap"
112             },
113             {
114              "listeners" : {
115               "check" : "function (_self, checked)\n{\n    // keep firing when showing a dialog with checked checkbox...\n    \n    Roo.log(_this.dialog.getEl().isVisible());\n    \n    if(!_this.dialog.getEl().isVisible()) {\n        return;\n    }\n\n    if(checked) {\n        \n        Roo.log('who keep firing the check....');\n        \n        Pman.Dialog.BAdminStaffTwoFactorQRCode.show({});\n        \n        this.setBoxLabel('Untick to disable Two Factor authentication');\n        \n        return;\n    }\n    \n    this.setBoxLabel('Enable Two Factor Authentication');\n}"
116              },
117              "String name" : "_enable_oath_key",
118              "Boolean checked" : false,
119              "xtype" : "CheckBox",
120              "String boxLabel" : "Enable Two-Factor Authentication",
121              "$ xns" : "Roo.bootstrap"
122             }
123            ]
124           }
125          ]
126         }
127        ]
128       }
129      ]
130     }
131    ]
132   }
133  ]
134 }