Sitecore intranet login

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.DirectoryServices;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Sitecore.SecurityModel;
using Sitecore.Configuration;

namespace eFocusIntranet
{
    public partial class login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            //let op hiervoor moet anonymous acces gedisabled zijn op de server
            string sUser = Request.ServerVariables["LOGON_USER"];
            sUser = sUser.Substring(sUser.LastIndexOf("\\") + 1);
            if (sUser != null)
            {
                DirectoryEntry serverRoot = LDAPUtil.ActiveDirectoryConnection;
                if (serverRoot != null)
                {
                    DomainAccessResult result;
                    Domain domain = Factory.GetDomain("extranet");

                    DirectorySearcher mySearcher = new DirectorySearcher(serverRoot);
                    mySearcher.Filter = "sAMAccountName=" + sUser;

                    SearchResult ADuser = mySearcher.FindOne();

                    if (ADuser == null)
                    {
                        result = new DomainAccessResult(false, "Uw gebruikersnaam [" + sUser + "] is niet gevonden in de active directory, gebruik de link om handmatig in loggen");
                        this.lblError.Text = result.Message;
                    }
                    else
                    {
                        try
                        {
                            UserItem user = domain.GetUser(sUser);
                            result = domain.Login(user);
                            //this.lblError.Text += "dit is het resultaat van het inloggen" + result.Success.ToString ();
                            Response.Redirect("~/default.aspx");

                        }
                        catch (Exception ex)
                        {
                            result = new DomainAccessResult(false, ex.Message);
                            this.lblError.Text = "Er is een error onstaan tijdens het inloggen:" + ex.Message;
                        }
                    }
                    //this.txtUsername.Text = result.Message; 
                    if (mySearcher != null)
                    {
                        mySearcher.Dispose();
                    }
                }
                if (serverRoot != null)
                {
                    serverRoot.Dispose();
                }

            }

            else
            {
                this.lblError.Text += "Uw gebruikersnaam is niet automatisch herkend, gebruik de link om handmatig in loggen";
            }

        }
    }
}

{{opmerking.Naam}}:

{{opmerking.OpmerkingText}}

            

Saving your comment....

Naam is verplicht!
Email is verplicht!
Opmerking is verplicht!