Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file not shown.
1,038 changes: 1,038 additions & 0 deletions Greeting Web Application/ce117GreetingCard/.vs/config/applicationhost.config

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions Greeting Web Application/ce117GreetingCard/ce117GreetingCard.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ce117GreetingCard", "ce117GreetingCard\ce117GreetingCard.csproj", "{0621C57B-C22C-4885-83ED-3F5A43D50180}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0621C57B-C22C-4885-83ED-3F5A43D50180}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0621C57B-C22C-4885-83ED-3F5A43D50180}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0621C57B-C22C-4885-83ED-3F5A43D50180}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0621C57B-C22C-4885-83ED-3F5A43D50180}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<%@ Page Title="About" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="About.aspx.cs" Inherits="ce117GreetingCard.About" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<h2><%: Title %>.</h2>
<h3>Your application description page.</h3>
<p>Use this area to provide additional information.</p>
</asp:Content>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ce117GreetingCard
{
public partial class About : Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<%@ Page Title="Phone Number" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AddPhoneNumber.aspx.cs" Inherits="ce117GreetingCard.Account.AddPhoneNumber" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<h2><%: Title %>.</h2>

<div class="form-horizontal">
<h4>Add a phone number</h4>
<hr />
<asp:ValidationSummary runat="server" CssClass="text-danger" />
<p class="text-danger">
<asp:Literal runat="server" ID="ErrorMessage" />
</p>
<div class="form-group">
<asp:Label runat="server" AssociatedControlID="PhoneNumber" CssClass="col-md-2 control-label">Phone Number</asp:Label>
<div class="col-md-10">
<asp:TextBox runat="server" ID="PhoneNumber" CssClass="form-control" TextMode="Phone" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="PhoneNumber"
CssClass="text-danger" ErrorMessage="The PhoneNumber field is required." />
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<asp:Button runat="server" OnClick="PhoneNumber_Click"
Text="Submit" CssClass="btn btn-default" />
</div>
</div>
</div>
</asp:Content>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using System.Threading.Tasks;
using ce117GreetingCard.Models;

namespace ce117GreetingCard.Account
{
public partial class AddPhoneNumber : System.Web.UI.Page
{
protected void PhoneNumber_Click(object sender, EventArgs e)
{
var manager = Context.GetOwinContext().GetUserManager<ApplicationUserManager>();
var code = manager.GenerateChangePhoneNumberToken(User.Identity.GetUserId(), PhoneNumber.Text);
if (manager.SmsService != null)
{
var message = new IdentityMessage
{
Destination = PhoneNumber.Text,
Body = "Your security code is " + code
};

manager.SmsService.Send(message);
}

Response.Redirect("/Account/VerifyPhoneNumber?PhoneNumber=" + HttpUtility.UrlEncode(PhoneNumber.Text));
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<%@ Page Title="Account Confirmation" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Confirm.aspx.cs" Inherits="ce117GreetingCard.Account.Confirm" Async="true" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
<h2><%: Title %>.</h2>

<div>
<asp:PlaceHolder runat="server" ID="successPanel" ViewStateMode="Disabled" Visible="true">
<p>
Thank you for confirming your account. Click <asp:HyperLink ID="login" runat="server" NavigateUrl="~/Account/Login">here</asp:HyperLink> to login
</p>
</asp:PlaceHolder>
<asp:PlaceHolder runat="server" ID="errorPanel" ViewStateMode="Disabled" Visible="false">
<p class="text-danger">
An error has occurred.
</p>
</asp:PlaceHolder>
</div>
</asp:Content>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Web;
using System.Web.UI;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Owin;
using ce117GreetingCard.Models;

namespace ce117GreetingCard.Account
{
public partial class Confirm : Page
{
protected string StatusMessage
{
get;
private set;
}

protected void Page_Load(object sender, EventArgs e)
{
string code = IdentityHelper.GetCodeFromRequest(Request);
string userId = IdentityHelper.GetUserIdFromRequest(Request);
if (code != null && userId != null)
{
var manager = Context.GetOwinContext().GetUserManager<ApplicationUserManager>();
var result = manager.ConfirmEmail(userId, code);
if (result.Succeeded)
{
successPanel.Visible = true;
return;
}
}
successPanel.Visible = false;
errorPanel.Visible = true;
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<%@ Page Title="Forgot password" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Forgot.aspx.cs" Inherits="ce117GreetingCard.Account.ForgotPassword" Async="true" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
<h2><%: Title %>.</h2>

<div class="row">
<div class="col-md-8">
<asp:PlaceHolder id="loginForm" runat="server">
<div class="form-horizontal">
<h4>Forgot your password?</h4>
<hr />
<asp:PlaceHolder runat="server" ID="ErrorMessage" Visible="false">
<p class="text-danger">
<asp:Literal runat="server" ID="FailureText" />
</p>
</asp:PlaceHolder>
<div class="form-group">
<asp:Label runat="server" AssociatedControlID="Email" CssClass="col-md-2 control-label">Email</asp:Label>
<div class="col-md-10">
<asp:TextBox runat="server" ID="Email" CssClass="form-control" TextMode="Email" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="Email"
CssClass="text-danger" ErrorMessage="The email field is required." />
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<asp:Button runat="server" OnClick="Forgot" Text="Email Link" CssClass="btn btn-default" />
</div>
</div>
</div>
</asp:PlaceHolder>
<asp:PlaceHolder runat="server" ID="DisplayEmail" Visible="false">
<p class="text-info">
Please check your email to reset your password.
</p>
</asp:PlaceHolder>
</div>
</div>
</asp:Content>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using System.Web;
using System.Web.UI;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Owin;
using ce117GreetingCard.Models;

namespace ce117GreetingCard.Account
{
public partial class ForgotPassword : Page
{
protected void Page_Load(object sender, EventArgs e)
{
}

protected void Forgot(object sender, EventArgs e)
{
if (IsValid)
{
// Validate the user's email address
var manager = Context.GetOwinContext().GetUserManager<ApplicationUserManager>();
ApplicationUser user = manager.FindByName(Email.Text);
if (user == null || !manager.IsEmailConfirmed(user.Id))
{
FailureText.Text = "The user either does not exist or is not confirmed.";
ErrorMessage.Visible = true;
return;
}
// For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771
// Send email with the code and the redirect to reset password page
//string code = manager.GeneratePasswordResetToken(user.Id);
//string callbackUrl = IdentityHelper.GetResetPasswordRedirectUrl(code, Request);
//manager.SendEmail(user.Id, "Reset Password", "Please reset your password by clicking <a href=\"" + callbackUrl + "\">here</a>.");
loginForm.Visible = false;
DisplayEmail.Visible = true;
}
}
}
}
Loading