Pman.Dialog.VerifyAccess.bjs
[Pman.Core] / Pman.Dialog.VerifyAccess.js
index 496dc7a..40e511c 100644 (file)
@@ -8,9 +8,9 @@ Pman.Dialog.VerifyAccess= function() {}
 Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
 
  _strings : {
+  'e2c9d024b79dfb48b42a7807206c6aed' :"Verify New IP Access",
   'd41d8cd98f00b204e9800998ecf8427e' :"",
   'b945ed1d61d8edbe16a1192ad6d2fd58' :"Please enter a memorable password for logging into your application",
-  '07ae22a49223522664766d12c37a4eeb' :"Activate Your account",
   'ee7ad62ad69b9ab5f25d273e4e0a1736' :"Your Username",
   '51eea3dc60ae3a0b1bb8188bc6337dc2' :"enter password",
   '1849ffc8731b5e74ae6157c91ba73575' :"Please confirm your password",
@@ -45,8 +45,7 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
     xtype : 'Modal',
     allow_close : false,
     cls : 'enable-overflow',
-    size : 'sm',
-    title : _this._strings['07ae22a49223522664766d12c37a4eeb'] /* Activate Your account */,
+    title : _this._strings['e2c9d024b79dfb48b42a7807206c6aed'] /* Verify New IP Access */,
     listeners : {
      render : function (_self)
       {
@@ -56,65 +55,30 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
       {
           var path = window.location.pathname.split('/');
           
-          var verify_key = path.pop();
+          var authorized_key = path.pop();
           
           var id = path.pop();
           
-          var show_err = function(msg,title,show_resend_btn) {
-              _this.form.hide();
-              _this.btn_ok.hide();
-              _this.error_row.el.show();
-              _this.text_el.el.dom.innerHTML = msg;
-              _this.modal.setTitle(title);
-              if(show_resend_btn){
-                  _this.btn_resend.show();
-              }
-          }
-          
           new Pman.Request({
-              url: baseURL + '/Register/Confirm',
+              url: baseURL + '/Core/VerifyAccess',
               method : 'POST',
+              mask : 'Loading...',
               params : {
                   id : id,
-                  verify_key : verify_key,
+                  authorized_key : authorized_key,
                   _to_data : 1
               }, 
               success : function(res) {
+                  Roo.log(res);
+                  return;
                   _this.form.setValues(res.data);
                   return;
               },
               failure: function(res) {
                   
-                  switch(res.errorMsg) {
-                      case 'already_registered':
-                          _this.dialog.hide();
-                          Coba.Dialog.Login.show({});
-                          break;
-      
-                      case 'multi_account':
-                          show_err('This email has been registered for multiple account. Please contact to your distributor to synchronize them',
-                                   'System Error',
-                                    false);
-                          break;
-      
-                      case 'broken_link':
-                          show_err('The link you clicked on was broken, on not complete, please copy and paste the full URL from the email you received',
-                                   'Invalid Link',
-                                   false);
-                          break;
-      
-                      case 'expired':
-                          show_err('This activation link is already expired, please click Resend email to get the updated activated link',
-                                   'Link Expired',
-                                   true);                   
-                          break;
-      
-                      
-                      default:
-                          show_err(res.errorMsg,'Error', false);
-                          break;
-                  }            
-      
+                  _this.dialog.hide();
+                  
+                  Roo.bootstrap.MessageBox.alert('Error', res.errorMsg);
                   
                   return;
              }