Esempio n. 1
0
        public ActionResult doLogin(string email, string password)
        {
            password = Crypto.SHA256(password);
            //System.Diagnostics.Debug.Write(email + password);
            List <string> flagLogin = auh.login(email, password);
            Dictionary <string, string> userData = new Dictionary <string, string>();

            if (flagLogin.Count > 0)
            {
                userData.Add("email", email);
                userData.Add("idaccount", flagLogin[0]);
                userData.Add("roleaccount", flagLogin[1]);
                Session["uu"]          = userData;
                Session["idprofile"]   = ph.GetProfileFromAccount(flagLogin[0]);
                Session["namaprofile"] = ph.GetNamaProfileFromProfile(Session["idprofile"].ToString());

                System.Diagnostics.Debug.WriteLine("Login Session IDProfile = " + Session["idprofile"]);
                System.Diagnostics.Debug.WriteLine("Login Session NamaProfile = " + Session["namaprofile"]);

                return(Redirect(url + "searchProfile/index"));
            }
            else
            {
                Session["mess"] = "Sukses Register";
                return(Redirect(url + "searchProfile/index"));
            }

            //return View("register");
        }