Pman.Dialog.VerifyAccess.bjs
[Pman.Core] / Pman.Dialog.VerifyAccess.js
index b25bde0..1200e81 100644 (file)
@@ -10,10 +10,9 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
  _strings : {
   'e2c9d024b79dfb48b42a7807206c6aed' :"Verify New IP Access",
   'd41d8cd98f00b204e9800998ecf8427e' :"",
-  'b945ed1d61d8edbe16a1192ad6d2fd58' :"Please enter a memorable password for logging into your application",
-  'ee7ad62ad69b9ab5f25d273e4e0a1736' :"Your Username",
-  '51eea3dc60ae3a0b1bb8188bc6337dc2' :"enter password",
-  '1849ffc8731b5e74ae6157c91ba73575' :"Please confirm your password",
+  'f6039d44b29456b20f8f373155ae4973' :"Username",
+  '004bf6c9a40003140292e97330236c53' :"Action",
+  'dfb790522fdea3859af206d32916fe77' :"User Agent",
   'd71940f24ee38ee09f6e06b908480bcf' :"Resend email",
   '14cf5e829f5cb6fbf8cb54f7c5ff4ca9' :"Start the application process   "
  },
@@ -47,10 +46,6 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
     cls : 'enable-overflow',
     title : _this._strings['e2c9d024b79dfb48b42a7807206c6aed'] /* Verify New IP Access */,
     listeners : {
-     render : function (_self)
-      {
-          _this.modal = _self;
-      },
      show : function (_self)
       {
           var path = window.location.pathname.split('/');
@@ -69,10 +64,11 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
                   _to_data : 1
               }, 
               success : function(res) {
-                  //_this.dialog.show();
-                  Roo.log(res);
-                  return;
-                  _this.form.setValues(res.data);
+              
+                  _this.data = res.data;
+                  
+                  _this.form.setValues(_this.data);
+                  
                   return;
               },
               failure: function(res) {
@@ -100,21 +96,9 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
                 return;
             }
             
-            var p1 = _this.form.findField('password').getValue();
-            var p2 = _this.form.findField('password1').getValue();
-            
-            if (p1 != p2) {
-                _this.form.findField('password1').markInvalid('Password do not match');
-                return;
-            }
-            
             _this.dialog.el.mask('Sending...');
             _this.form.doAction('submit');
             
-        },
-       render : function (_self)
-        {
-            _this.btn_ok = _self;
         }
       },
       xns : Roo.bootstrap,
@@ -169,31 +153,28 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
      {
       xtype : 'Form',
       errorMask : true,
+      labelAlign : 'top',
       loadMask : false,
-      url : baseURL + '/Register/Confirm',
+      url : baseURL + '/Core/VerifyAccess',
       listeners : {
        actioncomplete : function (_self, action)
         {
             if (action.type == 'setdata') {
-            
-                _this.form.findField('password').focus();
                 
                 return;
             }
             if (action.type == 'load') {
                 
+                if(_this.data.status * 1 == 0){
+                    _this.form.findField('status').reset();
+                }
+                
                 return;
             }
             if (action.type =='submit') {
                 
                 _this.dialog.hide();
                 
-                Roo.get(document.body).mask('Start your Application');
-                
-                setTimeout(function() {
-                    window.location.href = baseURL;
-                }, 500); 
-                
                 return;
             }
             
@@ -238,8 +219,7 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
           items  : [
            {
             xtype : 'Input',
-            fieldLabel : _this._strings['ee7ad62ad69b9ab5f25d273e4e0a1736'] /* Your Username */,
-            labelAlign : 'top',
+            fieldLabel : _this._strings['f6039d44b29456b20f8f373155ae4973'] /* Username */,
             name : 'email',
             readOnly : true,
             xns : Roo.bootstrap,
@@ -251,12 +231,6 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
        },
        {
         xtype : 'Row',
-        listeners : {
-         render : function (_self)
-          {
-              _this.row_pwd_label = _self;
-          }
-        },
         xns : Roo.bootstrap,
         '|xns' : 'Roo.bootstrap',
         items  : [
@@ -267,39 +241,12 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
           '|xns' : 'Roo.bootstrap',
           items  : [
            {
-            xtype : 'FieldLabel',
-            html : _this._strings['b945ed1d61d8edbe16a1192ad6d2fd58'] /* Please enter a memorable password for logging into your application */,
-            xns : Roo.bootstrap,
-            '|xns' : 'Roo.bootstrap'
-           }
-          ]
-         }
-        ]
-       },
-       {
-        xtype : 'Row',
-        listeners : {
-         render : function (_self)
-          {
-              _this.row_pwd1 = _self;
-          }
-        },
-        xns : Roo.bootstrap,
-        '|xns' : 'Roo.bootstrap',
-        items  : [
-         {
-          xtype : 'Column',
-          xs : 12,
-          xns : Roo.bootstrap,
-          '|xns' : 'Roo.bootstrap',
-          items  : [
-           {
-            xtype : 'SecurePass',
-            allowBlank : false,
-            inputType : 'password',
-            labelAlign : 'top',
-            name : 'password',
-            placeholder : _this._strings['51eea3dc60ae3a0b1bb8188bc6337dc2'] /* enter password */,
+            xtype : 'TextArea',
+            fieldLabel : _this._strings['dfb790522fdea3859af206d32916fe77'] /* User Agent */,
+            name : 'user_agent',
+            readOnly : true,
+            rows : 3,
+            style : 'margin-bottom: 15px;',
             xns : Roo.bootstrap,
             '|xns' : 'Roo.bootstrap'
            }
@@ -309,12 +256,6 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
        },
        {
         xtype : 'Row',
-        listeners : {
-         render : function (_self)
-          {
-              _this.row_pwd2 = _self;
-          }
-        },
         xns : Roo.bootstrap,
         '|xns' : 'Roo.bootstrap',
         items  : [
@@ -325,23 +266,34 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
           '|xns' : 'Roo.bootstrap',
           items  : [
            {
-            xtype : 'Input',
+            xtype : 'ComboBox',
             allowBlank : false,
-            inputType : 'password',
-            invalidText : 'The passwords you entered do not match',
-            name : 'password1',
-            placeholder : _this._strings['1849ffc8731b5e74ae6157c91ba73575'] /* Please confirm your password */,
-            validator : function(v){
-                
-                if(_this.form.findField('password').getValue() == v) {
-                    
-                    return true;
-                }
-                
-                return false;
+            displayField : 'value',
+            editable : false,
+            fieldLabel : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
+            hiddenName : 'status',
+            mode : 'local',
+            name : 'status_name',
+            triggerAction : 'all',
+            valueField : 'code',
+            listeners : {
+             select : function (combo, record, index)
+              {
+                  
+              }
             },
             xns : Roo.bootstrap,
-            '|xns' : 'Roo.bootstrap'
+            '|xns' : 'Roo.bootstrap',
+            store : {
+             xtype : 'SimpleStore',
+             data : [
+                 ['1', 'Approve'],
+                 ['-1', 'Reject']
+             ],
+             fields : [ 'code', 'value' ],
+             xns : Roo.data,
+             '|xns' : 'Roo.data'
+            }
            }
           ]
          }
@@ -354,7 +306,7 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
         items  : [
          {
           xtype : 'Column',
-          xs : 8,
+          xs : 12,
           xns : Roo.bootstrap,
           '|xns' : 'Roo.bootstrap',
           items  : [
@@ -368,7 +320,7 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
            {
             xtype : 'Input',
             inputType : 'hidden',
-            name : 'verify_key',
+            name : 'authorized_key',
             xns : Roo.bootstrap,
             '|xns' : 'Roo.bootstrap'
            }