Pman.Dialog.BAdminPasswordReset.bjs
authorAlan Knowles <alan@roojs.com>
Fri, 7 Dec 2018 02:57:57 +0000 (10:57 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 7 Dec 2018 02:57:57 +0000 (10:57 +0800)
Pman.Dialog.BAdminPasswordReset.js

Pman.Dialog.BAdminPasswordReset.bjs
Pman.Dialog.BAdminPasswordReset.js

index 80289ec..490b4e0 100644 (file)
@@ -68,7 +68,7 @@
          "listeners" : {
           "|render" : "function (_self) {\n    _this.form = _self;\n}",
           "|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}",
-          "|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        \n        if (_this.callback) {\n            _this.callback.call(_this, action.result);\n        }\n        \n        _this.form.reset();\n        \n        return;\n        \n    }\n}"
+          "|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}"
          },
          "$ url" : "baseURL + '/Login'",
          "labelAlign" : "top",
index ab3a367..d161d3d 100644 (file)
@@ -176,12 +176,18 @@ Roo.apply(Pman.Dialog.BAdminPasswordReset.prototype, {
                 if (action.type =='submit') {
                     
                     _this.dialog.hide();
+                    _this.form.reset();        
+                    Roo.MessageBox.alert("Great", "We have successfully updated your password, please use it to login now",
+                       function() {
+                            if (_this.callback) {
+                                _this.callback.call(_this, action.result);
+                            }
+                            
+                        }
+                    );
                     
-                    if (_this.callback) {
-                        _this.callback.call(_this, action.result);
-                    }
                     
-                    _this.form.reset();
+            
                     
                     return;