Pman.Dialog.Login.bjs
authorAlan Knowles <alan@roojs.com>
Fri, 14 Dec 2018 04:31:10 +0000 (12:31 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 14 Dec 2018 04:31:10 +0000 (12:31 +0800)
Pman.Dialog.Login.js

Pman.Dialog.Login.bjs
Pman.Dialog.Login.js

index 55435fc..ab93e4f 100644 (file)
@@ -7,7 +7,6 @@
  "modOrder" : "001",
  "strings" : {
   "e50b62fb8271673bacc2cfd9d80fbe7a" : "Login to the Management Portal",
-  "e81e237c94a1f073504ab372b1b7fc41" : "Please check your email",
   "99dea78007133396a7b8ed70578ac6ae" : "Login",
   "cfcd208495d565ef66e7dff9f98764da" : "0",
   "cd4bcecae78474ea24c3f28350758a8c" : "Forgot your password ?",
@@ -15,6 +14,7 @@
   "06cf692a8d2bb0ab8318dc6c839ae931" : "Two-Factor Authentication Number (if relevant)",
   "11163ed17ad9afc7680bb9e92f15d6fd" : "We have sent you a link to reset your password",
   "5047040b025ce0295b58d42250014417" : "<div id=\"login-err\" class=\"dialog-err\" style=\"color:red\"></div>",
+  "24efa7ee4511563b16144f39706d594f" : "Notice",
   "643a860f992333b8600ea264aca7c4fc" : "Email Address"
  },
  "named_strings" : {
@@ -61,9 +61,9 @@
            "items" : [
             {
              "listeners" : {
-              "|render" : "function (_self) {\n    _this.form = _self;\n}",
               "|actionfailed" : "function (_self, action) {\n    Roo.log('action failed?!');\n    Roo.log(action);\n    \n    _this.dialog.el.select('.modal-content', true).first().unmask();\n    \n    if (typeof(action) != 'undefined' && action.failureType == 'server') {\n        \n        switch (action.result.errorMsg) {\n                    \n            case 'Authenticated' :\n                \n                var data = Roo.apply(action.result.errors);\n                \n                data.target = _this.form.findField('username').getValue();\n                \n                Roo.bootstrap.MessageBox.alert(\"Error\", \"odd error messages\");\n                \n                break;\n                \n            case 'NEW-IP-ADDRESS' :\n            case 'PENDING-IP-ADDRESS' :\n            case 'BAD-IP-ADDRESS' :\n            case 'BLOCKED-IP-ADDRESS' :\n                \n                _this.dialog.hide();\n                \n                Pman.Dialog.LoginNotice.show({\n                    status : action.result.errorMsg,\n                    ip : action.result.errors.ip\n                });\n                \n                break;\n                \n            default:\n               _this.errorRow.show();\n                Roo.get('login-err').dom.innerHTML = action.result.errorMsg;\n                break;\n        }\n        \n        return;\n    }\n    \n    Roo.get('login-err').dom.innerHTML = \"Fill in all the required fields\";\n}",
-              "|actioncomplete" : "function (_self, action) {\n    \n    if(action.type == 'setdata'){\n\n        if(\n            _this.lastLogin && \n            _this.lastLogin.login_provider == ''\n        ){\n            _this.form.findField('username').setValue(_this.lastLogin.email);\n        }\n        \n        Roo.get('login-err').dom.innerHTML = \"\";\n        _this.errorRow.hide();\n        _this.dialog.el.select('.modal-content', true).first().unmask();\n        this.clearInvalid();\n        return;\n    }\n     \n    if(action.type == 'load'){\n        \n        return;\n    }\n    \n    if (action.type =='submit') {\n    \n        _this.dialog.hide();\n        \n        var cb = function(){\n            if (_this.callback) {\n                _this.callback.call(_this, action.result);\n            }\n            \n            _this.form.reset();\n            \n            return;\n        }\n        \n        if(\n            !action.result.data.oath_key_enable &&\n            action.result.data.require_oath * 1 == 1\n        ) {\n            Roo.bootstrap.MessageBox.show({\n                title : \"Two Factor Authentication is required\",\n                closable : false,\n                msg : \"This system requires that you use Google Two Factor Authentication.\",\n                buttons : {yes:'Setup Two Factor Authentication'},\n                fn : function(ret){\n                    if(ret != 'yes'){\n                         return;\n                     }\n                    \n                    Pman.Dialog.BAdminStaffTwoFactorQRCode.show(\n                        {id: action.result.data.id},\n                        cb\n                    )\n                }\n            });\n            \n            return;\n        }\n        \n        cb();\n    }\n}"
+              "|actioncomplete" : "function (_self, action) {\n    \n    if(action.type == 'setdata'){\n\n        if(\n            _this.lastLogin && \n            _this.lastLogin.login_provider == ''\n        ){\n            _this.form.findField('username').setValue(_this.lastLogin.email);\n        }\n        \n        Roo.get('login-err').dom.innerHTML = \"\";\n        _this.errorRow.hide();\n        _this.dialog.el.select('.modal-content', true).first().unmask();\n        this.clearInvalid();\n        return;\n    }\n     \n    if(action.type == 'load'){\n        \n        return;\n    }\n    \n    if (action.type =='submit') {\n    \n        _this.dialog.hide();\n        \n        var cb = function(){\n            if (_this.callback) {\n                _this.callback.call(_this, action.result);\n            }\n            \n            _this.form.reset();\n            \n            return;\n        }\n        \n        if(\n            !action.result.data.oath_key_enable &&\n            action.result.data.require_oath * 1 == 1\n        ) {\n            Roo.bootstrap.MessageBox.show({\n                title : \"Two Factor Authentication is required\",\n                closable : false,\n                msg : \"This system requires that you use Google Two Factor Authentication.\",\n                buttons : {yes:'Setup Two Factor Authentication'},\n                fn : function(ret){\n                    if(ret != 'yes'){\n                         return;\n                     }\n                    \n                    Pman.Dialog.BAdminStaffTwoFactorQRCode.show(\n                        {id: action.result.data.id, allow_close : true },\n                        cb\n                    )\n                }\n            });\n            \n            return;\n        }\n        \n        cb();\n    }\n}",
+              "|render" : "function (_self) {\n    _this.form = _self;\n}"
              },
              "$ url" : "baseURL + '/Login'",
              "labelAlign" : "left",
@@ -82,8 +82,8 @@
                   "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    \n}"
                  },
                  "inputType" : "email",
-                 "xtype" : "Input",
                  "vtype" : "email",
+                 "xtype" : "Input",
                  "placeholder" : "Email Address",
                  "allowBlank" : false,
                  "$ xns" : "Roo.bootstrap",
@@ -94,8 +94,8 @@
                   "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}"
                  },
                  "inputType" : "password",
-                 "placeholder" : "Password",
                  "xtype" : "Input",
+                 "placeholder" : "Password",
                  "allowBlank" : false,
                  "$ xns" : "Roo.bootstrap",
                  "name" : "password"
     },
     {
      "xtype" : "Button",
-     "$ string weight" : "'primary'",
      "html" : "Login",
+     "$ string weight" : "'primary'",
      "$ xns" : "Roo.bootstrap",
      "String style" : "float: right",
      "* prop" : "buttons[]",
     },
     {
      "listeners" : {
-      "click" : "function () {\n\n    _this.dialog.hide();\n    \n    var email = _this.form.findField('username').getValue();\n    \n    var _self = this;\n    \n    Pman.Dialog.BAdminForgotPassword.show({email : email}, function(){\n        Roo.bootstrap.MessageBox.alert(_self._forgot_passwd_success_title, _self._forgot_passwd_success_body, function() {\n            _this.dialog.show();\n        });\n\n    });\n}"
+      "click" : "function () {\n\n    _this.dialog.hide();\n    \n    var email = _this.form.findField('username').getValue();\n    \n    var _self = this;\n    \n    Pman.Dialog.BAdminForgotPassword.show({email : email}, function(){\n        Roo.bootstrap.MessageBox.alert(_self._forgot_passwd_success_title, _self._forgot_passwd_success_body, function() {\n                _this.dialog.show();\n        });\n\n    });\n}"
      },
      "String tag" : "a",
      "String href" : "#",
      "xtype" : "Button",
      "html" : "Forgot your password ?",
      "$ string weight" : "'link'",
-     "string _forgot_passwd_success_title" : "Please check your email",
+     "string _forgot_passwd_success_title" : "Notice",
      "Boolean removeClass" : true,
      "$ xns" : "Roo.bootstrap",
      "String style" : "float: left",
index 5dc78ba..00386fd 100644 (file)
@@ -9,7 +9,6 @@ Roo.apply(Pman.Dialog.Login.prototype, {
 
  _strings : {
   'e50b62fb8271673bacc2cfd9d80fbe7a' :"Login to the Management Portal",
-  'e81e237c94a1f073504ab372b1b7fc41' :"Please check your email",
   '99dea78007133396a7b8ed70578ac6ae' :"Login",
   'cfcd208495d565ef66e7dff9f98764da' :"0",
   'cd4bcecae78474ea24c3f28350758a8c' :"Forgot your password ?",
@@ -17,6 +16,7 @@ Roo.apply(Pman.Dialog.Login.prototype, {
   '06cf692a8d2bb0ab8318dc6c839ae931' :"Two-Factor Authentication Number (if relevant)",
   '11163ed17ad9afc7680bb9e92f15d6fd' :"We have sent you a link to reset your password",
   '5047040b025ce0295b58d42250014417' :"<div id=\"login-err\" class=\"dialog-err\" style=\"color:red\"></div>",
+  '24efa7ee4511563b16144f39706d594f' :"Notice",
   '643a860f992333b8600ea264aca7c4fc' :"Email Address"
  },
  _named_strings : {
@@ -103,7 +103,7 @@ Roo.apply(Pman.Dialog.Login.prototype, {
      {
       xtype : 'Button',
       _forgot_passwd_success_body : _this._strings['11163ed17ad9afc7680bb9e92f15d6fd'] /* We have sent you a link to reset your password */,
-      _forgot_passwd_success_title : _this._strings['e81e237c94a1f073504ab372b1b7fc41'] /* Please check your email */,
+      _forgot_passwd_success_title : _this._strings['24efa7ee4511563b16144f39706d594f'] /* Notice */,
       href : '#',
       html : _this._strings['cd4bcecae78474ea24c3f28350758a8c'] /* Forgot your password ? */,
       removeClass : true,
@@ -121,7 +121,7 @@ Roo.apply(Pman.Dialog.Login.prototype, {
             
             Pman.Dialog.BAdminForgotPassword.show({email : email}, function(){
                 Roo.bootstrap.MessageBox.alert(_self._forgot_passwd_success_title, _self._forgot_passwd_success_body, function() {
-                    _this.dialog.show();
+                        _this.dialog.show();
                 });
         
             });
@@ -221,7 +221,7 @@ Roo.apply(Pman.Dialog.Login.prototype, {
                                      }
                                     
                                     Pman.Dialog.BAdminStaffTwoFactorQRCode.show(
-                                        {id: action.result.data.id},
+                                        {id: action.result.data.id, allow_close : true },
                                         cb
                                     )
                                 }