Exemple #1
0
        public bool AuthenticateUser()
        {
            var v = Controller.GetCurrentContext();
            AuthenticationModule am = (AuthenticationModule)Controller.GetCurrentContext().ApplicationInstance.Modules["AuthenticationModule"];

            // AuthenticationModule am = new AuthenticationModule();
            if (View.GetUserName.Trim().Length > 0 && View.GetPassword.Trim().Length > 0)
            {
                try
                {
                    if (am.AuthenticateUser(View.GetUserName, View.GetPassword, View.PersistLogin))
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
            }
            else
            {
                throw new Exception("USERNAMEPASSWORDMISSING");
            }
        }