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._CardPasswordAgentUser.Password) { JavaScript.Alert(this.Page, "密码有误,请重新输入。"); } else if (this.tbRePassWord.Text.Trim() != this.tbNewPassWord.Text.Trim()) { JavaScript.Alert(this.Page, "两次输入的密码不相同。"); } else { CardPasswordAgentUsers cardPasswordUsers = new CardPasswordAgentUsers(); base._CardPasswordAgentUser.Clone(cardPasswordUsers); base._CardPasswordAgentUser.Password = PF.EncryptPassword(this.tbNewPassWord.Text.Trim()); string returnDescription = ""; if (base._CardPasswordAgentUser.EditByID(ref returnDescription) < 0) { cardPasswordUsers.Clone(base._CardPasswordAgentUser); JavaScript.Alert(this.Page, returnDescription); } else { JavaScript.Alert(this.Page, "用户密码已经保存成功。"); } } }
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 获取用户 _CardPasswordAgentUser = CardPasswordAgentUsers.GetCurrentUser(); if (isRequestLogin && (_CardPasswordAgentUser == null)) { Response.Redirect("Login.aspx"); return; } #endregion HtmlMeta hm = new HtmlMeta(); hm.HttpEquiv = "X-UA-Compatible"; hm.Content = "IE=EmulateIE7"; base.OnLoad(e); }
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); CardPasswordAgentUsers cardPasswordUsers = new CardPasswordAgentUsers(); cardPasswordUsers.ID = Shove._Convert.StrToInt(ID, 0); cardPasswordUsers.Password = Password; return(cardPasswordUsers.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); CardPasswordAgentUsers cardPasswordUsers = new CardPasswordAgentUsers(); cardPasswordUsers.ID = Shove._Convert.StrToInt(ID, 0); cardPasswordUsers.Password = Password; return cardPasswordUsers.Login(ref ReturnDescription); }
public void Clone(CardPasswordAgentUsers cardPasswordUsers) { cardPasswordUsers.ID = this.ID; cardPasswordUsers.Company = this.Company; cardPasswordUsers.Password = this.Password; cardPasswordUsers.Name = this.Name; cardPasswordUsers.State = this.State; cardPasswordUsers.Url = this.Url; }
public static CardPasswordAgentUsers GetCurrentUser() { string Key = (System.Web.HttpContext.Current.Session.SessionID + "").ToLower() + "_CardPasswordAgentUsers"; // 从 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); } CardPasswordAgentUsers cardPasswordUsers = new CardPasswordAgentUsers(); cardPasswordUsers.ID = UserID; string ReturnDescription = ""; int Result = cardPasswordUsers.GetInformationByID(ref ReturnDescription); if (Result < 0) { return(null); } return(cardPasswordUsers); }
public static CardPasswordAgentUsers 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() + "_CardPasswordAgentUsers"; 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); } CardPasswordAgentUsers users = new CardPasswordAgentUsers { ID = num }; string returnDescription = ""; if (users.GetInformationByID(ref returnDescription) < 0) { return(null); } return(users); }
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()) != _CardPasswordAgentUser.Password) { Shove._Web.JavaScript.Alert(this.Page, "密码有误,请重新输入。"); return; } if (tbRePassWord.Text.Trim() != tbNewPassWord.Text.Trim()) { Shove._Web.JavaScript.Alert(this.Page, "两次输入的密码不相同。"); return; } CardPasswordAgentUsers t_User = new CardPasswordAgentUsers(); _CardPasswordAgentUser.Clone(t_User); _CardPasswordAgentUser.Password = PF.EncryptPassword(tbNewPassWord.Text.Trim()); string ReturnDescription = ""; if (_CardPasswordAgentUser.EditByID(ref ReturnDescription) < 0) { t_User.Clone(_CardPasswordAgentUser); Shove._Web.JavaScript.Alert(this.Page, ReturnDescription); return; } Shove._Web.JavaScript.Alert(this.Page, "用户密码已经保存成功。"); }
public static CardPasswordAgentUsers 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() + "_CardPasswordAgentUsers"; 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; } CardPasswordAgentUsers users = new CardPasswordAgentUsers { ID = num }; string returnDescription = ""; if (users.GetInformationByID(ref returnDescription) < 0) { return null; } return users; }
protected override void OnLoad(EventArgs e) { this._Site = new Sites()[1L]; if (this._Site == null) { PF.GoError(1, "域名无效,限制访问", base.GetType().FullName); } else { this._CardPasswordAgentUser = CardPasswordAgentUsers.GetCurrentUser(); if (this.isRequestLogin && (this._CardPasswordAgentUser == null)) { base.Response.Redirect("Login.aspx"); } else { base.OnLoad(e); } } }
public static CardPasswordAgentUsers GetCurrentUser() { string Key = (System.Web.HttpContext.Current.Session.SessionID + "").ToLower() + "_CardPasswordAgentUsers"; // 从 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; } CardPasswordAgentUsers cardPasswordUsers = new CardPasswordAgentUsers(); cardPasswordUsers.ID = UserID; string ReturnDescription = ""; int Result = cardPasswordUsers.GetInformationByID(ref ReturnDescription); if (Result < 0) { return null; } return cardPasswordUsers; }