Pman.Dialog.BAdminPassword.bjs
authorjohn <john@roojs.com>
Wed, 10 Oct 2018 07:27:21 +0000 (15:27 +0800)
committerjohn <john@roojs.com>
Wed, 10 Oct 2018 07:27:21 +0000 (15:27 +0800)
Pman.Dialog.BAdminPassword.js

Pman.Dialog.BAdminPassword.bjs
Pman.Dialog.BAdminPassword.js

index 1b4cfc9..e32ccab 100644 (file)
@@ -57,7 +57,7 @@
       {
        "listeners" : {
         "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}",
-        "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').hide();\n        \n        if(\n            Pman.Login.authUser &&\n            Pman.Login.authUser.disable_oath\n        ){\n            return;\n        }\n        \n        \n        _this.form.findField('_enable_oath_key').setChecked(false,false);\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,false);\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}",
+        "actioncomplete" : "function (_self, action)\n{\n    if(action.type == 'setdata'){\n        \n        _this.form.reset();\n        \n        _this.form.clearInvalid();\n        \n        \n        \n        if(\n            Pman.Login.authUser &&\n            Pman.Login.authUser.disable_oath\n        ){\n            _this.form.findField('_enable_oath_key').hide();\n            return;\n        }\n        \n        \n        _this.form.findField('_enable_oath_key').setChecked(false,false);\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,false);\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}",
         "render" : "function (_self)\n{\n    _this.form = this;\n}"
        },
        "$ url" : "baseURL+'/Login'",
index cc0d8cc..191bca1 100644 (file)
@@ -141,12 +141,13 @@ Roo.apply(Pman.Dialog.BAdminPassword.prototype, {
                   
                   _this.form.clearInvalid();
                   
-                  _this.form.findField('_enable_oath_key').hide();
+                  
                   
                   if(
                       Pman.Login.authUser &&
                       Pman.Login.authUser.disable_oath
                   ){
+                      _this.form.findField('_enable_oath_key').hide();
                       return;
                   }