Pman.Dialog.BAdminStaff.bjs
authorEdward <edward@roojs.com>
Fri, 7 Dec 2018 03:59:36 +0000 (11:59 +0800)
committerEdward <edward@roojs.com>
Fri, 7 Dec 2018 03:59:36 +0000 (11:59 +0800)
Pman.Dialog.BAdminStaff.js

Pman.Dialog.BAdminStaff.bjs
Pman.Dialog.BAdminStaff.js

index 846c745..82e5b82 100644 (file)
                 {
                  "listeners" : {
                   "check" : "function (_self, checked)\n{\n    if(checked) {\n        \n        this.setBoxLabel('Untick to disable Two Factor authentication');\n        \n        return;\n    }\n    \n    this.setBoxLabel('Enable Two Factor Authentication');\n}",
-                  "click" : "function (_self, e)\n{\n    if(!Pman.Login.authUser) {\n        Roo.bootstrap.MessageBox.alert('Error', 'Please login again');\n        return;\n    }\n    \n    e.preventDefault();\n    \n    if(!this.checked) {\n        \n        Pman.Dialog.BAdminStaffTwoFactorQRCode.show(\n            {id: _this.data.id},\n            function(valid){\n               if(valid) {\n                    _this.dialog.hide({});\n                    return;\n                }\n                \n                _this.form.findField('_enable_oath_key').setChecked(false,false);\n            }\n        );\n        \n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/Core_person',\n        method :'GET',\n        params : {\n            oath_key_disable: 1,\n            id: _this.data.id\n        },\n        success : function(res)\n        {\n            switch(res.data) {\n                case 'DONE':\n                    Roo.bootstrap.MessageBox.alert('Success', 'The two factor authentication has been disabled');\n                    break;\n                default:\n                    Roo.log('invalid usage');\n                    break;\n            }\n        },\n        failure : function(res)\n        {\n            Roo.bootstrap.MessageBox.alert('Error', res);\n        }\n    });\n}"
+                  "click" : "function (_self, e)\n{\n    if(!Pman.Login.authUser) {\n        Roo.bootstrap.MessageBox.alert('Error', 'Please login again');\n        return;\n    }\n    \n    e.preventDefault();\n    \n    if(!this.checked) {\n        \n        Pman.Dialog.BAdminStaffTwoFactorQRCode.show({\n            id: _this.data.id,\n            allow_close: false,\n            allow_cancel : true\n        }, function(valid){\n               if(valid) {\n                    _this.dialog.hide({});\n                    return;\n                }\n                \n                _this.form.findField('_enable_oath_key').setChecked(false,false);\n            }\n        );\n        \n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/Core_person',\n        method :'GET',\n        params : {\n            oath_key_disable: 1,\n            id: _this.data.id\n        },\n        success : function(res)\n        {\n            switch(res.data) {\n                case 'DONE':\n                    Roo.bootstrap.MessageBox.alert('Success', 'The two factor authentication has been disabled');\n                    break;\n                default:\n                    Roo.log('invalid usage');\n                    break;\n            }\n        },\n        failure : function(res)\n        {\n            Roo.bootstrap.MessageBox.alert('Error', res);\n        }\n    });\n}"
                  },
                  "String name" : "_enable_oath_key",
                  "xtype" : "CheckBox",
index f75c2f1..84487f3 100644 (file)
@@ -415,9 +415,11 @@ Roo.apply(Pman.Dialog.BAdminStaff.prototype, {
                         
                         if(!this.checked) {
                             
-                            Pman.Dialog.BAdminStaffTwoFactorQRCode.show(
-                                {id: _this.data.id},
-                                function(valid){
+                            Pman.Dialog.BAdminStaffTwoFactorQRCode.show({
+                                id: _this.data.id,
+                                allow_close: false,
+                                allow_cancel : true
+                            }, function(valid){
                                    if(valid) {
                                         _this.dialog.hide({});
                                         return;