Beispiel #1
0
        public void OnChangePasswordConfirmPressed()
        {
            //	TODO: Finish password change logic flow
            string newPassword     = model.newPasswordField.value;
            string confirmPassword = model.confirmPasswordField.value;

            if (model.newPasswordField.defaultText == newPassword || string.IsNullOrEmpty(newPassword))
            {
                ModalPopupOK.Spawn("Please enter a new password.");
            }
            else if (model.confirmPasswordField.defaultText == confirmPassword || string.IsNullOrEmpty(newPassword))
            {
                ModalPopupOK.Spawn("Please confirm your password.");
            }
            else if (string.Compare(newPassword, confirmPassword) != 0)
            {
                ModalPopupOK.Spawn("Check that your passwords match.");
            }
            else
            {
                HelperMethods.ChangePasswordRequestObject passwordRequest = new HelperMethods.ChangePasswordRequestObject();
                passwordRequest.password = newPassword;

                ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder()
                                                                     .SetEventCategory("Profile - Settings Screen")
                                                                     .SetEventAction("Click - Confirm Button Change Password Screen")
                                                                     .SetEventLabel("User has clicked on the confirm button from the change password screen"));
                ITTDataCache.Instance.ChangePassword(passwordRequest, OnChangePasswordSuccess, OnChangePasswordFailure);
            }
        }
Beispiel #2
0
        public void OnForgotPasswordFailure(string error)
        {
            string message = "";

            if (error.Contains("404"))
            {
                message = "Username not found.";
            }
            else if (error.Contains(HelperMethods.Instance.Error_NetworkRadioOff) || error.Contains(HelperMethods.Instance.Error_NetworkTimeOut))
            {
                ModalPopupOK.Spawn("Experiencing connection issues with the server. Please check your connection and try again.", () => {
                    StartCoroutine(OnHide());
                });
            }
            else
            {
                message = error;
            }

            ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder()
                                                                 .SetEventCategory("Registration - Sign In Screen")
                                                                 .SetEventAction("Forgot Password failure - Sign In Screen")
                                                                 .SetEventLabel("User had a forgot password error: " + message));
            ModalPopupOK.Spawn(message);
        }
Beispiel #3
0
        public void OnChangeEmailConfirmPressed()
        {
            string newEmail     = model.newEmailField.value;
            string confirmEmail = model.changeEmailPasswordField.value;

            if (model.newEmailField.defaultText == newEmail || string.IsNullOrEmpty(newEmail) || string.IsNullOrEmpty(Regex.Match(newEmail, ".+@.+[.].+").ToString()))
            {
                ModalPopupOK.Spawn("Please enter a valid email address.");
            }
            else if (model.changeEmailPasswordField.defaultText == confirmEmail || string.IsNullOrEmpty(confirmEmail) || string.IsNullOrEmpty(Regex.Match(confirmEmail, ".+@.+[.].+").ToString()))
            {
                ModalPopupOK.Spawn("Please enter a valid confirmation email address.");
            }
            else if (string.Compare(newEmail, confirmEmail) != 0)
            {
                ModalPopupOK.Spawn("Check that your email addresses match.");
            }
            else
            {
                HelperMethods.ChangeEmailRequestObject emailRequest = new HelperMethods.ChangeEmailRequestObject();
                emailRequest.email = newEmail;

                ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder()
                                                                     .SetEventCategory("Profile - Settings Screen")
                                                                     .SetEventAction("Click - Confirm Button Change Email Screen")
                                                                     .SetEventLabel("User has clicked on the confirm button from the change email screen. Email: " + model.newEmailField.value));
                ITTDataCache.Instance.UpdateUserEmail(emailRequest, OnChangeEmailSuccess, OnChangeEmailFailure);
            }
        }
Beispiel #4
0
 public void OnForgotPasswordSuccess(string json)
 {
     ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder()
                                                          .SetEventCategory("Registration - Sign In Screen")
                                                          .SetEventAction("Forgot Password Success - Sign In Screen")
                                                          .SetEventLabel("User has successfully requested a password reset"));
     ModalPopupOK.Spawn("An email has been sent with a temporary password.");
 }
Beispiel #5
0
 public void OnChangePasswordSuccess(string json)
 {
     ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder()
                                                          .SetEventCategory("Profile - Settings Screen")
                                                          .SetEventAction("Change Password Success - Settings Screen")
                                                          .SetEventLabel("User has successfully changed their password"));
     ModalPopupOK.Spawn("You have successfully changed your password and will be logged out. Please login with your new credentials.", OnChangePasswordOkPressed);
 }
Beispiel #6
0
 public void OnLogoutSuccess(string json)
 {
     // Response should just be "[true]"
     ITTDataCache.Instance.ClearSessionData();
     model.nameLabel.text = "";
     ITTMainSceneManager.Instance.currentState = ITTMainSceneManager.ITTStates.Main;
     ModalPopupOK.Spawn("You are now logged out.");
 }
Beispiel #7
0
 public void OnChangeEmailSuccess(string json)
 {
     ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder()
                                                          .SetEventCategory("Profile - Settings Screen")
                                                          .SetEventAction("Change Email Success - Settings Screen")
                                                          .SetEventLabel("User has successfully changed their email"));
     ModalPopupOK.Spawn("Your email has been updated.", () => {
         OnChangeEmailBackPressed();
     });
 }
Beispiel #8
0
 public void OnLogoutFailure(string error)
 {
     Debug.LogError("OnLogoutFailure: " + error);
     if (error.Contains(HelperMethods.Instance.Error_NetworkRadioOff) || error.Contains(HelperMethods.Instance.Error_NetworkTimeOut))
     {
         ModalPopupOK.Spawn("Experiencing connection issues with the server. Please check your connection and try again.", () => {
             ITTMainSceneManager.Instance.currentState = ITTMainSceneManager.ITTStates.Main;
         });
     }
 }
Beispiel #9
0
 private void OnSavedListFailure(string error)
 {
     Debug.LogError("Failed saved list: " + error);
     model.loadingLabel.text = "Error retrieving data. Please try again later.";
     model.loadingIcon.gameObject.SetActive(false);
     if (error.Contains(HelperMethods.Instance.Error_NetworkRadioOff) || error.Contains(HelperMethods.Instance.Error_NetworkTimeOut))
     {
         ModalPopupOK.Spawn("Experiencing connection issues with the server. Please check your connection and try again.", () => {
             ITTMainSceneManager.Instance.currentState = ITTMainSceneManager.ITTStates.Main;
         });
     }
 }
Beispiel #10
0
 private void OnRetrieveActivitiesForSelectedDayFailure(string error)
 {
     Debug.LogError("CardCarousel error: " + error);
     if (error.Contains(HelperMethods.Instance.Error_NetworkRadioOff) || error.Contains(HelperMethods.Instance.Error_NetworkTimeOut))
     {
         ModalPopupOK.Spawn("Experiencing connection issues with the server. Please check your connection and try again.");
     }
     else if (error.Contains(HelperMethods.Instance.Error_EmptyResults) && null != OnNoCardsForSelectedDay && !_verticalMode)
     {
         OnNoCardsForSelectedDay();
     }
 }
Beispiel #11
0
 public void OnFilterFailure(string error)
 {
     Debug.LogError("FilterResultsViewController.OnFilterFailure: " + error);
     if (error.Contains(HelperMethods.Instance.Error_NetworkRadioOff) || error.Contains(HelperMethods.Instance.Error_NetworkTimeOut))
     {
         ModalPopupOK.Spawn("Experiencing connection issues with the server. Please check your connection and try again.", () => {
             ITTMainSceneManager.Instance.currentState = ITTMainSceneManager.ITTStates.Main;
         });
     }
     model.loadingLabel.text = "Results could not be loaded. Please try again later.";
     StopLoadingAnimation();
 }
Beispiel #12
0
 private void OnRefreshTokenFailure(string error)
 {
     if (error.ToLower().Contains("not logged in"))
     {
         Debug.LogError("Token failure: prompting login");
         ITT.Scene.OnboardingViewController.Spawn(OnLoginSuccessRetryBufferedCall);
     }
     else
     {
         Debug.LogError("Error refreshing token: " + error);
         ModalPopupOK.Spawn("An error occurred.");                 // TODO: better message
     }
 }
Beispiel #13
0
 protected virtual void OnResponseFailure(string error)
 {
     Debug.LogError(this.GetType().Name + "OnResponseFailure: " + error);
     if (error.Contains(HelperMethods.Instance.Error_NetworkRadioOff) || error.Contains(HelperMethods.Instance.Error_NetworkTimeOut))
     {
         ModalPopupOK.Spawn("Experiencing connection issues with the server. Please check your connection and try again.");
     }
     isWaitingOnServer = false;
     Timestamp         = DateTime.MinValue;
     if (null != ResponseFailureCallback)
     {
         ResponseFailureCallback(error);
     }
 }
Beispiel #14
0
 public void OnChangePasswordFailure(string error)
 {
     Debug.LogError("Change password failed: " + error);
     ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder()
                                                          .SetEventCategory("Profile - Settings Screen")
                                                          .SetEventAction("Change Password Failure - Settings Screen")
                                                          .SetEventLabel("User has encountered a change password error: " + error));
     if (error.Contains(HelperMethods.Instance.Error_NetworkRadioOff) || error.Contains(HelperMethods.Instance.Error_NetworkTimeOut))
     {
         ModalPopupOK.Spawn("Experiencing connection issues with the server. Please check your connection and try again.", () => {
             ITTMainSceneManager.Instance.currentState = ITTMainSceneManager.ITTStates.Main;
         });
     }
 }
Beispiel #15
0
        private void OnFailGeoData(string error)
        {
            if (error.Contains(HelperMethods.Instance.Error_NetworkRadioOff) || error.Contains(HelperMethods.Instance.Error_NetworkTimeOut))
            {
                ModalPopupOK.Spawn("Experiencing connection issues with the server. Please check your connection and try again.");
            }
            else
            {
                ModalPopupOK.Spawn("Your location could not be found. Please try again.");
            }

            HelperMethods.RemoveInteractionBlocker();
            GameObject.Destroy(_loadingScreen.gameObject);
        }
Beispiel #16
0
 private void OnProfilePressed()
 {
     if (ITTDataCache.Instance.HasNetworkConnection)
     {
         ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder()
                                                              .SetEventCategory("Main - Main Screen")
                                                              .SetEventAction("Click - Profile Button")
                                                              .SetEventLabel("The user has pressed on the profile button"));
         StartCoroutine(ITTMainSceneManager.Instance.AttemptAuthenticatedStateChange(ITTMainSceneManager.ITTStates.Profile));
     }
     else
     {
         ModalPopupOK.Spawn("Experiencing connection issues with the server. Please check your connection and try again.");
     }
 }
Beispiel #17
0
 private void OnLocationPressed()
 {
     if (ITTDataCache.Instance.HasNetworkConnection)
     {
         ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder()
                                                              .SetEventCategory("Main - Main Screen")
                                                              .SetEventAction("Click - Location Button")
                                                              .SetEventLabel("The user has pressed on the location button"));
         ITTMainSceneManager.Instance.currentState = ITTMainSceneManager.ITTStates.Location;
     }
     else
     {
         ModalPopupOK.Spawn("Experiencing connection issues with the server. Please check your connection and try again.");
     }
 }
Beispiel #18
0
 public void OnForgotPasswordPressed()
 {
     // Ensure valid username entered first
     if (model.signInUsername.value != model.signInUsername.defaultText && !string.IsNullOrEmpty(model.signInUsername.value))
     {
         ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder()
                                                              .SetEventCategory("Registration - Sign In Screen")
                                                              .SetEventAction("Click - Sign In Forgot Password Button")
                                                              .SetEventLabel("User has clicked on the forgot password button"));
         ITTDataCache.Instance.RequestNewPassword(model.signInUsername.value, OnForgotPasswordSuccess, OnForgotPasswordFailure);
     }
     else
     {
         ModalPopupOK.Spawn("Please enter a valid username.");
     }
 }
Beispiel #19
0
    public static void Spawn(string labelText, Action OKCallback = null)
    {
        // Only allow one
        if (null != GameObject.FindObjectOfType <ModalPopupOK>())
        {
            return;
        }

        UIRoot[] roots = NGUITools.FindActive <UIRoot>();
        if (null != roots[0])
        {
            GameObject   instance = NGUITools.AddChild(roots[0].gameObject, (GameObject)Resources.Load("Prefabs/Production/ModalPopupOK"));
            ModalPopupOK script   = instance.GetComponent <ModalPopupOK>();
            script.Init(labelText, OKCallback);
        }
    }
Beispiel #20
0
        public void OnSignInPressed()
        {
            if (!string.IsNullOrEmpty(model.signInUsername.value) && !string.IsNullOrEmpty(model.signInPassword.value))
            {
                string username = model.signInUsername.value;

                ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder()
                                                                     .SetEventCategory("Registration - Sign In Screen")
                                                                     .SetEventAction("Click - Sign In Button")
                                                                     .SetEventLabel("User has clicked on the sign in button. Username: "******"Please ensure all fields are filled out.");
            }
        }
Beispiel #21
0
        public void OnCancelPressed()
        {
            ITTDataCache.Instance.Data.GetDataEntry((int)DataCacheIndices.USER_FLAGS, OnRetrievedUserFlags);

            ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder()
                                                                 .SetEventCategory("Location - Location Screen")
                                                                 .SetEventAction("Click - Location Cancel Button")
                                                                 .SetEventLabel("The user has pressed on the cancel button in location screen."));
            if (_toolTipComplete)
            {
                ITTMainSceneManager.Instance.currentState = ITTMainSceneManager.ITTStates.Main;
            }
            else
            {
                ModalPopupOK.Spawn("You must enter a valid location before continuing.");
            }
        }
Beispiel #22
0
    public void OnSaveToProfilePressed(GameObject go)
    {
        if (!ITTDataCache.Instance.HasNetworkConnection)
        {
            ModalPopupOK.Spawn("Experiencing connection issues with the server. Please check your connection and try again.");
            return;
        }

        if (false == _hasBeenOrCurrentlyRotated)
        {
            StartCoroutine(RotateEffect());
            ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder()
                                                                 .SetEventCategory("Detail - Detail Card")
                                                                 .SetEventAction("Click - Save to Profile Button")
                                                                 .SetEventLabel("User has clicked on the Save to Profile button for Nid: " + Nid.ToString()));
            ITTDataCache.Instance.FlagSaved(Nid, null, null);
        }
    }
Beispiel #23
0
 public void OnSignInFailure(string error)
 {
     Debug.LogError("Sign in error: " + error);
     ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder()
                                                          .SetEventCategory("Registration - Sign In Screen")
                                                          .SetEventAction("Sign In Failure - Sign In Screen")
                                                          .SetEventLabel("User had a sign in error: " + error));
     if (error.Contains("401"))
     {
         ModalPopupOK.Spawn("The email address and/or password you entered is incorrect.");
     }
     else if (error.Contains(HelperMethods.Instance.Error_NetworkRadioOff) || error.Contains(HelperMethods.Instance.Error_NetworkTimeOut))
     {
         ModalPopupOK.Spawn("Experiencing connection issues with the server. Please check your connection.", () => {
             StartCoroutine(OnHide());
         });
     }
     else
     {
         ModalPopupOK.Spawn("Can't Login. Verify that your email and/or password is correct and try again.");
     }
 }
Beispiel #24
0
        public void OnSignUpPressed()
        {
            if (string.IsNullOrEmpty(model.registrationEmail.value) || string.IsNullOrEmpty(model.registrationPassword.value) || string.IsNullOrEmpty(model.registrationConfirmPassword.value))
            {
                ModalPopupOK.Spawn("Please ensure all fields are filled out.");
            }
            else if (model.registrationPassword.value != model.registrationConfirmPassword.value)
            {
                ModalPopupOK.Spawn("Passwords do not match.");
            }
            else if (!model.registrationAcceptTerms.value)
            {
                ModalPopupOK.Spawn("You must accept the terms and conditions to register a new account.");
            }
            else
            {
                tempRegistrationData       = new RegistrationDataModel();
                tempRegistrationData.email = model.registrationEmail.value;
                int atIndex = model.registrationEmail.value.IndexOf('@');
                if (0 > atIndex)
                {
                    ModalPopupOK.Spawn("The email address has been entered incorrectly.");
                    return;
                }

                tempRegistrationData.username     = model.registrationEmail.value;
                tempRegistrationData.password     = model.registrationPassword.value;
                tempRegistrationData.legal_accept = (model.registrationAcceptTerms.value ? "1" : "0");

                // TODO: actual call
                _registering = true;
                DetermineSignUpButtonStatus();
                ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder()
                                                                     .SetEventCategory("Registration - Registration Screen")
                                                                     .SetEventAction("Click - Sign Up Button")
                                                                     .SetEventLabel("User has clicked the sign up button. Username: "******" Legal: " + tempRegistrationData.legal_accept.ToString()));
                ITTDataCache.Instance.RegisterUser(tempRegistrationData, OnRegistrationSuccess, OnRegistrationFailure);
            }
        }
Beispiel #25
0
        public void OnRegistrationFailure(string error)
        {
            _registering = false;
            DetermineSignUpButtonStatus();
            tempRegistrationData = null;

            Debug.LogError("Registration error: " + error);
            ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder()
                                                                 .SetEventCategory("Registration - Registration Screen")
                                                                 .SetEventAction("Registration Failure - Registration Screen")
                                                                 .SetEventLabel("User had a registration error: " + error));
            if (error.Contains("406"))
            {
                // Get the 406 message
                string[] parts = error.Split(':');
                string   msg   = parts[parts.Length - 1];
                ModalPopupOK.Spawn(msg);
            }
            else if (error.Contains("409") || error.ToLower().Contains("already taken"))
            {
                // Technically this error means the user name is in use, but since we don't have a username field... :/
                ModalPopupOK.Spawn("This email address is already in use.");
            }
            else if (error.Contains(HelperMethods.Instance.Error_NetworkRadioOff) || error.Contains(HelperMethods.Instance.Error_NetworkTimeOut))
            {
                ModalPopupOK.Spawn("Experiencing connection issues with the server. Please check your connection.", () => {
                    StartCoroutine(OnHide());
                });
            }
            else if (!error.Contains("200"))
            {
                ModalPopupOK.Spawn("An error occurred. Error: " + error);
            }
            else
            {
                ModalPopupOK.Spawn("An error occurred. Please try again later.");
            }
        }
Beispiel #26
0
    public void OnPopulateFailure(string error)
    {
        if (error.Contains(HelperMethods.Instance.Error_NetworkRadioOff) || error.Contains(HelperMethods.Instance.Error_NetworkTimeOut))
        {
            HideCarousel(true);
            if (null != OnActivitiesPopulated)
            {
                OnActivitiesPopulated();
            }
            ModalPopupOK.Spawn("Experiencing connection issues with the server. Please check your connection and try again.");
        }
        else if (HelperMethods.Instance.Error_EmptyResults == error)
        {
            HideCarousel(true);
            if (null != OnActivitiesPopulated)
            {
                OnActivitiesPopulated();
            }
            HideNoResultsCard(false);
        }

        isMainCarouselPopulateFailed = true;
    }
Beispiel #27
0
 private void RetrieveLocationFail(string error)
 {
     HelperMethods.RemoveInteractionBlocker();
     ModalPopupOK.Spawn(error);
 }