// // GET: /Manage/Index public async Task <ActionResult> Index(ManageMessageId?message) { ViewBag.StatusMessage = message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." : message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set." : message == ManageMessageId.Error ? "An error has occurred." : message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added." : message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed." : ""; var userId = User.Identity.GetUserId(); UpdateProfielViewModel profielModel = new UpdateProfielViewModel(); Gebruiker g = GebruikerMng.GetGebruiker(int.Parse(User.Identity.GetUserId())); profielModel.Achternaam = g.Achternaam; profielModel.Adres = g.Adres; profielModel.Email = g.Email; profielModel.Geboortedatum = g.Geboortedatum; profielModel.Postcode = g.Postcode; profielModel.Voornaam = g.Voornaam; var model = new IndexViewModel { HasPassword = HasPassword(), PhoneNumber = await UserManager.GetPhoneNumberAsync(int.Parse(userId)), TwoFactor = await UserManager.GetTwoFactorEnabledAsync(int.Parse(userId)), Logins = await UserManager.GetLoginsAsync(int.Parse(userId)), BrowserRemembered = await AuthenticationManager.TwoFactorBrowserRememberedAsync(userId), Gebruiker = profielModel }; return(View(model)); }
public IHttpActionResult GetAdmin() { Admin a = admgr.GetAdmin(); var g = userManager.GetGebruiker(a.Email); return(Ok(g)); }
// // GET: /Manage/Index public virtual async Task <ActionResult> Index(ManageMessageId?message) { ViewBag.StatusMessage = message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." : message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set." : message == ManageMessageId.Error ? "An error has occurred." : message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added." : message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed." : ""; var userId = User.Identity.GetUserId(); var model = new IndexViewModel { HasPassword = HasPassword(), PhoneNumber = await UserManager.GetPhoneNumberAsync(int.Parse(userId)), TwoFactor = await UserManager.GetTwoFactorEnabledAsync(int.Parse(userId)), Logins = await UserManager.GetLoginsAsync(int.Parse(userId)), BrowserRemembered = await AuthenticationManager.TwoFactorBrowserRememberedAsync(userId), Gebruiker = Gebruikermngr.GetGebruiker(int.Parse(userId)) }; return(View(model)); }
public IHttpActionResult GetGebruiker() { Gebruiker gebruiker = _userManager.GetGebruiker(User.Identity.Name); return(Ok(gebruiker)); }