예제 #1
0
 public ActionResult AjaxLogin(string UserName, string UserPwd)
 {
     if (Maticsoft.BLL.SysManage.ConfigSystem.GetBoolValueByCache("System_Close_Login"))
     {
         return base.Content("-1");
     }
     if (!base.ModelState.IsValid)
     {
         return base.Content("0");
     }
     AccountsPrincipal existingPrincipal = AccountsPrincipal.ValidateLogin(UserName, UserPwd);
     if (existingPrincipal == null)
     {
         return base.Content("0");
     }
     User user = new User(existingPrincipal);
     if (!user.Activity)
     {
         base.ModelState.AddModelError("Message", "对不起,该帐号已被冻结,请联系管理员!");
     }
     base.HttpContext.User = existingPrincipal;
     FormsAuthentication.SetAuthCookie(UserName, true);
     base.Session[Globals.SESSIONKEY_USER] = user;
     int num = new Maticsoft.BLL.Members.PointsDetail().AddPoints("Login", user.UserID, "登录操作", "");
     return base.Content("1|" + num.ToString());
 }
예제 #2
0
 public void BindData()
 {
     if (((base.Request.Params["userid"] != null) && (base.Request.Params["userid"].ToString() != "")) && PageValidate.IsNumber(base.Request.Params["userid"]))
     {
         int num = int.Parse(base.Request.Params["userid"]);
         int num2 = Convert.ToInt32(this.DropPointsType.SelectedValue);
         DataSet list = new DataSet();
         Maticsoft.BLL.Members.PointsDetail detail = new Maticsoft.BLL.Members.PointsDetail();
         if (num2 != -1)
         {
             list = detail.GetList(string.Concat(new object[] { " UserId=", num, " and type=", num2 }));
         }
         else
         {
             list = detail.GetList(" UserId=" + num);
         }
         if (list != null)
         {
             this.gridView.DataSetSource = list;
         }
     }
 }
예제 #3
0
 public ActionResult Login(LogOnModel model, string returnUrl)
 {
     ((dynamic) base.ViewBag).Title = "登录";
     if (Maticsoft.BLL.SysManage.ConfigSystem.GetBoolValueByCache("System_Close_Login"))
     {
         return base.RedirectToAction("TurnOff", "Error");
     }
     if (!base.ModelState.IsValid)
     {
         return base.View(model);
     }
     AccountsPrincipal existingPrincipal = AccountsPrincipal.ValidateLogin(model.Email, model.Password);
     if (existingPrincipal == null)
     {
         base.ModelState.AddModelError("Message", "用户名或密码不正确, 请重新输入!");
         return base.View(model);
     }
     User user = new User(existingPrincipal);
     if (!user.Activity)
     {
         base.ModelState.AddModelError("Message", "对不起,该帐号已被冻结,请联系管理员!");
         return base.View(model);
     }
     base.HttpContext.User = existingPrincipal;
     FormsAuthentication.SetAuthCookie(model.Email, model.RememberMe);
     base.Session[Globals.SESSIONKEY_USER] = user;
     int num = new Maticsoft.BLL.Members.PointsDetail().AddPoints("Login", user.UserID, "登录操作", "");
     if (base.CurrentThemeName == "TaoLe")
     {
         ShoppingCartHelper.LoadShoppingCart(user.UserID);
     }
     if ((base.Session["ReturnUrl"] != null) && !string.IsNullOrWhiteSpace(base.Session["ReturnUrl"].ToString()))
     {
         returnUrl = base.Session["ReturnUrl"].ToString();
         base.Session.Remove("ReturnUrl");
         return this.Redirect(returnUrl);
     }
     if (((base.Url.IsLocalUrl(returnUrl) && (returnUrl.Length > 1)) && (returnUrl.StartsWith("/") && !returnUrl.StartsWith("//"))) && !returnUrl.StartsWith(@"/\"))
     {
         return this.Redirect(returnUrl);
     }
     base.TempData["pointer"] = num;
     return base.RedirectToAction("Posts", "Profile");
 }