Exemplo n.º 1
0
        public ActionResult Login(string q)
        {
            if (Session["CFSess"] == null)
            {
                if (q != null && q != "")
                {
                    var Url = FCommon.Decrypt(HttpUtility.UrlDecode(q));

                    string[] sUrl = Url.Split('~');
                    BALUser.FirstName = sUrl[2].Split(':')[1];
                    BALUser.LastName  = sUrl[3].Split(':')[1];
                    BALUser.Email     = sUrl[1].Split(':')[1];
                    return(View(BALUser));
                }
                else
                {
                    return(View());
                }
            }
            else
            {
                Response.Redirect("/Home/Index");
            }
            return(null);
        }
Exemplo n.º 2
0
        public ActionResult Register(string q)
        {
            var Url = FCommon.Decrypt(HttpUtility.UrlDecode(q));

            string[] sUrl = Url.Split('~');


            BALUser.FirstName = sUrl[2].Split(':')[1];
            BALUser.LastName  = sUrl[3].Split(':')[1];
            BALUser.Email     = sUrl[1].Split(':')[1];

            return(View(BALUser));
        }
Exemplo n.º 3
0
        public ActionResult DLogin(string id)
        {
            if (id != "")
            {
                string   dQuery    = HttpUtility.UrlDecode(FCommon.Decrypt(id));
                string[] dQueryArr = dQuery.Split('~');

                DataRow dr = BALUser.LoginAuthentication(dQueryArr[0].ToString(), dQueryArr[1].ToString());
                if (dr["ID"].ToString().Equals("0"))
                {
                }
                else
                {
                    if (dr["IsActive"].ToString().Equals("True"))
                    {
                        CFSession Sess = new CFSession();
                        Sess.ID            = dr["ID"].ToString();
                        Sess.FirstName     = dr["FirstName"].ToString();
                        Sess.LastName      = dr["LastName"].ToString();
                        Sess.ImageUrl      = dr["ImageUrl"].ToString();
                        Sess.fk_UserTypeID = Convert.ToInt32(dr["fk_UserTypeID"]);
                        Sess.IsFirstLogin  = Convert.ToBoolean(dr["IsFirstLogin"]);
                        Session["CFSess"]  = Sess;

                        //Response.Redirect("/Home/Index");
                        return(RedirectToAction("Index", "Home"));
                    }
                    else
                    {
                    }
                }

                return(View());
            }
            return(View());
        }
Exemplo n.º 4
0
        public string SetNewPassword(string Pass, string Link)
        {
            var Url = FCommon.Decrypt(HttpUtility.UrlDecode(Link));

            return(JsonConvert.SerializeObject(BALUser.ChangePassword(Url.Split(':')[1], Pass)));
        }