Ejemplo n.º 1
0
        void Login_login_Click(Object Src, EventArgs E)
        {
            if (Login_logged)
            {
                // Login Logout begin

// Login OnLogout Event begin
// Login OnLogout Event end
                Login_logged          = false;
                Session["UserID"]     = 0;
                Session["UserRights"] = 0;
                Login_Show();
                // Login Logout end
            }
            else
            {
                // Login Login begin
                int iPassed = Convert.ToInt32(Utility.Dlookup("members", "count(*)", "member_login ='******' and member_password='******'"));
                if (iPassed > 0)
                {
// Login OnLogin Event begin
// Login OnLogin Event end
                    Login_message.Visible = false;
                    Session["UserID"]     = Convert.ToInt32(Utility.Dlookup("members", "member_id", "member_login ='******' and member_password='******'"));
                    Login_logged          = true;

                    Session["UserRights"] = Convert.ToInt32(Utility.Dlookup("members", "member_level", "member_login ='******' and member_password='******'"));

                    string sQueryString = Utility.GetParam("querystring");
                    string sPage        = Utility.GetParam("ret_page");
                    if (!sPage.Equals(Request.ServerVariables["SCRIPT_NAME"]) && sPage.Length > 0)
                    {
                        Response.Redirect(sPage + "?" + sQueryString);
                    }
                    else
                    {
                        Response.Redirect(Login_FormAction);
                    }
                }
                else
                {
                    Login_message.Visible = true;
                }
                // Login Login end
            }
        }