protected override void OnLoad(EventArgs e) { #region 获取站点 //_Site = new Sites()[Shove._Web.Utility.GetUrlWithoutHttp()]; _Site = new Sites()[1]; if (_Site == null) { PF.GoError(ErrorNumber.Unknow, "域名无效,限制访问", this.GetType().FullName); return; } #endregion #region 获取用户 _ElectronTicketAgents = ElectronTicketAgents.GetCurrentUser(); if (isRequestLogin && (_ElectronTicketAgents == null)) { Response.Redirect("Login.aspx"); return; } #endregion HtmlMeta hm = new HtmlMeta(); hm.HttpEquiv = "X-UA-Compatible"; hm.Content = "IE=EmulateIE7"; base.OnLoad(e); }
protected void btnOK_Click(object sender, EventArgs e) { if (this.tbOldPassWord.Text.Trim() == "") { JavaScript.Alert(this.Page, "请输入密码。"); } else if (this.tbNewPassWord.Text.Trim() == "") { JavaScript.Alert(this.Page, "请输入新密码。"); } else if (PF.EncryptPassword(this.tbOldPassWord.Text.Trim()) != base._ElectronTicketAgents.Password) { JavaScript.Alert(this.Page, "密码有误,请重新输入。"); } else if (this.tbRePassWord.Text.Trim() != this.tbNewPassWord.Text.Trim()) { JavaScript.Alert(this.Page, "两次输入的密码不相同。"); } else { ElectronTicketAgents electronTicketAgents = new ElectronTicketAgents(); base._ElectronTicketAgents.Clone(electronTicketAgents); base._ElectronTicketAgents.Password = PF.EncryptPassword(this.tbNewPassWord.Text.Trim()); string returnDescription = ""; if (base._ElectronTicketAgents.EditByID(ref returnDescription) < 0) { electronTicketAgents.Clone(base._ElectronTicketAgents); JavaScript.Alert(this.Page, returnDescription); } else { JavaScript.Alert(this.Page, "用户密码已经保存成功。"); } } }
public int LoginSubmit(Page page, Sites site, string ID, string Password, string InputCheckCode, Shove.Web.UI.ShoveCheckCode sccCheckCode, ref string ReturnDescription) { ReturnDescription = ""; bool Opt_isUseCheckCode = site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true); ID = ID.Trim(); Password = Password.Trim(); if ((ID == "") || (Password == "")) { ReturnDescription = "用户名和密码都不能为空"; return -1; } if ((Opt_isUseCheckCode) && (!sccCheckCode.Valid(InputCheckCode))) { ReturnDescription = "验证码输入错误"; return -2; } System.Threading.Thread.Sleep(500); ElectronTicketAgents electronTicketAgents = new ElectronTicketAgents(); electronTicketAgents.ID = Shove._Convert.StrToInt(ID, 0); electronTicketAgents.Password = Password; return electronTicketAgents.Login(ref ReturnDescription); }
public int LoginSubmit(Page page, Sites site, string ID, string Password, string InputCheckCode, Shove.Web.UI.ShoveCheckCode sccCheckCode, ref string ReturnDescription) { ReturnDescription = ""; bool Opt_isUseCheckCode = site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true); ID = ID.Trim(); Password = Password.Trim(); if ((ID == "") || (Password == "")) { ReturnDescription = "用户名和密码都不能为空"; return(-1); } if ((Opt_isUseCheckCode) && (!sccCheckCode.Valid(InputCheckCode))) { ReturnDescription = "验证码输入错误"; return(-2); } System.Threading.Thread.Sleep(500); ElectronTicketAgents electronTicketAgents = new ElectronTicketAgents(); electronTicketAgents.ID = Shove._Convert.StrToInt(ID, 0); electronTicketAgents.Password = Password; return(electronTicketAgents.Login(ref ReturnDescription)); }
public void Clone(ElectronTicketAgents electronTicketAgents) { electronTicketAgents.ID = ID; electronTicketAgents.Name = Name; electronTicketAgents.Key = Key; electronTicketAgents.Password = Password; electronTicketAgents.Company = Company; electronTicketAgents.Balance = Balance; electronTicketAgents.Url = Url; electronTicketAgents.State = State; electronTicketAgents.UseLotteryList = UseLotteryList; electronTicketAgents.IPAddressLimit = IPAddressLimit; }
public void Clone(ElectronTicketAgents electronTicketAgents) { electronTicketAgents.ID = this.ID; electronTicketAgents.Name = this.Name; electronTicketAgents.Key = this.Key; electronTicketAgents.Password = this.Password; electronTicketAgents.Company = this.Company; electronTicketAgents.Balance = this.Balance; electronTicketAgents.Url = this.Url; electronTicketAgents.State = this.State; electronTicketAgents.UseLotteryList = this.UseLotteryList; electronTicketAgents.IPAddressLimit = this.IPAddressLimit; }
public static ElectronTicketAgents GetCurrentUser() { string Key = (System.Web.HttpContext.Current.Session.SessionID + "").ToLower() + "_ElectronTicketAgents"; // 从 Cookie 中取出 UserID HttpCookie cookieUser = HttpContext.Current.Request.Cookies[Key]; if ((cookieUser == null) || (String.IsNullOrEmpty(cookieUser.Value))) { return(null); } string CookieUserID = cookieUser.Value; try { CookieUserID = Shove._Security.Encrypt.UnEncryptString(PF.GetCallCert(), Shove._Security.Encrypt.Decrypt3DES(PF.GetCallCert(), CookieUserID, PF.DesKey)); } catch { CookieUserID = ""; } if (String.IsNullOrEmpty(CookieUserID)) { return(null); } int UserID = Shove._Convert.StrToInt(CookieUserID, -1); if (UserID < 1) { return(null); } ElectronTicketAgents electronTicketAgents = new ElectronTicketAgents(); electronTicketAgents.ID = UserID; string ReturnDescription = ""; int Result = electronTicketAgents.GetInformationByID(ref ReturnDescription); if (Result < 0) { return(null); } return(electronTicketAgents); }
public static ElectronTicketAgents GetCurrentUser() { // This item is obfuscated and can not be translated. if (HttpContext.Current.Session.SessionID == null) { return(null); } string str = HttpContext.Current.Session.SessionID.ToLower() + "_ElectronTicketAgents"; HttpCookie cookie = HttpContext.Current.Request.Cookies[str]; if ((cookie == null) || string.IsNullOrEmpty(cookie.Value)) { return(null); } string input = cookie.Value; try { input = Encrypt.UnEncryptString(PF.GetCallCert(), Encrypt.Decrypt3DES(PF.GetCallCert(), input, PF.DesKey)); } catch { input = ""; } if (string.IsNullOrEmpty(input)) { return(null); } int num = _Convert.StrToInt(input, -1); if (num < 1) { return(null); } ElectronTicketAgents agents = new ElectronTicketAgents { ID = num }; string returnDescription = ""; if (agents.GetInformationByID(ref returnDescription) < 0) { return(null); } return(agents); }
protected void btnOK_Click(object sender, EventArgs e) { if (tbOldPassWord.Text.Trim() == "") { Shove._Web.JavaScript.Alert(this.Page, "请输入密码。"); return; } if (tbNewPassWord.Text.Trim() == "") { Shove._Web.JavaScript.Alert(this.Page, "请输入新密码。"); return; } if (PF.EncryptPassword(tbOldPassWord.Text.Trim()) != _ElectronTicketAgents.Password) { Shove._Web.JavaScript.Alert(this.Page, "密码有误,请重新输入。"); return; } if (tbRePassWord.Text.Trim() != tbNewPassWord.Text.Trim()) { Shove._Web.JavaScript.Alert(this.Page, "两次输入的密码不相同。"); return; } ElectronTicketAgents t_User = new ElectronTicketAgents(); _ElectronTicketAgents.Clone(t_User); _ElectronTicketAgents.Password = PF.EncryptPassword(tbNewPassWord.Text.Trim()); string ReturnDescription = ""; if (_ElectronTicketAgents.EditByID(ref ReturnDescription) < 0) { t_User.Clone(_ElectronTicketAgents); Shove._Web.JavaScript.Alert(this.Page, ReturnDescription); return; } Shove._Web.JavaScript.Alert(this.Page, "用户密码已经保存成功。"); }
public static ElectronTicketAgents GetCurrentUser() { // This item is obfuscated and can not be translated. if (HttpContext.Current.Session.SessionID == null) { return null; } string str = HttpContext.Current.Session.SessionID.ToLower() + "_ElectronTicketAgents"; HttpCookie cookie = HttpContext.Current.Request.Cookies[str]; if ((cookie == null) || string.IsNullOrEmpty(cookie.Value)) { return null; } string input = cookie.Value; try { input = Encrypt.UnEncryptString(PF.GetCallCert(), Encrypt.Decrypt3DES(PF.GetCallCert(), input, PF.DesKey)); } catch { input = ""; } if (string.IsNullOrEmpty(input)) { return null; } int num = _Convert.StrToInt(input, -1); if (num < 1) { return null; } ElectronTicketAgents agents = new ElectronTicketAgents { ID = num }; string returnDescription = ""; if (agents.GetInformationByID(ref returnDescription) < 0) { return null; } return agents; }
protected override void OnLoad(EventArgs e) { this._Site = new Sites()[1L]; if (this._Site == null) { PF.GoError(1, "域名无效,限制访问", base.GetType().FullName); } else { this._ElectronTicketAgents = ElectronTicketAgents.GetCurrentUser(); if (this.isRequestLogin && (this._ElectronTicketAgents == null)) { base.Response.Redirect("Login.aspx"); } else { base.OnLoad(e); } } }