using System;

public partial class forceUser : System.Web.UI.Page
{
  protected string _nextPage
  {
    get
    {
      string pagina = SteamWare.memLayer.ML.StringSessionObj("nextPage");
      if (string.IsNullOrEmpty(pagina))
      {
        pagina = "menu.aspx";
      }
      return pagina;
    }
  }

  protected void Page_Load(object sender, EventArgs e)
  {
    Mod_login1.modoLogin = SteamWare.loginMode.forceUser;
  }

  protected override void OnInit(EventArgs e)
  {
    base.OnInit(e);
    Mod_login1.Login_ok += new EventHandler(Mod_login1_Login_ok);
    Mod_login1.Login_Error += new EventHandler(Mod_login1_Login_Error);
  }

  void Mod_login1_Login_Error(object sender, EventArgs e)
  {
    //Response.Redirect("./unauthorized.aspx");
  }

  void Mod_login1_Login_ok(object sender, EventArgs e)
  {
    Response.Redirect(_nextPage, false);
  }
  protected override void OnUnload(EventArgs e)
  {
    base.OnUnload(e);
    Mod_login1.Login_ok -= new EventHandler(Mod_login1_Login_ok);
    Mod_login1.Login_Error -= new EventHandler(Mod_login1_Login_Error);
  }
}
