can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[ljcom] r9589: LJSUP-7012: check additional statuses on...

Committer: dpetrov
LJSUP-7012: check additional statuses on verification code send
U   trunk/htdocs/js/editprofile.js
Modified: trunk/htdocs/js/editprofile.js
===================================================================
--- trunk/htdocs/js/editprofile.js	2010-10-04 08:10:29 UTC (rev 9588)
+++ trunk/htdocs/js/editprofile.js	2010-10-04 08:48:29 UTC (rev 9589)
@@ -112,10 +112,20 @@
 				{
 					var resCode = $.trim(result.split(":")[1]);
 
-					if(resCode == "1")
-						that.setState('verified', 'info', 'verified');
-					else
-						that.setState('wrongcode', 'error', 'wrongcode');
+                    switch( resCode ){
+                        case "invalid" :
+                            that.setState('wrongcode', 'error', 'wrongcode');
+                            break;
+                        case "outdated" :
+                            that.setState('linkexpired', 'success', 'linkexpired');
+                            break;
+                        case "ok" :
+                            that.setState('verified', 'info', 'verified');
+                            break;
+                        case "already_use":
+                            that.setState('already_use', 'success', 'already_use');
+                            break;
+                    }
 				});
 			});
 			this.ui.verCode.input(function() {
@@ -273,6 +283,7 @@
                     case 'notasubscriber': resetUI();
 									bt.attr('disabled', true);
 									break;
+                    case 'already_use':
 					case 'unsupporteddef': resetUI(true);
 									bt.attr('disabled', true);
 									break;
@@ -280,6 +291,10 @@
 									this.ui.resendBtn.parent('.b-manage-smsn-btn').css('display','');
 									this.ui.phVerification.removeAttr('style');
                                     break;
+                    case 'linkexpired' : resetUI();
+                                    bt.val( dict['resendsmsbut'])
+									this.ui.phVerification.css('display','none')
+                                    break;
 				}
 			}
 

Tags: can3p, js, ljcom
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments