using System;
using System.Data;
using System.Configuration;
using System.Collections;
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;

/// <summary>
/// Lets the developer login and see the setup of image template
/// </summary>
public partial class Login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }

    /// <summary>
    /// Logs the user in and redirects them to the admin home page
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void loginBox_OnLoggingIn(object sender, EventArgs e)
    {
        System.Web.UI.WebControls.Login loginBox = (System.Web.UI.WebControls.Login)loginView.FindControl("loginBox");
        bool b = FormsAuthentication.Authenticate(loginBox.UserName, loginBox.Password);
        if (b)
        {
            FormsAuthentication.RedirectFromLoginPage(loginBox.UserName, false);
        }
    }

    protected void loginBox_OnLoggedIn(object sender, EventArgs e)
    {
        Response.Redirect("~/admin/default.aspx");
    }
}
