コード例 #1
0
        void ReleaseDesignerOutlets()
        {
            if (CancelBtn != null)
            {
                CancelBtn.Dispose();
                CancelBtn = null;
            }

            if (LoginBtn != null)
            {
                LoginBtn.Dispose();
                LoginBtn = null;
            }

            if (LoginEmail != null)
            {
                LoginEmail.Dispose();
                LoginEmail = null;
            }

            if (LoginPassword != null)
            {
                LoginPassword.Dispose();
                LoginPassword = null;
            }

            if (SignupBtn != null)
            {
                SignupBtn.Dispose();
                SignupBtn = null;
            }
        }
コード例 #2
0
        public IActionResult loginEmail([FromBody] LoginEmail logins)
        {
            Hash hash = new Hash();

            logins.EmpPassword = hash.HashPassword(logins.EmpPassword);

            if (_service.LoginEmail(logins))
            {
                var data    = _service.GetEmployeeByEmail(logins.EmpEmail);
                var Emprole = data.PositionPId;
                var EmpName = data.EmpName;
                var Empid   = data.EmpId;



                GetTokenModel token = GetToken.getToken(Emprole, Empid, EmpName);

                return(Ok(new
                {
                    token = token.Token,
                    expiration = token.Expiretion
                }));
            }
            else
            {
                return(BadRequest("there error"));
            }
        }
コード例 #3
0
        void ReleaseDesignerOutlets()
        {
            if (button_next != null)
            {
                button_next.Dispose();
                button_next = null;
            }

            if (EmailBar != null)
            {
                EmailBar.Dispose();
                EmailBar = null;
            }

            if (LoginBackButton != null)
            {
                LoginBackButton.Dispose();
                LoginBackButton = null;
            }

            if (LoginButton != null)
            {
                LoginButton.Dispose();
                LoginButton = null;
            }

            if (LoginEmail != null)
            {
                LoginEmail.Dispose();
                LoginEmail = null;
            }

            if (LoginHelpButton != null)
            {
                LoginHelpButton.Dispose();
                LoginHelpButton = null;
            }

            if (LoginPassword != null)
            {
                LoginPassword.Dispose();
                LoginPassword = null;
            }

            if (PasswordBar != null)
            {
                PasswordBar.Dispose();
                PasswordBar = null;
            }
        }
コード例 #4
0
        void ReleaseDesignerOutlets()
        {
            if (LoginBackButton != null)
            {
                LoginBackButton.Dispose();
                LoginBackButton = null;
            }

            if (LoginButton != null)
            {
                LoginButton.Dispose();
                LoginButton = null;
            }

            if (LoginEmail != null)
            {
                LoginEmail.Dispose();
                LoginEmail = null;
            }

            if (LoginHelpButton != null)
            {
                LoginHelpButton.Dispose();
                LoginHelpButton = null;
            }

            if (LoginPassword != null)
            {
                LoginPassword.Dispose();
                LoginPassword = null;
            }

            if (TextInputTest != null)
            {
                TextInputTest.Dispose();
                TextInputTest = null;
            }
        }
コード例 #5
0
        private void Start()
        {
            buttonSyncData.SetActive(false);
            buttonFirebase.SetActive(false);

            loginFacebook = new LoginFacebook();
            loginFacebook.Initialize(OnLoginFacebookSuccess);

            loginGameCenter = new LoginGameCenter();
            loginGameCenter.Initialize(OnLoginGameCenterSuccess);

            loginGooglePlay = new LoginGooglePlay();
            loginGooglePlay.Initialize(OnLoginGooglePlaySuccess);

            loginEmail = new LoginEmail();
            loginEmail.Initialize(OnLoginEmailSuccess);

            loginFirebase = new LoginFirebase();
            loginFirebase.Initialize(OnLoginFirebaseSuccess);

            mappingData = new MappingDataExample();
            mappingData.Initialize("https://unity-framework-1109.firebaseio.com/");
        }
コード例 #6
0
        /// <summary>
        ///  login by email
        /// </summary>
        /// <param name="log"></param>
        /// <returns>if login success return true</returns>
        public Boolean LoginEmail(LoginEmail log)
        {
            GetEmail getEmail = new GetEmail();

            getEmail.Email = log.EmpEmail;

            if (this.IsEmail(getEmail))
            {
                var data = _context.Employees
                           .Where(c => c.EmpEmail == log.EmpEmail && c.EmpPassword == log.EmpPassword)
                           .Select(c => c.EmpId)
                           .FirstOrDefault();

                if (string.IsNullOrEmpty(data))
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            return(false);
        }
コード例 #7
0
        public async System.Threading.Tasks.Task TestAddNewUserByUserNameAsync()
        {
            _env   = new Environment();
            _users = new UserManagementApi();
            _env.SetUserVariable("Environment", "Development");
            _user = new User
            {
                //1- Create Dummy User
                Id           = System.Guid.Parse("F037567D-54BC-4044-A6F4-66A7E85A0E34"),
                UserName     = "******",
                GivenName    = "carlos",
                SurName      = "perez",
                PasswordHash = "TestGoog!e1",
                Email        = "*****@*****.**"
            };

            //2- Delete records
            await _users.DeleteAllUsers();

            await _users.DeleteRoles();


            //3- Add User Records
            var _userResponse = await _users.AddOrUpdateUserWithUserName(_user);

            Assert.IsTrue(_userResponse.Status.Equals("ok"), _userResponse.Msg);

            //4- Update User - changed username and same password
            _user.UserName     = "******";
            _user.PasswordHash = "TestGoog!e1";
            _userResponse      = await _users.AddOrUpdateUserWithUserName(_user);

            Assert.IsTrue(_userResponse.Status.Equals("ok"), _userResponse.Msg);

            //5- Lock The Account
            _userResponse = await _users.SetLockState(_user.Id, "This account is locked due to payments", true);

            Assert.IsTrue(_userResponse.LockEnabled, _userResponse.Msg);

            System.Threading.Thread.Sleep(500);

            //5- Unlock The Account
            _userResponse = await _users.SetLockState(_user.Id, "Payments Received for $200", false);

            Assert.IsTrue(!_userResponse.LockEnabled, _userResponse.Msg);

            //6- Disable the account and verify
            System.Threading.Thread.Sleep(500);
            _userResponse = await _users.SetActiveState(_user.Id, "Deleting the Account for Temp reasons!", false);

            Assert.IsTrue(!_userResponse.IsActive, "failed to disable the user account");


            //7- Enable the account and verify
            System.Threading.Thread.Sleep(500);
            _userResponse = await _users.SetActiveState(_user.Id, "Found the Problem. Account was enable after receiving the email from Peter", true);

            Assert.IsTrue(_userResponse.IsActive, "failed to enable the user account");

            //8- Find User By UserName
            _userResponse = await _users.GetUserByUserName("cperez1");

            Assert.IsTrue((_userResponse.Status.Equals("ok") && _userResponse.Email.Equals("*****@*****.**")), _userResponse.Msg);

            //9- Find User By Email
            _userResponse = await _users.GetUserByEmail("*****@*****.**");

            Assert.IsTrue((_userResponse.Status.Equals("ok") && _userResponse.UserName.Equals("cperez1")), _userResponse.Msg);

            //10- Delete the User Account
            _userResponse = await _users.DeleteUserAccount(_user.Id, "Testing Delete Account");

            var _userList = await _users.GetActiveUsers();

            Assert.IsTrue(_userList.Count == 0, "Failed to Delete Account");

            //11- Set the Account Active again
            _userResponse = await _users.SetActiveState(_user.Id, "User is back", true);

            Assert.IsTrue(_userResponse.IsActive, "failed to enable the user account");

            //12- Reset Password- Mismatch Error
            _userResponse = await _users.ResetPassword(_user.Email, "TestGoog!e3", "TestGoog!e2");

            Assert.IsTrue(_userResponse.Status.Equals("error"), _userResponse.Msg);

            //12- Reset Password- Mismatch and change password
            _userResponse = await _users.ResetPassword(_user.Email, "TestGoog!e1", "TestGoog!e2");

            Assert.IsTrue(_userResponse.Status.Equals("ok"), _userResponse.Msg);

            //13- Login with New password
            _userResponse = await _users.LoginByEmail(_user.Email, "TestGoog!e2");

            Assert.IsTrue(_userResponse.Status.Equals("ok"), _userResponse.Msg);

            //14- Login with invalid params
            _userResponse = await _users.LoginByEmail(_user.Email, "");

            Assert.IsTrue(_userResponse.Status.Equals("error"), _userResponse.Msg);

            //15- Login with invalid email
            _userResponse = await _users.LoginByEmail("123@", "TestGoog!e2");

            Assert.IsTrue(_userResponse.Status.Equals("error"), _userResponse.Msg);

            //16- Login with old password
            _userResponse = await _users.LoginByEmail(_user.Email, "TestGoog!e1");

            Assert.IsTrue(_userResponse.Status.Equals("error"), _userResponse.Msg);

            //17- Login with New password...again
            var loginemail = new LoginEmail
            {
                Email    = _user.Email,
                Password = "******"
            };

            _userResponse = await _users.LoginByEmail(loginemail);

            Assert.IsTrue(_userResponse.Status.Equals("ok"), _userResponse.Msg);

            //18- Login by UserName
            var userlogin = new LoginUser
            {
                UserName = _user.UserName,
                Password = "******"
            };

            _userResponse = await _users.LoginByUserName(userlogin);

            Assert.IsTrue(_userResponse.Status.Equals("ok"), _userResponse.Msg);

            //19- Verify User Counts
            _userList = await _users.GetActiveUsers();

            Assert.IsTrue(_userList.Count > 0, "Failed to Retrived All Users");

            //ROLES::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
            //20- Add Roles
            var _roleName = "anonymous user";
            var _role     = await _users.AddRole(_roleName);

            Assert.IsTrue(_role.RoleName.Equals(_roleName), $"unable to add new role: {_roleName}");

            //21- Add Roles
            _roleName = "authenticated user";
            _role     = await _users.AddRole(_roleName);

            Assert.IsTrue(_role.RoleName.Equals(_roleName), $"unable to add new role: {_roleName}");

            //22- make sure no duplicate names are added
            _roleName = "authenticated user";
            _role     = await _users.AddRole(_roleName);

            Assert.IsTrue(_role.RoleName.Equals(_roleName), $"unable to add new role: {_roleName}");

            //23- Add Roles
            _roleName = "administrator";
            _role     = await _users.AddRole(_roleName);

            Assert.IsTrue(_role.RoleName.Equals(_roleName), $"unable to add new role: {_roleName}");
            var updateId = _role.Id;

            //24- Add dummy role to delete
            _roleName = "dummy";
            _role     = await _users.AddRole(_roleName);

            Assert.IsTrue(_role.RoleName.Equals(_roleName), $"unable to add new role: {_roleName}");

            _role = await _users.GetRole(_role.Id);

            Assert.IsTrue(_role.IsActive, $"unable to get role: {_role.Id}");


            _roleName = "dummy";
            await _users.DeleteRole(_role.Id);

            _role = await _users.GetRoleByName("dummy");

            Assert.IsTrue(_role == null, $"unable to delete dummy");

            //25- Update Role
            _roleName = "administrator2";
            _role     = await _users.UpdateRole(updateId, "administrator2");

            Assert.IsTrue(_role.RoleName.Equals(_roleName));

            //26- Register a New User with email (may consider deleting "user")
            _userResponse = await _users.Register("*****@*****.**", "JP632tilla1!", "carlos perez");

            Assert.IsTrue(_userResponse.Status.Equals("ok"), _userResponse.Msg);
        }
コード例 #8
0
 public Boolean LoginEmail(LoginEmail log)
 {
     return(_service.LoginEmail(log));
 }
コード例 #9
0
        void ReleaseDesignerOutlets()
        {
            if (BottomConstraint != null)
            {
                BottomConstraint.Dispose();
                BottomConstraint = null;
            }

            if (ListButton != null)
            {
                ListButton.Dispose();
                ListButton = null;
            }

            if (LoginDone != null)
            {
                LoginDone.Dispose();
                LoginDone = null;
            }

            if (LoginEmail != null)
            {
                LoginEmail.Dispose();
                LoginEmail = null;
            }

            if (LoginEmailText != null)
            {
                LoginEmailText.Dispose();
                LoginEmailText = null;
            }

            if (LoginPassword != null)
            {
                LoginPassword.Dispose();
                LoginPassword = null;
            }

            if (LoginPasswordText != null)
            {
                LoginPasswordText.Dispose();
                LoginPasswordText = null;
            }

            if (LogoText != null)
            {
                LogoText.Dispose();
                LogoText = null;
            }

            if (RegisterButton != null)
            {
                RegisterButton.Dispose();
                RegisterButton = null;
            }

            if (ResetEmail != null)
            {
                ResetEmail.Dispose();
                ResetEmail = null;
            }

            if (ResetEmailText != null)
            {
                ResetEmailText.Dispose();
                ResetEmailText = null;
            }

            if (ResetPassword != null)
            {
                ResetPassword.Dispose();
                ResetPassword = null;
            }

            if (ResetSection != null)
            {
                ResetSection.Dispose();
                ResetSection = null;
            }

            if (ResetSendButton != null)
            {
                ResetSendButton.Dispose();
                ResetSendButton = null;
            }

            if (RoundBottom != null)
            {
                RoundBottom.Dispose();
                RoundBottom = null;
            }

            if (Snackbar != null)
            {
                Snackbar.Dispose();
                Snackbar = null;
            }

            if (SnackBottomConstraint != null)
            {
                SnackBottomConstraint.Dispose();
                SnackBottomConstraint = null;
            }

            if (SnackTopConstraint != null)
            {
                SnackTopConstraint.Dispose();
                SnackTopConstraint = null;
            }
        }