918博天堂

Server : Microsoft-IIS/10.0
System : Windows NT EBS-6136 10.0 build 17763 (Windows Server 2016) i586
User : jxgj ( 0)
PHP Version : 7.0.33
Disable Function : passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server
Directory :  D:/tmp_aspnet/root/dc15253c/377bd30d/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : D:/tmp_aspnet/root/dc15253c/377bd30d/App_Web_7dsc66iy.17.cs
?#pragma checksum "D:\wwwroot\jmxbaogao\wwwroot\Counter\NewMembersLogin.ashx" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "48B3055FBFB9DD4DF5168A5424A26458"

#line 1 "D:\wwwroot\jmxbaogao\wwwroot\Counter\NewMembersLogin.ashx"


/****************************************
 * 版权所有:南昌金启软件有限公司
 * 网    址:www.21it.com
 ****************************************/
using System;
using System.Data;
using System.Web;
using System.Web.Security;
using Com.Huji.DataBll;
using Com.Huji.DataModel;
using Com.Huji.DataTools;
using Com.Huji.Web.Pager;

namespace Com.Huji.Web.Counter
{
    public class NewMembersLogin : BaseHandler
    {
        public override void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";
            if (!ProcessRequestError()) return;
            int returnvalue;
            switch (Converts.ToInt32(context.Request.Params["handler"]))
            {
                //若是登录成功,则显示登录信息
                case PublicParameters.OnePram:
                case PublicParameters.FivePram: context.Response.Write(showMember(context)); break;
                case PublicParameters.SixPram: context.Response.Write(showMemberMobile(context)); break;
                case PublicParameters.SevenPram: otherLogin(context); break;

                //进行登录验证
                case PublicParameters.TwoPram: context.Response.Write(GetMemberId == PublicParameters.ZeroPram.ToString() ? "login" : "ok"); break;
                //默认是用于登录的
                default:

                    //登录存在有验证码和无验证码区别
                    if (!String.IsNullOrEmpty(context.Request.Params["code"]) && context.Session[ASPNETAJAXWeb.ValidateCode.Page.ValidateCode.VALIDATECODEKEY] != null && context.Request.Params["code"] != context.Session[ASPNETAJAXWeb.ValidateCode.Page.ValidateCode.VALIDATECODEKEY].ToString().Trim().ToLower())
                    {
                        Converts.ResponseWriteEnd(context, "code");
                    }
                    else
                    {
                        //context.Session[ASPNETAJAXWeb.ValidateCode.Page.ValidateCode.VALIDATECODEKEY] = null;
                        returnvalue = new NewMembersBll().GetNewMembersLogin(context.Request.Params["username"], FormsAuthentication.HashPasswordForStoringInConfigFile(context.Request.Params["password"], "md5"), Converts.GetClientIP);
                        switch (returnvalue)
                        {
                            case -1: Converts.ResponseWriteEnd(context, "error"); break;
                            default:

                                HttpContext.Current.Session["Member_Id"] = returnvalue.ToString();
                                HttpContext.Current.Session["Member_Type"] = new NewMembersBll().GetNewMembersModel(returnvalue).MembersType.ToString();
                                HttpContext.Current.Session["Other_Type"] = String.Empty;
                                Converts.ResponseWriteEnd(context, "ok");
                                break;
                        }
                    }
                    break;

            }
        }


        private void otherLogin(HttpContext context)
        {
            NewMembersLoginData data = new NewMembersLoginData();
            data.Uid = context.Request.Params["uid"];
            data.COtherName = context.Request.Params["cname"];
            data.Type = Converts.ToInt32(context.Request.Params["type"]);

            int returnvalue = new NewMembersLoginBll().UpdateSysUsersLogin(data, 0);
            switch (returnvalue)
            {
                case -1: Converts.ResponseWriteEnd(context, "error"); break;
                default:
                    HttpContext.Current.Session["Member_Id"] = returnvalue.ToString();
                    HttpContext.Current.Session["Member_Type"] = new NewMembersBll().GetNewMembersModel(returnvalue).MembersType.ToString();
                    HttpContext.Current.Session["Other_Type"] = data.Type.ToString();
                    Converts.ResponseWriteEnd(context, "ok");
                    break;
            }
        }

        private string showMemberMobile(HttpContext context)
        {
            StringText builder = new StringText();

            if (GetMemberId == PublicParameters.ZeroPram.ToString())
            {
                builder.Append(2, "<li><a href=\"" + PlatFormWebSite + PlatFormPath + "/UserCenter/Login.aspx\">" + ShowLangInfo("HeadMeunLogin", context) + "</a></li>");
                builder.Append(2, "<li><a href=\"" + PlatFormWebSite + PlatFormPath + "/UserCenter/Register.aspx\" target=\"_blank\">" + ShowLangInfo("HeadMeunReg", context) + "</a></li>");

            }
            else
            {
                //若是密码为空,则以为是新增的第三方登录
                if (String.IsNullOrEmpty(MemberData.Members02))
                    builder.Append(1, "<li><a href=\"" + PlatFormWebSite + PlatFormPath + "/UserCenter/Members/NewMembersAdd.aspx\">" + MemberData.Members01 + " </a></li>");
                else
                    builder.Append(1, "<li><a href=\"" + PlatFormWebSite + PlatFormPath + "/UserCenter/Desktop.aspx\">" + MemberData.Members01 + " </a></li>");
                builder.Append(1, "<li><a href=\"" + PlatFormWebSite + "/UserCenter/Logout.aspx?Action=4\" onclick=\"return confirm('" + ShowLangInfo("HeadMeunIsLogOut", context) + "')\">" + ShowLangInfo("HeadMeunLogOut", context) + "</a></li>");
            }
            return builder.ToString();
        }


        private string showMember(HttpContext context)
        {
            StringText builder = new StringText();
            DataTable dt = (DataTable)context.Session["OrderCar"];

            if (GetMemberId == PublicParameters.ZeroPram.ToString())
            {
                if (Converts.ToBoolean(EncryptUtil.DESDecrypt("IsOrder")))
                {
                    builder.Append(1, "<li><a href=\"javascript:getProduct();\" >" + ShowLangInfo("HeadMeunShopCart", context) + (dt == null || dt.Rows.Count == 0 ? "" : "(<strong>" + dt.Rows.Count + "</strong>)") + "</a></li>");
                }

                builder.Append(1, "<li><a href=\"/UserCenter/Register.aspx\" target=\"_blank\">" + ShowLangInfo("HeadMeunReg", context) + "</a></li>");

                if (Converts.ToInt32(context.Request.Params["handler"]) == PublicParameters.FivePram)
                {
                    builder.Append(1, "<li><a href=\"javascript:theLogin();\" class=\"login\">" + ShowLangInfo("HeadMeunLogin", context) + "</a></li>");
                    builder.Append(1, "<li><input id=\"txtpassword\" class=\"password\" value='' type=\"password\" /></li>");
                    builder.Append(1, "<li>" + ShowLangInfo("MembersPassWord", context) + "</li>");
                    builder.Append(1, "<li><input id=\"txtusername\" class=\"input\" value='' type=\"text\" /></li>");
                    builder.Append(1, "<li>" + ShowLangInfo("MembersUserName", context) + "</li>");
                }
                else
                    builder.Append(1, "<li><a href=\"javascript:dialogLogin();\">" + ShowLangInfo("HeadMeunLogin", context) + "</a></li>");

            }
            else
            {
                builder.Append(1, "<li><a href=\"/UserCenter/Logout.aspx?Action=3\" onclick=\"return confirm('" + ShowLangInfo("HeadMeunIsLogOut", context) + "')\">" + ShowLangInfo("HeadMeunLogOut", context) + "</a></li>");
                if (Converts.ToBoolean(EncryptUtil.DESDecrypt("IsOrder")))
                {
                    builder.Append(1, "<li><a href=\"javascript:getProduct();\" >" + ShowLangInfo("HeadMeunShopCart", context) + (dt == null || dt.Rows.Count == 0 ? "" : "(<strong>" + dt.Rows.Count + "</strong>)") + "</a></li>");
                }
                //若是密码为空,则以为是新增的第三方登录
                if (String.IsNullOrEmpty(MemberData.Members02))
                    builder.Append(1, "<li><a href=\"" + PlatFormWebSite + PlatFormPath + "/UserCenter/Members/NewMembersAdd.aspx\">" + ShowLangInfo("HeadMeunCenter", context) + " </a></li>");
                else
                {
                    if (Converts.ToBoolean(EncryptUtil.DESDecrypt("IsOrder")))
                        builder.Append(1, "<li><a href=\"/UserCenter/Order/NewOrderList.aspx\" >" + ShowLangInfo("HeadMeunCenter", context) + "</a></li>");
                    else
                        builder.Append(1, "<li><a href=\"/UserCenter/Desktop.aspx\" >" + ShowLangInfo("HeadMeunCenter", context) + "</a></li>");
                }
                builder.Append(1, "<li>" + ShowLangInfo("HeadMeunHello", context) + " " + MemberData.Members01 + " </a></li>");

            }
            return builder.ToString();
        }
    }
}

#line default
#line hidden