diff --git a/Project-Unite/Controllers/ManageController.cs b/Project-Unite/Controllers/ManageController.cs index 99f41c9..731c37f 100644 --- a/Project-Unite/Controllers/ManageController.cs +++ b/Project-Unite/Controllers/ManageController.cs @@ -141,6 +141,33 @@ public async Task Index(ManageMessageId? message) return View(usr); } + [HttpPost] + [ValidateAntiForgeryToken] + public ActionResult Index(ApplicationUser model) + { + if (!ModelState.IsValid) + return View(model); + var db = new ApplicationDbContext(); + var usr = db.Users.FirstOrDefault(x => x.UserName == User.Identity.Name); + usr.DisplayName = model.DisplayName; + usr.FullName = model.FullName; + usr.Hobbies = model.Hobbies; + usr.Bio = model.Bio; + usr.Interests = model.Interests; + usr.ShowFollowers = model.ShowFollowers; + usr.ShowFollowed = model.ShowFollowed; + usr.ShowEmail = model.ShowEmail; + usr.ShowPostAndTopicCounts = model.ShowPostAndTopicCounts; + usr.ShowJoinDate = model.ShowJoinDate; + if (usr.Email != model.Email) + usr.EmailConfirmed = false; + usr.Email = model.Email; + usr.Website = model.Website; + usr.YoutubeUrl = model.YoutubeUrl; + db.SaveChanges(); + return View(model); + } + // // POST: /Manage/RemoveLogin [HttpPost] diff --git a/Project-Unite/Models/IdentityModels.cs b/Project-Unite/Models/IdentityModels.cs index a16dfe7..9e3898b 100644 --- a/Project-Unite/Models/IdentityModels.cs +++ b/Project-Unite/Models/IdentityModels.cs @@ -45,6 +45,18 @@ public async Task GenerateUserIdentityAsync(UserManager +
+ @Html.Raw(val) +
+ + } +

@ViewBag.StatusMessage

@@ -28,19 +42,86 @@

Edit your public profile here.

- @using(Html.BeginForm("ProfilePostback", "Manage")) - {

Display Name

Your Display Name is what everyone sees you as on the website. This field is required.

- @Html.TextBoxFor(Model=>Model.DisplayName, new { @class="form-control"}) + @Html.TextBoxFor(Model => Model.DisplayName, new { @class = "form-control" })

Full name

On your profile page, you can optionally set a full name to display along with the above display name.

@Html.TextBoxFor(Model => Model.FullName, new { @class = "form-control" }) - - } +

YouTube channel URL

+

Have a YouTube channel and want to show it off on your profile? Paste it here!

+ @Html.TextBoxFor(Model => Model.YoutubeUrl, new { @class = "form-control" }) + +

Website

+

Feel free to post a link to your website, if you want to.

+ @Html.TextBoxFor(Model => Model.Website, new { @class = "form-control" }) + +
+
+ Info about URLs: +

We reserve the right to remove the links to your YouTube channel or website if they do not follow the community guidelines or they point to malicious sites.

+
+
+ + + + + + +

Bio

+

Tell us about yourself!

+ @Html.TextAreaFor(Model=>Model.Bio) + + +

Interests

+

What are you interested in?

+ @Html.TextAreaFor(Model => Model.Interests) + + + +

Hobbies

+

What do you like to do?

+ @Html.TextAreaFor(Model => Model.Hobbies) + +
+
+

Privacy & Security

+ +

At ShiftOS, we take privacy seriously. If you want to hide certain things from your public profile, this is the place to do so.

+ +

NOTE: Moderators may still have access to this information for the purpose of community moderation. They will not leak your information.

+ +

Show my followers on my public profile?

+

Should we show your followers on your profile?

@Html.CheckBoxFor(Model => Model.ShowFollowers) + +

Show the people I follow on my public profile?

+

Should we show the people you follow on your profile?

@Html.CheckBoxFor(Model => Model.ShowFollowed) + +

Show my registration date?

+

Check this to show your registration date on your profile.

@Html.CheckBoxFor(Model => Model.ShowJoinDate) + +

Show my forum activity?

+

Shall we tell readers how many posts and topics you have made on the forum?

@Html.CheckBoxFor(Model => Model.ShowPostAndTopicCounts) + +

Allow users to email me?

+

Should we allow users to email you by showing your email address on your profile?

@Html.CheckBoxFor(Model => Model.ShowEmail) + +

Security

+ +

Change email address

+

Use this field to enter a new email address. Doing so will cause your account to require reactivation.

+ @Html.TextBoxFor(Model=>Model.Email, new { @class = "form-control" }) + +

Change your password

+

Use this option to change your account's password.

+ Change password + +
+ - \ No newline at end of file + +} \ No newline at end of file