private void UpdateStatusChild() { string uid = LSRequest.qq("uid").Trim(); string str2 = LSRequest.qq("status").Trim(); cz_users_child userByUID = CallBLL.cz_users_child_bll.GetUserByUID(uid); string str3 = ""; if (userByUID != null) { str3 = userByUID.get_status().ToString(); } string str4 = this.Session["user_name"].ToString(); if (!userByUID.get_parent_u_name().Equals(str4)) { base.Response.End(); } if (CallBLL.cz_users_child_bll.UpdateStatus(uid, str2)) { if (FileCacheHelper.get_RedisStatOnline().Equals(1)) { base.UpdateIsOutOpt(userByUID.get_u_name()); } else if (FileCacheHelper.get_RedisStatOnline().Equals(2)) { base.UpdateIsOutOptStack(userByUID.get_u_name()); } base.user_change_status_log(uid, str3, true); base.Response.Write("1"); } else { base.Response.Write("0"); } }
protected void Page_Load(object sender, EventArgs e) { string str = this.Session["user_name"].ToString(); agent_userinfo_session model = this.Session[str + "lottery_session_user_info"] as agent_userinfo_session; base.Permission_Aspx_ZJ(model, "po_2_1"); base.Permission_Aspx_DL(model, "po_6_1"); this.u_type = model.get_u_type().Trim(); if (this.Session["child_user_name"] != null) { this.isCloneUser = true; this.cloneName = this.Session["child_user_name"].ToString(); } this.u_id = LSRequest.qq("uid"); if (string.IsNullOrEmpty(this.u_id)) { base.Response.End(); } this.u_name = CallBLL.cz_users_bll.GetUserNameByUid(this.u_id, ref this.isChild); if (string.IsNullOrEmpty(this.u_name)) { base.Response.Redirect("/MessagePage.aspx?code=u100014&url=&issuccess=1&isback=0"); base.Response.End(); } if (CallBLL.cz_users_bll.GetUserInfoByUID(this.u_id) == null) { cz_users_child userByUID = CallBLL.cz_users_child_bll.GetUserByUID(this.u_id); if ((userByUID != null) && userByUID.get_parent_u_name().Equals(model.get_u_name())) { if (!base.IsUpperLowerLevels(userByUID.get_parent_u_name(), model.get_u_type(), model.get_u_name())) { base.Response.Redirect("/MessagePage.aspx?code=u100014&url=&issuccess=1&isback=0"); base.Response.End(); } } else { base.Response.Redirect("/MessagePage.aspx?code=u100014&url=&issuccess=1&isback=0"); base.Response.End(); } } else if (!base.IsUpperLowerLevels(this.u_name, model.get_u_type(), model.get_u_name())) { base.Response.Redirect("/MessagePage.aspx?code=u100014&url=&issuccess=1&isback=0"); base.Response.End(); } this.page = LSRequest.qq("page"); if (string.IsNullOrEmpty(this.page)) { this.page = "1"; } if (int.Parse(this.page) < 1) { this.page = "1"; } this.dataTable = CallBLL.cz_login_log_bll.get_log_table(Convert.ToInt32(this.page) - 1, this.pageSize, ref this.pageCount, ref this.dataCount, this.u_name.Trim(), ref this.isAll); this.FiledValue = new string[] { this.u_id }; }
private void AddUser() { LSRequest.qq("userName"); string str = LSRequest.qq("userPassword"); string str2 = LSRequest.qq("userNicker"); string str3 = LSRequest.qq("qx"); string str4 = LSRequest.qq("unlock"); string message = ""; if (!base.ValidParamByUserEdit("child", ref message, null, null, null)) { base.Response.Write(base.ShowDialogBox(message, null, 400)); base.Response.End(); } if (!string.IsNullOrEmpty(str.Trim()) && !Regexlib.IsValidPassword(str.Trim(), base.get_GetPasswordLU())) { if (base.get_GetPasswordLU().Equals("1")) { base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!", null, 400)); } else { base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含字母、和数字!", null, 400)); } base.Response.End(); } cz_users_child _child = new cz_users_child(); _child.set_u_id(this.u_id.ToString().ToUpper()); _child.set_u_nicker(str2.Trim()); if (!string.IsNullOrEmpty(str4) && (str4 == "1")) { _child.set_retry_times(0); } if (!string.IsNullOrEmpty(str)) { string ramSalt = Utils.GetRamSalt(6); _child.set_u_psw(DESEncrypt.EncryptString(str, ramSalt)); _child.set_salt(ramSalt); } _child.set_permissions_name(str3.Trim()); cz_users_child userByUID = CallBLL.cz_users_child_bll.GetUserByUID(_child.get_u_id()); if (CallBLL.cz_users_child_bll.UpdateUser(_child)) { base.user_edit_children_log(userByUID, _child); base.Response.Write(base.ShowDialogBox("修改子帳號成功!", base.UserReturnBackUrl, 0)); base.Response.End(); } else { base.Response.Write(base.ShowDialogBox("修改子帳號失敗!", base.UserReturnBackUrl, 400)); base.Response.End(); } }
private void AddUser() { string str = LSRequest.qq("userName").ToLower().Trim(); string str2 = LSRequest.qq("userPassword"); string str3 = LSRequest.qq("userNicker"); string str4 = LSRequest.qq("qx"); string message = ""; if (!base.ValidParamByUserAdd("child", ref message, null, null, null)) { base.Response.Write(base.ShowDialogBox(message, null, 400)); base.Response.End(); } if (!Regexlib.IsValidPassword(str2.Trim(), base.get_GetPasswordLU())) { if (base.get_GetPasswordLU().Equals("1")) { base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!", null, 400)); } else { base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含字母、和数字!", null, 400)); } base.Response.End(); } cz_users_child model = new cz_users_child(); model.set_u_id(Guid.NewGuid().ToString().ToUpper()); model.set_u_name(str.Trim()); model.set_u_nicker(str3.Trim()); model.set_u_skin(base.GetUserSkin("agent")); string ramSalt = Utils.GetRamSalt(6); model.set_u_psw(DESEncrypt.EncryptString(str2, ramSalt)); model.set_salt(ramSalt); model.set_parent_u_name(this.Session["user_name"].ToString()); model.set_add_date(new DateTime?(DateTime.Now)); model.set_status(0); model.set_permissions_name(str4.Trim()); if (CallBLL.cz_users_child_bll.AddUser(model)) { base.user_add_children_log(model); base.Response.Write(base.ShowDialogBox("添加子帳號成功!", base.UserReturnBackUrl, 0)); base.Response.End(); } else { base.Response.Write(base.ShowDialogBox("添加子帳號失敗!", base.UserReturnBackUrl, 400)); base.Response.End(); } }
private void AddUser() { LSRequest.qq("cloneName"); string str = LSRequest.qq("password"); string str2 = LSRequest.qq("nicker"); string str3 = LSRequest.qq("qx"); string str4 = LSRequest.qq("isLocked"); string message = ""; if (!base.ValidParamByUserEditPhone("child", ref message, null, null, null)) { base.noRightOptMsg(message); } if (!string.IsNullOrEmpty(str.Trim()) && !Regexlib.IsValidPassword(str.Trim(), base.get_GetPasswordLU())) { if (base.get_GetPasswordLU().Equals("1")) { base.noRightOptMsg("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!"); } else { base.noRightOptMsg("密碼要8-20位,且必需包含字母、和数字!"); } } cz_users_child _child = new cz_users_child(); _child.set_u_id(this.u_id.ToString().ToUpper()); _child.set_u_nicker(str2.Trim()); if (!string.IsNullOrEmpty(str4) && (str4 == "1")) { _child.set_retry_times(0); } if (!string.IsNullOrEmpty(str)) { string ramSalt = Utils.GetRamSalt(6); _child.set_u_psw(DESEncrypt.EncryptString(str, ramSalt)); _child.set_salt(ramSalt); } _child.set_permissions_name(str3.Trim()); cz_users_child userByUID = CallBLL.cz_users_child_bll.GetUserByUID(_child.get_u_id()); if (CallBLL.cz_users_child_bll.UpdateUser(_child)) { base.user_edit_children_log(userByUID, _child); base.successOptMsg("修改子帳號成功!"); } else { base.noRightOptMsg("修改子帳號失敗!"); } }
private void UpdateStatusChild() { string uid = LSRequest.qq("uid").Trim(); string str2 = LSRequest.qq("userState").Trim(); cz_users_child userByUID = CallBLL.cz_users_child_bll.GetUserByUID(uid); string str3 = ""; if (userByUID != null) { str3 = userByUID.get_status().ToString(); } string str4 = this.Session["user_name"].ToString(); if ((userByUID.get_parent_u_name().Equals(str4) && (str3 != str2)) && CallBLL.cz_users_child_bll.UpdateStatus(uid, str2)) { base.user_change_status_log(uid, str3, true); } }
protected void Page_Load(object sender, EventArgs e) { agent_userinfo_session _session = this.Session[this.Session["user_name"].ToString() + "lottery_session_user_info"] as agent_userinfo_session; this.skin = _session.get_u_skin(); string str = LSRequest.qq("hdnsubmit"); string str2 = LSRequest.qq("txtoldpwd"); string str3 = LSRequest.qq("txtnewpwd"); string str4 = LSRequest.qq("txtnewpwdcf"); if (str.Equals("submit")) { if ((string.IsNullOrEmpty(str2) || string.IsNullOrEmpty(str3)) || string.IsNullOrEmpty(str4)) { base.Response.Write(base.ShowDialogBox("請輸入完整的密碼!", "", 400)); base.Response.End(); } if (str3 == str2) { base.Response.Write(base.ShowDialogBox("新密碼和舊密碼不能相同!", "", 400)); base.Response.End(); } if (str3 != str4) { base.Response.Write(base.ShowDialogBox("新密碼和確認新密碼不一致!", "", 400)); base.Response.End(); } if (!Regexlib.IsValidPassword(str3.Trim(), base.get_GetPasswordLU())) { if (base.get_GetPasswordLU().Equals("1")) { base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!", "", 400)); base.Response.End(); } else { base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含字母、和数字!", "", 400)); base.Response.End(); } base.Response.End(); } if (_session.get_users_child_session() == null) { cz_users _users = CallBLL.cz_users_bll.AgentLogin(this.Session["user_name"].ToString()); if (_users != null) { string str5 = _users.get_salt().Trim(); string str6 = DESEncrypt.EncryptString(str2, str5); if (_users.get_u_psw() != str6) { base.Response.Write(base.ShowDialogBox("您輸入原密碼不正確!", "", 400)); base.Response.End(); } else { string ramSalt = Utils.GetRamSalt(6); if (CallBLL.cz_users_bll.UpUserPwd(this.Session["user_name"].ToString(), DESEncrypt.EncryptString(str3, ramSalt), ramSalt) > 0) { int num = CallBLL.cz_users_bll.UpdateUserPwdStutas(this.Session["user_name"].ToString()); base.log_user_reset_password(this.Session["user_name"].ToString(), this.Session["user_name"].ToString(), "", this.Session["modifypassword"]); this.Session["modifypassword"] = null; string url = "Quit.aspx"; base.Response.Write(base.ShowDialogBox("修改密碼成功!", url, 0)); base.Response.End(); } else { base.Response.Write(base.ShowDialogBox("修改密碼不成功!", "", 400)); base.Response.End(); } } } } else { cz_users_child _child = CallBLL.cz_users_child_bll.AgentLogin(this.Session["child_user_name"].ToString().ToLower()); if (_child != null) { string str9 = _child.get_salt().Trim(); string str10 = DESEncrypt.EncryptString(str2, str9); if (_child.get_u_psw() != str10) { base.Response.Write(base.ShowDialogBox("您輸入原密碼不正確!", "", 400)); base.Response.End(); } else { string str11 = Utils.GetRamSalt(6); if (CallBLL.cz_users_child_bll.UpUserPwd(this.Session["child_user_name"].ToString(), DESEncrypt.EncryptString(str3, str11), str11) > 0) { int num2 = CallBLL.cz_users_bll.UpdateUserPwdStutas(this.Session["child_user_name"].ToString().ToLower()); base.log_user_reset_password(this.Session["child_user_name"].ToString(), this.Session["child_user_name"].ToString(), "", this.Session["modifypassword"]); this.Session["modifypassword"] = null; string str12 = "Quit.aspx"; base.Response.Write(base.ShowDialogBox("修改密碼成功!", str12, 0)); base.Response.End(); } else { base.Response.Write(base.ShowDialogBox("修改密碼不成功!", "", 400)); base.Response.End(); } } } } } }
protected void Page_Load(object sender, EventArgs e) { string str = this.Session["user_name"].ToString(); this.userModel = this.Session[str + "lottery_session_user_info"] as agent_userinfo_session; if (((!this.userModel.get_u_type().Trim().Equals("zj") && !this.userModel.get_u_type().Trim().Equals("fgs")) && (!this.userModel.get_u_type().Trim().Equals("gd") && !this.userModel.get_u_type().Trim().Equals("zd"))) && !this.userModel.get_u_type().Trim().Equals("dl")) { base.Response.Redirect("../MessagePage.aspx?code=u100035&url=&issuccess=1&isback=0&isopen=1"); base.Response.End(); } if (this.Session["child_user_name"] != null) { base.Response.Redirect("../MessagePage.aspx?code=u100014&url=&issuccess=1&isback=0&isopen=1"); base.Response.End(); } string str3 = this.userModel.get_u_type().ToLower(); if (str3 != null) { if (!(str3 == "zj")) { if (str3 == "fgs") { this.utypeTxt = "分公司"; } else if (str3 == "gd") { this.utypeTxt = "股東"; } else if (str3 == "zd") { this.utypeTxt = "總代"; } else if (str3 == "dl") { this.utypeTxt = "代理"; } } else { this.utypeTxt = "總監"; } } this.u_id = LSRequest.qq("uid"); this.userChildModel = CallBLL.cz_users_child_bll.GetUserByUID(this.u_id); if (this.userChildModel == null) { base.Response.Redirect("../MessagePage.aspx?code=u100038&url=&issuccess=1&isback=0&isopen=1&isopen=1"); base.Response.End(); } if (!this.userChildModel.get_is_admin().Equals(0)) { base.Response.End(); } if (!this.userChildModel.get_parent_u_name().Equals(str)) { base.Response.End(); } this.InitPermissions(); this.is_locked = base.is_locked_user(this.userChildModel.get_retry_times().ToString()); if (LSRequest.qq("hdnadd").Equals("hdnadd")) { this.AddUser(); } }
private void user_login(HttpContext context, ref string strResult) { string str = ""; string str2 = ""; string str3 = ""; string str4 = ""; ReturnResult result = new ReturnResult(); Dictionary <string, object> dictionary = new Dictionary <string, object> { { "type", "user_login" } }; string loginName = LSRequest.qq("loginName").Trim().ToLower(); string loginPwd = LSRequest.qq("loginPwd").Trim(); string ValidateCode = LSRequest.qq("ValidateCode").Trim(); if (PageBase.is_ip_locked()) { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo("由於輸入錯誤次數過多,您已被禁用,請稍後再試!"); strResult = JsonHandle.ObjectToJson(result); } else if (string.IsNullOrEmpty(loginName) || string.IsNullOrEmpty(loginPwd)) { context.Response.End(); } else { DateTime time = new DateTime(); string retry_times; string str10; string str11; string str14; DateTime?nullable; int num2; DateTime?nullable3; DateTime time2; if (int.Parse(FileCacheHelper.get_GetLockedPasswordCount()) == 0) { context.Session["lottery_session_img_code_display"] = 1; } if (context.Session["lottery_session_img_code_display"] == null) { if (CallBLL.cz_user_psw_err_log_bll.IsExistUser(loginName)) { // TODO 登录超时 // if (PageBase.IsErrTimesAbove(ref time, str5)) // { // if (!PageBase.IsErrTimeout(time)) // { // context.Session["lottery_session_img_code"] = null; // result.set_success(400); // result.set_tipinfo(""); // dictionary.Add("is_display_code", "1"); // result.set_data(dictionary); // strResult = JsonHandle.ObjectToJson(result); // context.Session["lottery_session_img_code_display"] = 1; // return; // } // CallBLL.cz_user_psw_err_log_bll.ZeroErrTimes(str5); // context.Session["lottery_session_img_code"] = null; // context.Session["lottery_session_img_code_display"] = 0; // } // else // { // context.Session["lottery_session_img_code"] = null; // context.Session["lottery_session_img_code_display"] = 0; // } } else { context.Session["lottery_session_img_code"] = null; context.Session["lottery_session_img_code_display"] = 0; } } if (context.Session["lottery_session_img_code_display"].ToString() == "0") { if (string.IsNullOrEmpty(loginName) || string.IsNullOrEmpty(loginPwd)) { context.Response.End(); return; } } else { if (string.IsNullOrEmpty(loginName) || string.IsNullOrEmpty(loginPwd)) { context.Response.End(); return; } if (string.IsNullOrEmpty(ValidateCode)) { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo(""); dictionary.Add("is_display_code", "1"); result.set_data(dictionary); strResult = JsonHandle.ObjectToJson(result); context.Session["lottery_session_img_code_display"] = 1; return; } if (context.Session["lottery_session_img_code"] == null) { context.Response.End(); return; } if (context.Session["lottery_session_img_code"].ToString().ToLower() != ValidateCode.ToLower()) { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo(PageBase.GetMessageByCache("u100001", "MessageHint")); strResult = JsonHandle.ObjectToJson(result); return; } } cz_users _users = CallBLL.cz_users_bll.AgentLogin(loginName.ToLower()); cz_users_child _child = null; if (_users == null) { _child = CallBLL.cz_users_child_bll.AgentLogin(loginName.ToLower()); if (_child != null) { retry_times = _child.get_retry_times().ToString(); if (!string.IsNullOrEmpty(retry_times) && (int.Parse(retry_times) > int.Parse(FileCacheHelper.get_GetLockedUserCount()))) { if (!PageBase.IsLockedTimeout(loginName, "child")) { context.Session["lottery_session_img_code"] = null; result.set_success(560); result.set_tipinfo("您的帳號因密碼多次輸入錯誤被鎖死,請與管理員聯系!"); strResult = JsonHandle.ObjectToJson(result); return; } PageBase.zero_retry_times_children(loginName); } str10 = _child.get_salt().Trim(); str11 = DESEncrypt.EncryptString(loginPwd, str10); if (_child.get_u_psw() != str11) { context.Session["lottery_session_img_code"] = null; PageBase.inc_retry_times_children(loginName); PageBase.login_error_ip(); result.set_success(400); result.set_tipinfo(PageBase.GetMessageByCache("u100003", "MessageHint")); strResult = JsonHandle.ObjectToJson(result); if (context.Session["lottery_session_img_code_display"].ToString() == "0") { if (CallBLL.cz_user_psw_err_log_bll.IsExistUser(loginName)) { CallBLL.cz_user_psw_err_log_bll.UpdateErrTimes(loginName); } else { CallBLL.cz_user_psw_err_log_bll.AddUser(loginName); } if (PageBase.IsErrTimesAbove(ref time, loginName)) { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo(PageBase.GetMessageByCache("u100003", "MessageHint")); dictionary.Add("is_display_code", "1"); result.set_data(dictionary); strResult = JsonHandle.ObjectToJson(result); context.Session["lottery_session_img_code_display"] = 1; } } return; } str2 = _child.get_status().ToString(); str3 = PageBase.upper_user_status(_child.get_parent_u_name()); _users = CallBLL.cz_users_bll.AgentLogin(_child.get_parent_u_name()); } else { context.Session["lottery_session_img_code"] = null; PageBase.login_error_ip(); result.set_success(400); result.set_tipinfo(PageBase.GetMessageByCache("u100002", "MessageHint")); dictionary.Add("fs_name", "loginName"); strResult = JsonHandle.ObjectToJson(result); return; } PageBase.zero_retry_times_children(loginName); } else { retry_times = _users.get_retry_times().ToString(); if (!string.IsNullOrEmpty(retry_times) && (int.Parse(retry_times) > int.Parse(FileCacheHelper.get_GetLockedUserCount()))) { if (!PageBase.IsLockedTimeout(loginName, "master")) { context.Session["lottery_session_img_code"] = null; result.set_success(560); result.set_tipinfo("您的帳號因密碼多次輸入錯誤被鎖死,請與管理員聯系!"); strResult = JsonHandle.ObjectToJson(result); return; } PageBase.zero_retry_times(loginName); } str = _users.get_a_state().ToString(); string str12 = _users.get_a_state().ToString(); str4 = PageBase.upper_user_status(_users.get_u_name()); if (str12.Equals("2")) { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo(PageBase.GetMessageByCache("u100005", "MessageHint")); dictionary.Add("fs_name", "loginName"); strResult = JsonHandle.ObjectToJson(result); context.Session.Abandon(); return; } if (str4 == "2") { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo("您的上級帳號已被停用,请与管理员联系!"); strResult = JsonHandle.ObjectToJson(result); context.Session.Abandon(); return; } str = (str12 == null) ? "0" : str; str10 = _users.get_salt().Trim(); str11 = DESEncrypt.EncryptString(loginPwd, str10); if (_users.get_u_psw() != str11) { context.Session["lottery_session_img_code"] = null; PageBase.inc_retry_times(loginName); PageBase.login_error_ip(); result.set_success(400); result.set_tipinfo(PageBase.GetMessageByCache("u100003", "MessageHint")); strResult = JsonHandle.ObjectToJson(result); if (context.Session["lottery_session_img_code_display"].ToString() == "0") { if (CallBLL.cz_user_psw_err_log_bll.IsExistUser(loginName)) { CallBLL.cz_user_psw_err_log_bll.UpdateErrTimes(loginName); } else { CallBLL.cz_user_psw_err_log_bll.AddUser(loginName); } if (PageBase.IsErrTimesAbove(ref time, loginName)) { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo(PageBase.GetMessageByCache("u100003", "MessageHint")); dictionary.Add("is_display_code", "1"); result.set_data(dictionary); strResult = JsonHandle.ObjectToJson(result); context.Session["lottery_session_img_code_display"] = 1; } } return; } PageBase.zero_retry_times(loginName); } if (!string.IsNullOrEmpty(str2)) { context.Session["user_name"] = _users.get_u_name().Trim(); context.Session["user_type"] = _users.get_u_type().Trim(); context.Session["child_user_name"] = _child.get_u_name().Trim(); context.Session["user_state"] = str2.Trim(); if (str2.Equals("2")) { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo("您的帳號已被停用,请与管理员联系!"); strResult = JsonHandle.ObjectToJson(result); context.Session.Abandon(); return; } if (_users.get_a_state() == 2) { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo("您的主帳號已被停用,请与管理员联系!"); strResult = JsonHandle.ObjectToJson(result); context.Session.Abandon(); return; } if (str3 == "2") { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo("您的上級帳號已被停用,请与管理员联系!"); strResult = JsonHandle.ObjectToJson(result); context.Session.Abandon(); return; } if (str2 == "1") { result.set_success(200); result.set_tipinfo(PageBase.GetMessageByCache("u100004", "MessageHint")); strResult = JsonHandle.ObjectToJson(result); context.Session["user_state"] = str2; } else if (_users.get_a_state() == 1) { result.set_success(200); result.set_tipinfo("您的主帳號已被凍結,请与管理员联系!"); strResult = JsonHandle.ObjectToJson(result); context.Session["user_state"] = _users.get_a_state().ToString(); } else if (str3 == "1") { result.set_success(200); result.set_tipinfo(PageBase.GetMessageByCache("u100006", "MessageHint")); strResult = JsonHandle.ObjectToJson(result); context.Session["user_state"] = str3; } else { context.Session["user_state"] = "0"; result.set_success(200); strResult = JsonHandle.ObjectToJson(result); } } else { context.Session["user_name"] = _users.get_u_name().Trim(); context.Session["user_type"] = _users.get_u_type().Trim(); context.Session["user_state"] = str.Trim(); if (str.Equals("1")) { result.set_success(200); result.set_tipinfo(PageBase.GetMessageByCache("u100004", "MessageHint")); strResult = JsonHandle.ObjectToJson(result); context.Session["user_state"] = str; } else if (str4 == "1") { result.set_success(200); result.set_tipinfo(PageBase.GetMessageByCache("u100006", "MessageHint")); strResult = JsonHandle.ObjectToJson(result); context.Session["user_state"] = str4; } else { context.Session["user_state"] = "0"; result.set_success(200); strResult = JsonHandle.ObjectToJson(result); } } agent_userinfo_session _session = new agent_userinfo_session(); _session.set_u_id(_users.get_u_id()); _session.set_u_name(_users.get_u_name().Trim()); _session.set_u_psw(_users.get_u_psw().Trim()); _session.set_u_nicker(_users.get_u_nicker().Trim()); _session.set_u_skin(_users.get_u_skin().Trim()); if (_child != null) { if (string.IsNullOrEmpty(_child.get_u_skin())) { _session.set_u_skin(""); } else { _session.set_u_skin(_child.get_u_skin()); } } _session.set_sup_name(_users.get_sup_name().Trim()); _session.set_u_type(_users.get_u_type().Trim()); _session.set_su_type(_users.get_su_type().Trim()); _session.set_a_state(_users.get_a_state()); _session.set_six_kind(_users.get_six_kind()); _session.set_kc_kind(_users.get_kc_kind()); _session.set_allow_sale(_users.get_allow_sale()); _session.set_kc_allow_sale(_users.get_kc_allow_sale()); _session.set_negative_sale(_users.get_negative_sale()); if (!_users.get_allow_view_report().HasValue) { _session.set_allow_view_report(0); } else { _session.set_allow_view_report(_users.get_allow_view_report()); } DataRow item = CallBLL.cz_admin_sysconfig_bll.GetItem(); if (item == null) { _session.set_u_skin("Blue"); } else { string str13 = item["agent_skin"].ToString(); if (string.IsNullOrEmpty(_session.get_u_skin()) || (str13.IndexOf(_session.get_u_skin()) < 0)) { _session.set_u_skin(str13.Split(new char[] { '|' })[0]); } } if (_child != null) { _child.set_salt(""); } _session.set_users_child_session(_child); DataTable zJInfo = CallBLL.cz_users_bll.GetZJInfo(); if (zJInfo != null) { _session.set_zjname(zJInfo.Rows[0]["u_name"].ToString().Trim()); } if (!_session.get_u_type().ToLower().Equals("zj")) { cz_rate_kc rateKCByUserName = CallBLL.cz_rate_kc_bll.GetRateKCByUserName(_session.get_u_name()); _session.set_fgs_name(rateKCByUserName.get_fgs_name()); _session.set_gd_name(rateKCByUserName.get_gd_name()); _session.set_zd_name(rateKCByUserName.get_zd_name()); _session.set_dl_name(rateKCByUserName.get_dl_name()); DataTable userOpOdds = CallBLL.cz_rate_kc_bll.GetUserOpOdds(_session.get_u_name()); if (userOpOdds != null) { if ((userOpOdds.Rows[0]["six_op_odds"] != null) && (userOpOdds.Rows[0]["six_op_odds"].ToString() != "")) { _session.set_six_op_odds(new int?(int.Parse(userOpOdds.Rows[0]["six_op_odds"].ToString()))); } if ((userOpOdds.Rows[0]["kc_op_odds"] != null) && (userOpOdds.Rows[0]["kc_op_odds"].ToString() != "")) { _session.set_kc_op_odds(new int?(int.Parse(userOpOdds.Rows[0]["kc_op_odds"].ToString()))); } } } context.Session["child_user_name"] = null; if (_child != null) { context.Session["child_user_name"] = _child.get_u_name(); } context.Session["user_name"] = _users.get_u_name(); context.Session[_users.get_u_name() + "lottery_session_user_info"] = _session; PageBase.SetAppcationFlag(loginName); if (FileCacheHelper.get_RedisStatOnline().Equals(1) || FileCacheHelper.get_RedisStatOnline().Equals(2)) { bool flag4 = false; if ((_session.get_users_child_session() != null) && _session.get_users_child_session().get_is_admin().Equals(1)) { flag4 = true; } if (!flag4) { // if (FileCacheHelper.get_RedisStatOnline().Equals(1)) // { // new PageBase_Redis().InitUserOnlineTopToRedis(str5, _session.get_u_type()); // } // if (FileCacheHelper.get_RedisStatOnline().Equals(2)) // { // new PageBase_Redis().InitUserOnlineTopToRedisStack(str5, _session.get_u_type()); // } } } else { MemberPageBase.stat_top_online(loginName); MemberPageBase.stat_online(loginName, _session.get_u_type()); } if (FileCacheHelper.get_RedisStatOnline() == 0) { PageBase.ZeroIsOutFlag(loginName); } CallBLL.cz_user_psw_err_log_bll.ZeroErrTimes(loginName); cz_login_log _log = new cz_login_log(); _log.set_ip(LSRequest.GetIP()); _log.set_login_time(new DateTime?(DateTime.Now)); _log.set_u_name(loginName); PageBase base2 = new PageBase(); // _log.set_browser_type(Utils.GetBrowserInfo(HttpContext.Current)); bool flag5 = CallBLL.cz_login_log_bll.Add(_log); if (_child == null) { str14 = _users.get_is_changed().ToString(); if (string.IsNullOrEmpty(str14)) { result.set_success(550); result.set_tipinfo("新密碼首次登錄,需重置密碼!"); strResult = JsonHandle.ObjectToJson(result); context.Session["modifypassword"] = "******"; } else if (str14 == "0") { result.set_success(550); result.set_tipinfo("新密碼首次登錄,需重置密碼!"); strResult = JsonHandle.ObjectToJson(result); context.Session["modifypassword"] = "******"; } else { nullable = _users.get_last_changedate(); num2 = PageBase.PasswordExpire(); nullable3 = nullable; time2 = DateTime.Now.AddDays((double)-num2); if (nullable3.HasValue ? (nullable3.GetValueOrDefault() < time2) : false) { result.set_success(550); result.set_tipinfo("密碼過期,需重置密碼!"); strResult = JsonHandle.ObjectToJson(result); context.Session["modifypassword"] = "******"; } } } else { str14 = _child.get_is_changed().ToString(); if (string.IsNullOrEmpty(str14)) { result.set_success(550); result.set_tipinfo("新密碼首次登錄,需重置密碼!"); strResult = JsonHandle.ObjectToJson(result); context.Session["modifypassword"] = "******"; } else if (str14 == "0") { result.set_success(550); result.set_tipinfo("新密碼首次登錄,需重置密碼!"); strResult = JsonHandle.ObjectToJson(result); context.Session["modifypassword"] = "******"; } else { nullable = _child.get_last_changedate(); num2 = PageBase.PasswordExpire(); if (nullable.HasValue && ((nullable3 = nullable).HasValue ? (nullable3.GetValueOrDefault() < (time2 = DateTime.Now.AddDays((double)-num2))) : false)) { result.set_success(550); result.set_tipinfo("密碼過期,需重置密碼!"); strResult = JsonHandle.ObjectToJson(result); context.Session["modifypassword"] = "******"; } } } } }
private void userEditPwd(ref string strResult) { base.checkLoginByHandler(0); ReturnResult result = new ReturnResult(); agent_userinfo_session _session = this.Session[this.Session["user_name"].ToString() + "lottery_session_user_info"] as agent_userinfo_session; string str = LSRequest.qq("txtoldpwd"); string str2 = LSRequest.qq("txtnewpwd"); string str3 = LSRequest.qq("txtnewpwdcf"); if ((string.IsNullOrEmpty(str) || string.IsNullOrEmpty(str2)) || string.IsNullOrEmpty(str3)) { result.set_tipinfo("請輸入完整的密碼!"); result.set_success(400); strResult = base.ObjectToJson(result); } else if (str2 == str) { result.set_tipinfo("新密碼和舊密碼不能相同!"); result.set_success(400); strResult = base.ObjectToJson(result); } else if (str2 != str3) { result.set_tipinfo("新密碼和確認新密碼不一致!"); result.set_success(400); strResult = base.ObjectToJson(result); } else if (!Regexlib.IsValidPassword(str2.Trim(), base.get_GetPasswordLU())) { if (base.get_GetPasswordLU().Equals("1")) { result.set_tipinfo("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!"); result.set_success(400); strResult = base.ObjectToJson(result); } else { result.set_tipinfo("密碼要8-20位,且必需包含字母、和数字!"); result.set_success(400); strResult = base.ObjectToJson(result); } } else if (_session.get_users_child_session() == null) { cz_users _users = CallBLL.cz_users_bll.AgentLogin(this.Session["user_name"].ToString()); if (_users != null) { string str4 = _users.get_salt().Trim(); string str5 = DESEncrypt.EncryptString(str, str4); if (_users.get_u_psw() != str5) { result.set_tipinfo("您輸入原密碼不正確!"); result.set_success(400); strResult = base.ObjectToJson(result); } else { string ramSalt = Utils.GetRamSalt(6); if (CallBLL.cz_users_bll.UpUserPwd(this.Session["user_name"].ToString(), DESEncrypt.EncryptString(str2, ramSalt), ramSalt) > 0) { int num = CallBLL.cz_users_bll.UpdateUserPwdStutas(this.Session["user_name"].ToString()); base.log_user_reset_password(this.Session["user_name"].ToString(), this.Session["user_name"].ToString(), "", this.Session["modifypassword"]); this.Session["modifypassword"] = null; this.Session.Abandon(); result.set_tipinfo("修改密碼成功!"); result.set_success(210); strResult = base.ObjectToJson(result); } else { result.set_tipinfo("修改密碼失敗!"); result.set_success(400); strResult = base.ObjectToJson(result); } } } } else { cz_users_child _child = CallBLL.cz_users_child_bll.AgentLogin(this.Session["child_user_name"].ToString().ToLower()); if (_child != null) { string str7 = _child.get_salt().Trim(); string str8 = DESEncrypt.EncryptString(str, str7); if (_child.get_u_psw() != str8) { result.set_tipinfo("您輸入原密碼不正確!"); result.set_success(400); strResult = base.ObjectToJson(result); } else { string str9 = Utils.GetRamSalt(6); if (CallBLL.cz_users_child_bll.UpUserPwd(this.Session["child_user_name"].ToString(), DESEncrypt.EncryptString(str2, str9), str9) > 0) { int num2 = CallBLL.cz_users_bll.UpdateUserPwdStutas(this.Session["child_user_name"].ToString().ToLower()); base.log_user_reset_password(this.Session["child_user_name"].ToString(), this.Session["child_user_name"].ToString(), "", this.Session["modifypassword"]); this.Session["modifypassword"] = null; this.Session.Abandon(); result.set_tipinfo("修改密碼成功!"); result.set_success(210); strResult = base.ObjectToJson(result); } else { result.set_tipinfo("修改密碼失敗!"); result.set_success(400); strResult = base.ObjectToJson(result); } } } } }
private void userLogin(HttpContext context, ref string strResult) { DateTime? nullable12; DateTime time4; string str = ""; string str2 = ""; string str3 = ""; string str4 = ""; ReturnResult result = new ReturnResult(); Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary.Add("type", "user_login"); string str5 = LSRequest.qq("loginName").Trim().ToLower(); string str6 = LSRequest.qq("loginPwd").Trim(); string str7 = LSRequest.qq("ValidateCode").Trim(); if (PageBase.is_ip_locked()) { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo("由於輸入錯誤次數過多,您已被禁用,請稍後再試!"); strResult = JsonHandle.ObjectToJson(result); return; } if (string.IsNullOrEmpty(str5) || string.IsNullOrEmpty(str6)) { context.Response.End(); return; } if (int.Parse(FileCacheHelper.get_GetLockedPasswordCount()) == 0) { context.Session["lottery_session_img_code_display"] = 1; } if (context.Session["lottery_session_img_code_display"] == null) { if (CallBLL.cz_user_psw_err_log_bll.IsExistUser(str5)) { DateTime time; if (PageBase.IsErrTimesAbove(ref time, str5)) { if (!PageBase.IsErrTimeout(time)) { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo(""); dictionary.Add("isDisplayCode", 1); result.set_data(dictionary); strResult = JsonHandle.ObjectToJson(result); context.Session["lottery_session_img_code_display"] = 1; return; } CallBLL.cz_user_psw_err_log_bll.ZeroErrTimes(str5); context.Session["lottery_session_img_code"] = null; context.Session["lottery_session_img_code_display"] = 0; } else { context.Session["lottery_session_img_code"] = null; context.Session["lottery_session_img_code_display"] = 0; } } else { context.Session["lottery_session_img_code"] = null; context.Session["lottery_session_img_code_display"] = 0; } } if (context.Session["lottery_session_img_code_display"].ToString() == "0") { if (string.IsNullOrEmpty(str5) || string.IsNullOrEmpty(str6)) { context.Response.End(); return; } } else { if (string.IsNullOrEmpty(str5) || string.IsNullOrEmpty(str6)) { context.Response.End(); return; } if (string.IsNullOrEmpty(str7)) { context.Session["lottery_session_img_code"] = null; result.set_success(410); result.set_tipinfo(PageBase.GetMessageByCache("u100001", "MessageHint")); dictionary.Add("isDisplayCode", 1); result.set_data(dictionary); strResult = JsonHandle.ObjectToJson(result); context.Session["lottery_session_img_code_display"] = 1; return; } if (context.Session["lottery_session_img_code"] == null) { result.set_success(410); result.set_tipinfo(PageBase.GetMessageByCache("u100001", "MessageHint")); strResult = JsonHandle.ObjectToJson(result); return; } if (context.Session["lottery_session_img_code"].ToString().ToLower() != str7.ToLower()) { context.Session["lottery_session_img_code"] = null; result.set_success(410); result.set_tipinfo(PageBase.GetMessageByCache("u100001", "MessageHint")); strResult = JsonHandle.ObjectToJson(result); return; } } cz_users _users = CallBLL.cz_users_bll.AgentLogin(str5.ToLower()); cz_users_child _child = null; if (_users == null) { _child = CallBLL.cz_users_child_bll.AgentLogin(str5.ToLower()); if (_child != null) { string str9 = _child.get_retry_times().ToString(); if (!string.IsNullOrEmpty(str9) && (int.Parse(str9) > int.Parse(FileCacheHelper.get_GetLockedUserCount()))) { if (!PageBase.IsLockedTimeout(str5, "child")) { context.Session["lottery_session_img_code"] = null; result.set_success(560); result.set_tipinfo("您的帳號因密碼多次輸入錯誤被鎖死,請與管理員聯系!"); strResult = JsonHandle.ObjectToJson(result); return; } PageBase.zero_retry_times_children(str5); } string str10 = _child.get_salt().Trim(); string str11 = DESEncrypt.EncryptString(str6, str10); if (_child.get_u_psw() != str11) { context.Session["lottery_session_img_code"] = null; PageBase.inc_retry_times_children(str5); PageBase.login_error_ip(); result.set_success(400); result.set_tipinfo(PageBase.GetMessageByCache("u100003", "MessageHint")); strResult = JsonHandle.ObjectToJson(result); if (context.Session["lottery_session_img_code_display"].ToString() == "0") { DateTime time2; if (CallBLL.cz_user_psw_err_log_bll.IsExistUser(str5)) { CallBLL.cz_user_psw_err_log_bll.UpdateErrTimes(str5); } else { CallBLL.cz_user_psw_err_log_bll.AddUser(str5); } if (PageBase.IsErrTimesAbove(ref time2, str5)) { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo(PageBase.GetMessageByCache("u100003", "MessageHint")); dictionary.Add("isDisplayCode", 1); result.set_data(dictionary); strResult = JsonHandle.ObjectToJson(result); context.Session["lottery_session_img_code_display"] = 1; } } return; } str2 = _child.get_status().ToString(); str3 = PageBase.upper_user_status(_child.get_parent_u_name()); _users = CallBLL.cz_users_bll.AgentLogin(_child.get_parent_u_name()); } else { context.Session["lottery_session_img_code"] = null; PageBase.login_error_ip(); result.set_success(400); result.set_tipinfo(PageBase.GetMessageByCache("u100002", "MessageHint")); dictionary.Add("fs_name", "loginName"); strResult = JsonHandle.ObjectToJson(result); return; } PageBase.zero_retry_times_children(str5); } else { string str12 = _users.get_retry_times().ToString(); if (!string.IsNullOrEmpty(str12) && (int.Parse(str12) > int.Parse(FileCacheHelper.get_GetLockedUserCount()))) { if (!PageBase.IsLockedTimeout(str5, "master")) { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo("您的帳號因密碼多次輸入錯誤被鎖死,請與管理員聯系!"); strResult = JsonHandle.ObjectToJson(result); return; } PageBase.zero_retry_times(str5); } str = _users.get_a_state().ToString(); string str13 = _users.get_a_state().ToString(); str4 = PageBase.upper_user_status(_users.get_u_name()); if (str13.Equals("2")) { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo(PageBase.GetMessageByCache("u100005", "MessageHint")); dictionary.Add("fs_name", "loginName"); strResult = JsonHandle.ObjectToJson(result); context.Session.Abandon(); return; } if (str4 == "2") { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo("您的上級帳號已被停用,请与管理员联系!"); strResult = JsonHandle.ObjectToJson(result); context.Session.Abandon(); return; } str = (str13 == null) ? "0" : str; string str14 = _users.get_salt().Trim(); string str15 = DESEncrypt.EncryptString(str6, str14); if (_users.get_u_psw() != str15) { context.Session["lottery_session_img_code"] = null; PageBase.inc_retry_times(str5); PageBase.login_error_ip(); result.set_success(400); result.set_tipinfo(PageBase.GetMessageByCache("u100003", "MessageHint")); strResult = JsonHandle.ObjectToJson(result); if (context.Session["lottery_session_img_code_display"].ToString() == "0") { DateTime time3; if (CallBLL.cz_user_psw_err_log_bll.IsExistUser(str5)) { CallBLL.cz_user_psw_err_log_bll.UpdateErrTimes(str5); } else { CallBLL.cz_user_psw_err_log_bll.AddUser(str5); } if (PageBase.IsErrTimesAbove(ref time3, str5)) { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo(PageBase.GetMessageByCache("u100003", "MessageHint")); dictionary.Add("isDisplayCode", 1); result.set_data(dictionary); strResult = JsonHandle.ObjectToJson(result); context.Session["lottery_session_img_code_display"] = 1; } } return; } PageBase.zero_retry_times(str5); } if (!string.IsNullOrEmpty(str2)) { context.Session["user_name"] = _users.get_u_name().Trim(); context.Session["user_type"] = _users.get_u_type().Trim(); context.Session["child_user_name"] = _child.get_u_name().Trim(); context.Session["user_state"] = str2.Trim(); if (str2.Equals("2")) { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo("您的帳號已被停用,请与管理员联系!"); strResult = JsonHandle.ObjectToJson(result); context.Session.Abandon(); return; } if (_users.get_a_state() == 2) { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo("您的主帳號已被停用,请与管理员联系!"); strResult = JsonHandle.ObjectToJson(result); context.Session.Abandon(); return; } if (str3 == "2") { context.Session["lottery_session_img_code"] = null; result.set_success(400); result.set_tipinfo("您的上級帳號已被停用,请与管理员联系!"); strResult = JsonHandle.ObjectToJson(result); context.Session.Abandon(); return; } if (str2 == "1") { result.set_success(200); result.set_tipinfo(PageBase.GetMessageByCache("u100004", "MessageHint")); strResult = JsonHandle.ObjectToJson(result); context.Session["user_state"] = str2; } else if (_users.get_a_state() == 1) { result.set_success(200); result.set_tipinfo("您的主帳號已被凍結,请与管理员联系!"); strResult = JsonHandle.ObjectToJson(result); context.Session["user_state"] = _users.get_a_state().ToString(); } else if (str3 == "1") { result.set_success(200); result.set_tipinfo(PageBase.GetMessageByCache("u100006", "MessageHint")); strResult = JsonHandle.ObjectToJson(result); context.Session["user_state"] = str3; } else { context.Session["user_state"] = "0"; result.set_success(200); strResult = JsonHandle.ObjectToJson(result); } } else { context.Session["user_name"] = _users.get_u_name().Trim(); context.Session["user_type"] = _users.get_u_type().Trim(); context.Session["user_state"] = str.Trim(); if (str.Equals("1")) { result.set_success(200); result.set_tipinfo(PageBase.GetMessageByCache("u100004", "MessageHint")); strResult = JsonHandle.ObjectToJson(result); context.Session["user_state"] = str; } else if (str4 == "1") { result.set_success(200); result.set_tipinfo(PageBase.GetMessageByCache("u100006", "MessageHint")); strResult = JsonHandle.ObjectToJson(result); context.Session["user_state"] = str4; } else { context.Session["user_state"] = "0"; result.set_success(200); strResult = JsonHandle.ObjectToJson(result); } } agent_userinfo_session _session = new agent_userinfo_session(); _session.set_u_id(_users.get_u_id()); _session.set_u_name(_users.get_u_name().Trim()); _session.set_u_psw(_users.get_u_psw().Trim()); _session.set_u_nicker(_users.get_u_nicker().Trim()); _session.set_u_skin(_users.get_u_skin().Trim()); if (_child != null) { if (string.IsNullOrEmpty(_child.get_u_skin())) { _session.set_u_skin(""); } else { _session.set_u_skin(_child.get_u_skin()); } } _session.set_sup_name(_users.get_sup_name().Trim()); _session.set_u_type(_users.get_u_type().Trim()); _session.set_su_type(_users.get_su_type().Trim()); _session.set_a_state(_users.get_a_state()); _session.set_six_kind(_users.get_six_kind()); _session.set_kc_kind(_users.get_kc_kind()); _session.set_allow_sale(_users.get_allow_sale()); _session.set_kc_allow_sale(_users.get_kc_allow_sale()); _session.set_negative_sale(_users.get_negative_sale()); if (!_users.get_allow_view_report().HasValue) { _session.set_allow_view_report(0); } else { _session.set_allow_view_report(_users.get_allow_view_report()); } DataRow item = CallBLL.cz_admin_sysconfig_bll.GetItem(); if (item == null) { _session.set_u_skin("Blue"); } else { string str16 = item["agent_skin"].ToString(); if (string.IsNullOrEmpty(_session.get_u_skin()) || (str16.IndexOf(_session.get_u_skin()) < 0)) { _session.set_u_skin(str16.Split(new char[] { '|' })[0]); } } if (_child != null) { _child.set_salt(""); } _session.set_users_child_session(_child); DataTable zJInfo = CallBLL.cz_users_bll.GetZJInfo(); if (zJInfo != null) { _session.set_zjname(zJInfo.Rows[0]["u_name"].ToString().Trim()); } if (!_session.get_u_type().ToLower().Equals("zj")) { cz_rate_kc rateKCByUserName = CallBLL.cz_rate_kc_bll.GetRateKCByUserName(_session.get_u_name()); _session.set_fgs_name(rateKCByUserName.get_fgs_name()); _session.set_gd_name(rateKCByUserName.get_gd_name()); _session.set_zd_name(rateKCByUserName.get_zd_name()); _session.set_dl_name(rateKCByUserName.get_dl_name()); DataTable userOpOdds = CallBLL.cz_rate_kc_bll.GetUserOpOdds(_session.get_u_name()); if (userOpOdds != null) { if ((userOpOdds.Rows[0]["six_op_odds"] != null) && (userOpOdds.Rows[0]["six_op_odds"].ToString() != "")) { _session.set_six_op_odds(new int?(int.Parse(userOpOdds.Rows[0]["six_op_odds"].ToString()))); } if ((userOpOdds.Rows[0]["kc_op_odds"] != null) && (userOpOdds.Rows[0]["kc_op_odds"].ToString() != "")) { _session.set_kc_op_odds(new int?(int.Parse(userOpOdds.Rows[0]["kc_op_odds"].ToString()))); } } } context.Session["child_user_name"] = null; if (_child != null) { context.Session["child_user_name"] = _child.get_u_name(); } context.Session["user_name"] = _users.get_u_name(); context.Session[_users.get_u_name() + "lottery_session_user_info"] = _session; PageBase.SetAppcationFlag(str5); if (FileCacheHelper.get_RedisStatOnline().Equals(1) || FileCacheHelper.get_RedisStatOnline().Equals(2)) { bool flag6 = false; if ((_session.get_users_child_session() != null) && _session.get_users_child_session().get_is_admin().Equals(1)) { flag6 = true; } if (!flag6) { if (FileCacheHelper.get_RedisStatOnline().Equals(1)) { new PageBase_Redis().InitUserOnlineTopToRedis(str5, _session.get_u_type()); } else if (FileCacheHelper.get_RedisStatOnline().Equals(2)) { new PageBase_Redis().InitUserOnlineTopToRedisStack(str5, _session.get_u_type()); } } } else { MemberPageBase.stat_top_online(str5); MemberPageBase.stat_online(str5, _session.get_u_type()); } if (FileCacheHelper.get_RedisStatOnline().Equals(0)) { PageBase.ZeroIsOutFlag(str5); } CallBLL.cz_user_psw_err_log_bll.ZeroErrTimes(str5); cz_login_log _log = new cz_login_log(); _log.set_ip(LSRequest.GetIP()); _log.set_login_time(new DateTime?(DateTime.Now)); _log.set_u_name(str5); new PageBase(); _log.set_browser_type(Utils.GetBrowserInfo(HttpContext.Current)); CallBLL.cz_login_log_bll.Add(_log); if (_child == null) { string str17 = _users.get_is_changed().ToString(); if (string.IsNullOrEmpty(str17) || (str17 == "0")) { result.set_success(550); result.set_tipinfo("新密碼首次登錄,需重置密碼!"); strResult = JsonHandle.ObjectToJson(result); return; } DateTime?nullable = _users.get_last_changedate(); int num2 = PageBase.PasswordExpire(); if (nullable.HasValue) { nullable12 = nullable; time4 = DateTime.Now.AddDays((double)-num2); if (!(nullable12.HasValue ? (nullable12.GetValueOrDefault() < time4) : false)) { goto Label_131D; } } result.set_success(550); result.set_tipinfo("密碼過期,需重置密碼!"); strResult = JsonHandle.ObjectToJson(result); return; } string str18 = _child.get_is_changed().ToString(); if (string.IsNullOrEmpty(str18) || (str18 == "0")) { result.set_success(550); result.set_tipinfo("新密碼首次登錄,需重置密碼!"); strResult = JsonHandle.ObjectToJson(result); return; } DateTime?nullable2 = _child.get_last_changedate(); int num3 = PageBase.PasswordExpire(); if (nullable2.HasValue) { nullable12 = nullable2; time4 = DateTime.Now.AddDays((double)-num3); if (!(nullable12.HasValue ? (nullable12.GetValueOrDefault() < time4) : false)) { goto Label_131D; } } result.set_success(550); result.set_tipinfo("密碼過期,需重置密碼!"); strResult = JsonHandle.ObjectToJson(result); return; Label_131D: dictionary.Add("uid", _session.get_u_id()); DataTable lotteryList = base.GetLotteryList(); string[] source = base.GetLotteryMasterID(lotteryList).Split(new char[] { ',' }); int num4 = 1; if (source.Contains <string>(num4.ToString())) { dictionary.Add("hasSix", 1); } else { dictionary.Add("hasSix", 0); } num4 = 2; if (source.Contains <string>(num4.ToString())) { dictionary.Add("hasKc", 1); } else { dictionary.Add("hasKc", 0); } dictionary.Add("utype", _session.get_u_type().ToLower()); List <object> list = new List <object>(); foreach (DataRow row2 in lotteryList.Rows) { string str20 = row2["lottery_name"].ToString(); string s = row2["id"].ToString(); Dictionary <string, object> dictionary2 = new Dictionary <string, object>(); dictionary2.Add("name", str20); dictionary2.Add("id", int.Parse(s)); list.Add(dictionary2); } dictionary.Add("lotteryCfg", list); dictionary.Add("PasswordLU", ConfigurationManager.AppSettings["PasswordLU"]); dictionary.Add("roleCfg", MemberPageBase_Mobile.roleCfg); result.set_data(dictionary); strResult = JsonHandle.ObjectToJson(result); }
private void getMemberDetail(ref string strResult) { base.checkLoginByHandler(0); this.u_id = LSRequest.qq("uid"); string str = LSRequest.qq("memberId"); string str2 = LSRequest.qq("submitType"); if (str != "clone") { base.Response.End(); } ReturnResult result = new ReturnResult(); Dictionary <string, object> dictionary = new Dictionary <string, object>(); List <object> list = new List <object>(); List <object> list2 = new List <object>(); string str3 = this.Session["user_name"].ToString(); agent_userinfo_session _session = this.Session[str3 + "lottery_session_user_info"] as agent_userinfo_session; if (((!_session.get_u_type().Trim().Equals("zj") && !_session.get_u_type().Trim().Equals("fgs")) && (!_session.get_u_type().Trim().Equals("gd") && !_session.get_u_type().Trim().Equals("zd"))) && !_session.get_u_type().Trim().Equals("dl")) { base.Response.End(); } if (this.Session["child_user_name"] != null) { base.Response.End(); } this.userChildModel = CallBLL.cz_users_child_bll.GetUserByUID(this.u_id); if (this.userChildModel == null) { base.Response.End(); } if (!this.userChildModel.get_is_admin().Equals(0)) { base.Response.End(); } if (!this.userChildModel.get_parent_u_name().Equals(str3)) { base.Response.End(); } bool flag = base.is_locked_user(this.userChildModel.get_retry_times().ToString()); DataTable table = CallBLL.cz_permissions_bll.GetListByUType((_session.get_u_type().Equals("zj") != null) ? "zj" : "dl").Tables[0]; if (_session.get_u_type().Equals("zj")) { this.zjDataRow1 = table.Select(string.Format(" group_id={0} ", 1)); this.zjDataRow2 = table.Select(string.Format(" group_id={0} ", 2)); this.zjDataRow3 = table.Select(string.Format(" group_id={0} ", 3)); this.zjDataRow4 = table.Select(string.Format(" group_id={0} ", 4)); } else { if (_session.get_u_type().Equals("fgs")) { if (_session.get_six_op_odds().Equals(1) || _session.get_kc_op_odds().Equals(1)) { this.dlDataRow1 = table.Select(string.Format(" group_id={0} ", 5)); } else { this.dlDataRow1 = table.Select(string.Format(" group_id={0} and name<>'{1}' ", 5, "po_5_3")); } } else { this.dlDataRow1 = table.Select(string.Format(" group_id={0} and name<>'{1}' ", 5, "po_5_3")); } this.dlDataRow2 = table.Select(string.Format(" group_id={0} ", 6)); this.dlDataRow3 = table.Select(string.Format(" group_id={0} ", 7)); } switch (str2) { case "view": { if (_session.get_u_type().Equals("zj")) { foreach (DataRow row in this.zjDataRow1) { string str4 = row["name"].ToString(); int num = (this.userChildModel.get_permissions_name().IndexOf(str4) > -1) ? 1 : 0; if (num == 1) { list2.Add(str4); } string str5 = row["name_remark"].ToString(); Dictionary <string, object> item = new Dictionary <string, object>(); item.Add("value", str4); item.Add("label", str5); list.Add(item); } foreach (DataRow row2 in this.zjDataRow2) { string str6 = row2["name"].ToString(); int num2 = (this.userChildModel.get_permissions_name().IndexOf(str6) > -1) ? 1 : 0; if (num2 == 1) { list2.Add(str6); } string str7 = row2["name_remark"].ToString(); Dictionary <string, object> dictionary3 = new Dictionary <string, object>(); dictionary3.Add("value", str6); dictionary3.Add("label", str7); list.Add(dictionary3); } foreach (DataRow row3 in this.zjDataRow3) { string str8 = row3["name"].ToString(); int num3 = (this.userChildModel.get_permissions_name().IndexOf(str8) > -1) ? 1 : 0; if (num3 == 1) { list2.Add(str8); } string str9 = row3["name_remark"].ToString(); Dictionary <string, object> dictionary4 = new Dictionary <string, object>(); dictionary4.Add("value", str8.ToString()); dictionary4.Add("label", str9); list.Add(dictionary4); } foreach (DataRow row4 in this.zjDataRow4) { string str10 = row4["name"].ToString(); int num4 = (this.userChildModel.get_permissions_name().IndexOf(str10) > -1) ? 1 : 0; if (num4 == 1) { list2.Add(str10); } string str11 = row4["name_remark"].ToString(); Dictionary <string, object> dictionary5 = new Dictionary <string, object>(); dictionary5.Add("value", str10); dictionary5.Add("label", str11); list.Add(dictionary5); } } else { foreach (DataRow row5 in this.dlDataRow1) { string str12 = row5["name"].ToString(); int num5 = (this.userChildModel.get_permissions_name().IndexOf(str12) > -1) ? 1 : 0; if (num5 == 1) { list2.Add(str12); } string str13 = row5["name_remark"].ToString(); Dictionary <string, object> dictionary6 = new Dictionary <string, object>(); dictionary6.Add("value", str12); dictionary6.Add("label", str13); list.Add(dictionary6); } foreach (DataRow row6 in this.dlDataRow2) { string str14 = row6["name"].ToString(); int num6 = (this.userChildModel.get_permissions_name().IndexOf(str14) > -1) ? 1 : 0; if (num6 == 1) { list2.Add(str14); } string str15 = row6["name_remark"].ToString(); Dictionary <string, object> dictionary7 = new Dictionary <string, object>(); dictionary7.Add("value", str14); dictionary7.Add("label", str15); list.Add(dictionary7); } foreach (DataRow row7 in this.dlDataRow3) { string str16 = row7["name"].ToString(); int num7 = (this.userChildModel.get_permissions_name().IndexOf(str16) > -1) ? 1 : 0; if (num7 == 1) { list2.Add(str16); } string str17 = row7["name_remark"].ToString(); Dictionary <string, object> dictionary8 = new Dictionary <string, object>(); dictionary8.Add("value", str16); dictionary8.Add("label", str17); list.Add(dictionary8); } } Dictionary <string, object> dictionary9 = new Dictionary <string, object>(); dictionary9.Add("cloneName", this.userChildModel.get_u_name()); dictionary9.Add("isLocked", flag ? "1" : "0"); dictionary9.Add("userState", this.userChildModel.get_status().ToString()); dictionary9.Add("nicker", this.userChildModel.get_u_nicker()); dictionary9.Add("qx", list2); dictionary9.Add("qxOptions", list); dictionary9.Add("date", this.userChildModel.get_add_date()); dictionary = dictionary9; result.set_success(200); result.set_data(dictionary); strResult = base.ObjectToJson(result); return; } case "edit": this.UpdateStatusChild(); this.AddUser(); break; } }
protected void Page_Load(object sender, EventArgs e) { string str = this.Session["user_name"].ToString(); this.login_name = str; this.master_name = str; agent_userinfo_session model = this.Session[str + "lottery_session_user_info"] as agent_userinfo_session; base.Permission_Aspx_ZJ(model, "po_2_1"); base.Permission_Aspx_DL(model, "po_6_1"); this.u_type = model.get_u_type().Trim(); this.zj_name = model.get_zjname().Trim(); if (this.Session["child_user_name"] != null) { this.isCloneUser = true; this.cloneName = this.Session["child_user_name"].ToString(); this.login_name = this.cloneName; } if (!this.u_type.Equals("zj")) { this.levelList.Add(model.get_fgs_name()); this.levelList.Add(model.get_zd_name()); this.levelList.Add(model.get_gd_name()); this.levelList.Add(model.get_dl_name()); } this.u_id = LSRequest.qq("uid"); if (string.IsNullOrEmpty(this.u_id)) { base.Response.End(); } this.u_name = CallBLL.cz_users_bll.GetUserNameByUid(this.u_id, ref this.isChild); if (string.IsNullOrEmpty(this.u_name)) { base.Response.Redirect("/MessagePage.aspx?code=u100014&url=&issuccess=1&isback=0"); base.Response.End(); } if (CallBLL.cz_users_bll.GetUserInfoByUID(this.u_id) == null) { cz_users_child userByUID = CallBLL.cz_users_child_bll.GetUserByUID(this.u_id); if ((userByUID != null) && userByUID.get_parent_u_name().Equals(model.get_u_name())) { if (!base.IsUpperLowerLevels(userByUID.get_parent_u_name(), model.get_u_type(), model.get_u_name())) { base.Response.Redirect("/MessagePage.aspx?code=u100014&url=&issuccess=1&isback=0"); base.Response.End(); } } else { base.Response.Redirect("/MessagePage.aspx?code=u100014&url=&issuccess=1&isback=0"); base.Response.End(); } } else if (!base.IsUpperLowerLevels(this.u_name, model.get_u_type(), model.get_u_name())) { base.Response.Redirect("/MessagePage.aspx?code=u100014&url=&issuccess=1&isback=0"); base.Response.End(); } this.lotteryDT = base.GetLotteryList(); DataRow[] source = this.lotteryDT.Select(string.Format(" id=100 ", new object[0])); string str2 = ""; if (source.Count <DataRow>() <= 0) { str2 = "200,300"; } else if (this.lotteryDT.Rows.Count > 1) { str2 = "100,200,300"; } else { str2 = "100,300"; } this.page = LSRequest.qq("page"); if (string.IsNullOrEmpty(this.page)) { this.page = "1"; } if (int.Parse(this.page) < 1) { this.page = "1"; } this.dataTable = CallBLL.cz_user_change_log_bll.get_log_table(Convert.ToInt32(this.page) - 1, this.pageSize, ref this.pageCount, ref this.dataCount, this.u_name.Trim(), str2, ref this.isAll); this.FiledValue = new string[] { this.u_id }; }