public override System.Web.Security.MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out System.Web.Security.MembershipCreateStatus status)
        {
            DataAccess.Identity identity = null;

            var connect = new Connect();

            using (var db = new DataAccess.CSSDataContext())
            {
                if (DataAccess.Login.FindLoginByUsernameOrCallsign(db, username) != null)
                {
                    status = System.Web.Security.MembershipCreateStatus.DuplicateUserName;
                    return null;
                }

                if (DataAccess.Alias.ListAliases(db, username).Count > 0)
                {
                    status = System.Web.Security.MembershipCreateStatus.UserRejected;
                    return null;
                }

                if (Settings.Default.UseIPConverge == true)
                {
                    if (connect.CheckEmail(email) == false)
                    {
                        status = MembershipCreateStatus.DuplicateEmail;
                        return null;
                    }

                    if (connect.CheckUsername(username) == false)
                    {
                        status = MembershipCreateStatus.DuplicateUserName;
                        return null;
                    }
                }

                status = DataAccess.Identity.TryCreateIdentity(db, username, password, email, out identity);

                if (status == MembershipCreateStatus.Success)
                {
                    if (Settings.Default.UseIPConverge == true)
                    {
                        string ipAddress = "127.0.0.1";
                        if (HttpContext.Current != null)
                            ipAddress = HttpContext.Current.Request.UserHostAddress;

                        // TODO: If IP Converge is to be used ever, then working around IPC's MD5 password hashs will need to be done.
                        //if (connect.AddMember(email, username, passwordHash, ipAddress) == false)
                        //{
                        //    status = MembershipCreateStatus.ProviderError;
                        //    return null;
                        //}
                    }
                }

                db.SubmitChanges();

                if(identity != null)
                {
                    DataAccess.Login createdLogin = DataAccess.Login.FindLoginByUsernameOrCallsign(db, username);

                    if(createdLogin != null)
                    {
                        status = System.Web.Security.MembershipCreateStatus.Success;
                        var memebershipUser = MembershipUserUtility.CreateMembershipUserFromLogin(createdLogin);

                        if (memebershipUser != null)
                        {
                            SendWelcomeEmail(memebershipUser);
                        }

                        return memebershipUser;
                    }
                }
            }

            status = System.Web.Security.MembershipCreateStatus.ProviderError;
            return null;
        }
        public void ProcessRequest(HttpContext context)
        {
            LogIncomingRequest(context);

            if (String.IsNullOrEmpty(context.Request["info"]) == false)
            {
                StringBuilder output = new StringBuilder();

                output.AppendLine("<info>");
                output.AppendLine("\t<productname>ACSS IP.Converge Integration</productname>");
                output.AppendLine("\t<productcode>AADD29C0-94FB-4BE4-BEB7-718BB78612AD</productcode>");
                output.AppendLine("</info>");

                context.Response.Write(output);
            }
            else if (String.IsNullOrEmpty(context.Request["login"]) == false)
            {

                AuthenticationStatus authenticationStatus;
                string email;

                //var ipConverge = GetIPConverge();

                //IIPConvergeServer server = XmlRpcProxyGen.Create<IIPConvergeServer>();

                //server.Url = ipConverge.Url + "/converge_master/converge_server.php";
                //server.NonStandard = XmlRpcNonStandard.All;

                //var authenticationRequest = new AuthenticateRequest();

                //authenticationRequest.auth_key = ipConverge.ApiCode;
                //authenticationRequest.email_address = ""; // "*****@*****.**";
                //authenticationRequest.md5_once_password = "******";
                //authenticationRequest.product_id = ipConverge.ProductId.ToString();
                //authenticationRequest.username = "******";

                //AuthenticateResponse response = server.Authenticate(authenticationRequest);

                var connect = new Connect();

                // TODO: Determine how to handle IPC MD5 passwords if you want to use converge.
                //connect.Authenticate("backtrak", Allegiance.CommunitySecuritySystem.Common.Utility.Encryption.MD5Hash("xxxxxx"), out authenticationStatus, out email);
                //context.Response.Write(authenticationStatus + " " + email);
            }
            else
            {
                base.HandleHttpRequest(new XmlRpcHttpRequest(context.Request), new XmlRpcHttpResponse(context.Response));
            }
        }