├── .gitattributes ├── .gitignore └── src ├── RC1toRC2.sln ├── RC1toRC2 ├── .bowerrc ├── Controllers │ ├── AccountController.cs │ ├── HomeController.cs │ └── ManageController.cs ├── Migrations │ ├── 20160515152410_InitialDatabase.Designer.cs │ ├── 20160515152410_InitialDatabase.cs │ └── ApplicationDbContextModelSnapshot.cs ├── Models │ ├── ApplicationDbContext.cs │ └── ApplicationUser.cs ├── Project_Readme.html ├── Properties │ └── launchSettings.json ├── RC1toRC2.xproj ├── Services │ ├── IEmailSender.cs │ ├── ISmsSender.cs │ └── MessageServices.cs ├── Startup.cs ├── ViewModels │ ├── Account │ │ ├── ExternalLoginConfirmationViewModel.cs │ │ ├── ForgotPasswordViewModel.cs │ │ ├── LoginViewModel.cs │ │ ├── RegisterViewModel.cs │ │ ├── ResetPasswordViewModel.cs │ │ ├── SendCodeViewModel.cs │ │ └── VerifyCodeViewModel.cs │ └── Manage │ │ ├── AddPhoneNumberViewModel.cs │ │ ├── ChangePasswordViewModel.cs │ │ ├── ConfigureTwoFactorViewModel.cs │ │ ├── FactorViewModel.cs │ │ ├── IndexViewModel.cs │ │ ├── ManageLoginsViewModel.cs │ │ ├── RemoveLoginViewModel.cs │ │ ├── SetPasswordViewModel.cs │ │ └── VerifyPhoneNumberViewModel.cs ├── Views │ ├── Account │ │ ├── ConfirmEmail.cshtml │ │ ├── ExternalLoginConfirmation.cshtml │ │ ├── ExternalLoginFailure.cshtml │ │ ├── ForgotPassword.cshtml │ │ ├── ForgotPasswordConfirmation.cshtml │ │ ├── Lockout.cshtml │ │ ├── Login.cshtml │ │ ├── Register.cshtml │ │ ├── ResetPassword.cshtml │ │ ├── ResetPasswordConfirmation.cshtml │ │ ├── SendCode.cshtml │ │ └── VerifyCode.cshtml │ ├── Home │ │ ├── About.cshtml │ │ ├── Contact.cshtml │ │ └── Index.cshtml │ ├── Manage │ │ ├── AddPhoneNumber.cshtml │ │ ├── ChangePassword.cshtml │ │ ├── Index.cshtml │ │ ├── ManageLogins.cshtml │ │ ├── SetPassword.cshtml │ │ └── VerifyPhoneNumber.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _Layout.cshtml │ │ ├── _LoginPartial.cshtml │ │ └── _ValidationScriptsPartial.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml ├── appsettings.json ├── bower.json ├── gulpfile.js ├── package.json ├── project.json ├── web.config └── wwwroot │ ├── _references.js │ ├── css │ └── site.css │ ├── favicon.ico │ ├── images │ ├── ASP-NET-Banners-01.png │ ├── ASP-NET-Banners-02.png │ ├── Banner-01-Azure.png │ └── Banner-02-VS.png │ ├── js │ └── site.js │ ├── lib │ ├── bootstrap │ │ ├── .bower.json │ │ ├── LICENSE │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-theme.css │ │ │ ├── bootstrap-theme.css.map │ │ │ ├── bootstrap-theme.min.css │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ └── bootstrap.min.css │ │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.js │ │ │ └── npm.js │ ├── jquery-validation-unobtrusive │ │ ├── .bower.json │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ │ ├── .bower.json │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.js │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ └── jquery │ │ ├── .bower.json │ │ ├── MIT-LICENSE.txt │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map │ └── web.config └── nuget.config /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | *.VC.VC.opendb 85 | 86 | # Visual Studio profiler 87 | *.psess 88 | *.vsp 89 | *.vspx 90 | *.sap 91 | 92 | # TFS 2012 Local Workspace 93 | $tf/ 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | *.DotSettings.user 102 | 103 | # JustCode is a .NET coding add-in 104 | .JustCode 105 | 106 | # TeamCity is a build add-in 107 | _TeamCity* 108 | 109 | # DotCover is a Code Coverage Tool 110 | *.dotCover 111 | 112 | # NCrunch 113 | _NCrunch_* 114 | .*crunch*.local.xml 115 | nCrunchTemp_* 116 | 117 | # MightyMoose 118 | *.mm.* 119 | AutoTest.Net/ 120 | 121 | # Web workbench (sass) 122 | .sass-cache/ 123 | 124 | # Installshield output folder 125 | [Ee]xpress/ 126 | 127 | # DocProject is a documentation generator add-in 128 | DocProject/buildhelp/ 129 | DocProject/Help/*.HxT 130 | DocProject/Help/*.HxC 131 | DocProject/Help/*.hhc 132 | DocProject/Help/*.hhk 133 | DocProject/Help/*.hhp 134 | DocProject/Help/Html2 135 | DocProject/Help/html 136 | 137 | # Click-Once directory 138 | publish/ 139 | 140 | # Publish Web Output 141 | *.[Pp]ublish.xml 142 | *.azurePubxml 143 | # TODO: Comment the next line if you want to checkin your web deploy settings 144 | # but database connection strings (with potential passwords) will be unencrypted 145 | *.pubxml 146 | *.publishproj 147 | 148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 149 | # checkin your Azure Web App publish settings, but sensitive information contained 150 | # in these scripts will be unencrypted 151 | PublishScripts/ 152 | 153 | # NuGet Packages 154 | *.nupkg 155 | # The packages folder can be ignored because of Package Restore 156 | **/packages/* 157 | # except build/, which is used as an MSBuild target. 158 | !**/packages/build/ 159 | # Uncomment if necessary however generally it will be regenerated when needed 160 | #!**/packages/repositories.config 161 | # NuGet v3's project.json files produces more ignoreable files 162 | *.nuget.props 163 | *.nuget.targets 164 | 165 | # Microsoft Azure Build Output 166 | csx/ 167 | *.build.csdef 168 | 169 | # Microsoft Azure Emulator 170 | ecf/ 171 | rcf/ 172 | 173 | # Windows Store app package directories and files 174 | AppPackages/ 175 | BundleArtifacts/ 176 | Package.StoreAssociation.xml 177 | _pkginfo.txt 178 | 179 | # Visual Studio cache files 180 | # files ending in .cache can be ignored 181 | *.[Cc]ache 182 | # but keep track of directories ending in .cache 183 | !*.[Cc]ache/ 184 | 185 | # Others 186 | ClientBin/ 187 | ~$* 188 | *~ 189 | *.dbmdl 190 | *.dbproj.schemaview 191 | *.pfx 192 | *.publishsettings 193 | node_modules/ 194 | orleans.codegen.cs 195 | 196 | # Since there are multiple workflows, uncomment next line to ignore bower_components 197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 198 | #bower_components/ 199 | 200 | # RIA/Silverlight projects 201 | Generated_Code/ 202 | 203 | # Backup & report files from converting an old project file 204 | # to a newer Visual Studio version. Backup files are not needed, 205 | # because we have git ;-) 206 | _UpgradeReport_Files/ 207 | Backup*/ 208 | UpgradeLog*.XML 209 | UpgradeLog*.htm 210 | 211 | # SQL Server files 212 | *.mdf 213 | *.ldf 214 | 215 | # Business Intelligence projects 216 | *.rdl.data 217 | *.bim.layout 218 | *.bim_*.settings 219 | 220 | # Microsoft Fakes 221 | FakesAssemblies/ 222 | 223 | # GhostDoc plugin setting file 224 | *.GhostDoc.xml 225 | 226 | # Node.js Tools for Visual Studio 227 | .ntvs_analysis.dat 228 | 229 | # Visual Studio 6 build log 230 | *.plg 231 | 232 | # Visual Studio 6 workspace options file 233 | *.opt 234 | 235 | # Visual Studio LightSwitch build output 236 | **/*.HTMLClient/GeneratedArtifacts 237 | **/*.DesktopClient/GeneratedArtifacts 238 | **/*.DesktopClient/ModelManifest.xml 239 | **/*.Server/GeneratedArtifacts 240 | **/*.Server/ModelManifest.xml 241 | _Pvt_Extensions 242 | 243 | # Paket dependency manager 244 | .paket/paket.exe 245 | paket-files/ 246 | 247 | # FAKE - F# Make 248 | .fake/ 249 | 250 | # JetBrains Rider 251 | .idea/ 252 | *.sln.iml 253 | 254 | # ========================= 255 | # Operating System Files 256 | # ========================= 257 | 258 | # OSX 259 | # ========================= 260 | 261 | .DS_Store 262 | .AppleDouble 263 | .LSOverride 264 | 265 | # Thumbnails 266 | ._* 267 | 268 | # Files that might appear in the root of a volume 269 | .DocumentRevisions-V100 270 | .fseventsd 271 | .Spotlight-V100 272 | .TemporaryItems 273 | .Trashes 274 | .VolumeIcon.icns 275 | 276 | # Directories potentially created on remote AFP share 277 | .AppleDB 278 | .AppleDesktop 279 | Network Trash Folder 280 | Temporary Items 281 | .apdisk 282 | 283 | # Windows 284 | # ========================= 285 | 286 | # Windows image file caches 287 | Thumbs.db 288 | ehthumbs.db 289 | 290 | # Folder config file 291 | Desktop.ini 292 | 293 | # Recycle Bin used on file shares 294 | $RECYCLE.BIN/ 295 | 296 | # Windows Installer files 297 | *.cab 298 | *.msi 299 | *.msm 300 | *.msp 301 | 302 | # Windows shortcuts 303 | *.lnk 304 | -------------------------------------------------------------------------------- /src/RC1toRC2.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25123.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "RC1toRC2", "RC1toRC2\RC1toRC2.xproj", "{7B0D8E85-F5D0-48E6-B39A-F9207C03C0C0}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {7B0D8E85-F5D0-48E6-B39A-F9207C03C0C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {7B0D8E85-F5D0-48E6-B39A-F9207C03C0C0}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {7B0D8E85-F5D0-48E6-B39A-F9207C03C0C0}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {7B0D8E85-F5D0-48E6-B39A-F9207C03C0C0}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /src/RC1toRC2/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "wwwroot/lib" 3 | } 4 | -------------------------------------------------------------------------------- /src/RC1toRC2/Controllers/AccountController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Security.Claims; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Authorization; 7 | using Microsoft.AspNetCore.Identity; 8 | using Microsoft.AspNetCore.Mvc; 9 | using Microsoft.AspNetCore.Mvc.Rendering; 10 | using Microsoft.EntityFrameworkCore; 11 | using Microsoft.Extensions.Logging; 12 | using RC1toRC2.Models; 13 | using RC1toRC2.Services; 14 | using RC1toRC2.ViewModels.Account; 15 | 16 | namespace RC1toRC2.Controllers 17 | { 18 | [Authorize] 19 | public class AccountController : Controller 20 | { 21 | private readonly UserManager _userManager; 22 | private readonly SignInManager _signInManager; 23 | private readonly IEmailSender _emailSender; 24 | private readonly ISmsSender _smsSender; 25 | private readonly ILogger _logger; 26 | 27 | public AccountController( 28 | UserManager userManager, 29 | SignInManager signInManager, 30 | IEmailSender emailSender, 31 | ISmsSender smsSender, 32 | ILoggerFactory loggerFactory) 33 | { 34 | _userManager = userManager; 35 | _signInManager = signInManager; 36 | _emailSender = emailSender; 37 | _smsSender = smsSender; 38 | _logger = loggerFactory.CreateLogger(); 39 | } 40 | 41 | // 42 | // GET: /Account/Login 43 | [HttpGet] 44 | [AllowAnonymous] 45 | public IActionResult Login(string returnUrl = null) 46 | { 47 | ViewData["ReturnUrl"] = returnUrl; 48 | return View(); 49 | } 50 | 51 | // 52 | // POST: /Account/Login 53 | [HttpPost] 54 | [AllowAnonymous] 55 | [ValidateAntiForgeryToken] 56 | public async Task Login(LoginViewModel model, string returnUrl = null) 57 | { 58 | ViewData["ReturnUrl"] = returnUrl; 59 | if (ModelState.IsValid) 60 | { 61 | // This doesn't count login failures towards account lockout 62 | // To enable password failures to trigger account lockout, set lockoutOnFailure: true 63 | var result = await _signInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, lockoutOnFailure: false); 64 | if (result.Succeeded) 65 | { 66 | _logger.LogInformation(1, "User logged in."); 67 | return RedirectToLocal(returnUrl); 68 | } 69 | if (result.RequiresTwoFactor) 70 | { 71 | return RedirectToAction(nameof(SendCode), new { ReturnUrl = returnUrl, RememberMe = model.RememberMe }); 72 | } 73 | if (result.IsLockedOut) 74 | { 75 | _logger.LogWarning(2, "User account locked out."); 76 | return View("Lockout"); 77 | } 78 | else 79 | { 80 | ModelState.AddModelError(string.Empty, "Invalid login attempt."); 81 | return View(model); 82 | } 83 | } 84 | 85 | // If we got this far, something failed, redisplay form 86 | return View(model); 87 | } 88 | 89 | // 90 | // GET: /Account/Register 91 | [HttpGet] 92 | [AllowAnonymous] 93 | public IActionResult Register() 94 | { 95 | return View(); 96 | } 97 | 98 | // 99 | // POST: /Account/Register 100 | [HttpPost] 101 | [AllowAnonymous] 102 | [ValidateAntiForgeryToken] 103 | public async Task Register(RegisterViewModel model) 104 | { 105 | if (ModelState.IsValid) 106 | { 107 | var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; 108 | var result = await _userManager.CreateAsync(user, model.Password); 109 | if (result.Succeeded) 110 | { 111 | // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=532713 112 | // Send an email with this link 113 | //var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); 114 | //var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme); 115 | //await _emailSender.SendEmailAsync(model.Email, "Confirm your account", 116 | // "Please confirm your account by clicking this link: link"); 117 | await _signInManager.SignInAsync(user, isPersistent: false); 118 | _logger.LogInformation(3, "User created a new account with password."); 119 | return RedirectToAction(nameof(HomeController.Index), "Home"); 120 | } 121 | AddErrors(result); 122 | } 123 | 124 | // If we got this far, something failed, redisplay form 125 | return View(model); 126 | } 127 | 128 | // 129 | // POST: /Account/LogOff 130 | [HttpPost] 131 | [ValidateAntiForgeryToken] 132 | public async Task LogOff() 133 | { 134 | await _signInManager.SignOutAsync(); 135 | _logger.LogInformation(4, "User logged out."); 136 | return RedirectToAction(nameof(HomeController.Index), "Home"); 137 | } 138 | 139 | // 140 | // POST: /Account/ExternalLogin 141 | [HttpPost] 142 | [AllowAnonymous] 143 | [ValidateAntiForgeryToken] 144 | public IActionResult ExternalLogin(string provider, string returnUrl = null) 145 | { 146 | // Request a redirect to the external login provider. 147 | var redirectUrl = Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = returnUrl }); 148 | var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl); 149 | return new ChallengeResult(provider, properties); 150 | } 151 | 152 | // 153 | // GET: /Account/ExternalLoginCallback 154 | [HttpGet] 155 | [AllowAnonymous] 156 | public async Task ExternalLoginCallback(string returnUrl = null) 157 | { 158 | var info = await _signInManager.GetExternalLoginInfoAsync(); 159 | if (info == null) 160 | { 161 | return RedirectToAction(nameof(Login)); 162 | } 163 | 164 | // Sign in the user with this external login provider if the user already has a login. 165 | var result = await _signInManager.ExternalLoginSignInAsync(info.LoginProvider, info.ProviderKey, isPersistent: false); 166 | if (result.Succeeded) 167 | { 168 | _logger.LogInformation(5, "User logged in with {Name} provider.", info.LoginProvider); 169 | return RedirectToLocal(returnUrl); 170 | } 171 | if (result.RequiresTwoFactor) 172 | { 173 | return RedirectToAction(nameof(SendCode), new { ReturnUrl = returnUrl }); 174 | } 175 | if (result.IsLockedOut) 176 | { 177 | return View("Lockout"); 178 | } 179 | else 180 | { 181 | // If the user does not have an account, then ask the user to create an account. 182 | ViewData["ReturnUrl"] = returnUrl; 183 | ViewData["LoginProvider"] = info.LoginProvider; 184 | var email = info.Principal.FindFirstValue(ClaimTypes.Email); 185 | return View("ExternalLoginConfirmation", new ExternalLoginConfirmationViewModel { Email = email }); 186 | } 187 | } 188 | 189 | // 190 | // POST: /Account/ExternalLoginConfirmation 191 | [HttpPost] 192 | [AllowAnonymous] 193 | [ValidateAntiForgeryToken] 194 | public async Task ExternalLoginConfirmation(ExternalLoginConfirmationViewModel model, string returnUrl = null) 195 | { 196 | if (ModelState.IsValid) 197 | { 198 | // Get the information about the user from the external login provider 199 | var info = await _signInManager.GetExternalLoginInfoAsync(); 200 | if (info == null) 201 | { 202 | return View("ExternalLoginFailure"); 203 | } 204 | var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; 205 | var result = await _userManager.CreateAsync(user); 206 | if (result.Succeeded) 207 | { 208 | result = await _userManager.AddLoginAsync(user, info); 209 | if (result.Succeeded) 210 | { 211 | await _signInManager.SignInAsync(user, isPersistent: false); 212 | _logger.LogInformation(6, "User created an account using {Name} provider.", info.LoginProvider); 213 | return RedirectToLocal(returnUrl); 214 | } 215 | } 216 | AddErrors(result); 217 | } 218 | 219 | ViewData["ReturnUrl"] = returnUrl; 220 | return View(model); 221 | } 222 | 223 | // GET: /Account/ConfirmEmail 224 | [HttpGet] 225 | [AllowAnonymous] 226 | public async Task ConfirmEmail(string userId, string code) 227 | { 228 | if (userId == null || code == null) 229 | { 230 | return View("Error"); 231 | } 232 | var user = await _userManager.FindByIdAsync(userId); 233 | if (user == null) 234 | { 235 | return View("Error"); 236 | } 237 | var result = await _userManager.ConfirmEmailAsync(user, code); 238 | return View(result.Succeeded ? "ConfirmEmail" : "Error"); 239 | } 240 | 241 | // 242 | // GET: /Account/ForgotPassword 243 | [HttpGet] 244 | [AllowAnonymous] 245 | public IActionResult ForgotPassword() 246 | { 247 | return View(); 248 | } 249 | 250 | // 251 | // POST: /Account/ForgotPassword 252 | [HttpPost] 253 | [AllowAnonymous] 254 | [ValidateAntiForgeryToken] 255 | public async Task ForgotPassword(ForgotPasswordViewModel model) 256 | { 257 | if (ModelState.IsValid) 258 | { 259 | var user = await _userManager.FindByNameAsync(model.Email); 260 | if (user == null || !(await _userManager.IsEmailConfirmedAsync(user))) 261 | { 262 | // Don't reveal that the user does not exist or is not confirmed 263 | return View("ForgotPasswordConfirmation"); 264 | } 265 | 266 | // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=532713 267 | // Send an email with this link 268 | //var code = await _userManager.GeneratePasswordResetTokenAsync(user); 269 | //var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme); 270 | //await _emailSender.SendEmailAsync(model.Email, "Reset Password", 271 | // "Please reset your password by clicking here: link"); 272 | //return View("ForgotPasswordConfirmation"); 273 | } 274 | 275 | // If we got this far, something failed, redisplay form 276 | return View(model); 277 | } 278 | 279 | // 280 | // GET: /Account/ForgotPasswordConfirmation 281 | [HttpGet] 282 | [AllowAnonymous] 283 | public IActionResult ForgotPasswordConfirmation() 284 | { 285 | return View(); 286 | } 287 | 288 | // 289 | // GET: /Account/ResetPassword 290 | [HttpGet] 291 | [AllowAnonymous] 292 | public IActionResult ResetPassword(string code = null) 293 | { 294 | return code == null ? View("Error") : View(); 295 | } 296 | 297 | // 298 | // POST: /Account/ResetPassword 299 | [HttpPost] 300 | [AllowAnonymous] 301 | [ValidateAntiForgeryToken] 302 | public async Task ResetPassword(ResetPasswordViewModel model) 303 | { 304 | if (!ModelState.IsValid) 305 | { 306 | return View(model); 307 | } 308 | var user = await _userManager.FindByNameAsync(model.Email); 309 | if (user == null) 310 | { 311 | // Don't reveal that the user does not exist 312 | return RedirectToAction(nameof(AccountController.ResetPasswordConfirmation), "Account"); 313 | } 314 | var result = await _userManager.ResetPasswordAsync(user, model.Code, model.Password); 315 | if (result.Succeeded) 316 | { 317 | return RedirectToAction(nameof(AccountController.ResetPasswordConfirmation), "Account"); 318 | } 319 | AddErrors(result); 320 | return View(); 321 | } 322 | 323 | // 324 | // GET: /Account/ResetPasswordConfirmation 325 | [HttpGet] 326 | [AllowAnonymous] 327 | public IActionResult ResetPasswordConfirmation() 328 | { 329 | return View(); 330 | } 331 | 332 | // 333 | // GET: /Account/SendCode 334 | [HttpGet] 335 | [AllowAnonymous] 336 | public async Task SendCode(string returnUrl = null, bool rememberMe = false) 337 | { 338 | var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); 339 | if (user == null) 340 | { 341 | return View("Error"); 342 | } 343 | var userFactors = await _userManager.GetValidTwoFactorProvidersAsync(user); 344 | var factorOptions = userFactors.Select(purpose => new SelectListItem { Text = purpose, Value = purpose }).ToList(); 345 | return View(new SendCodeViewModel { Providers = factorOptions, ReturnUrl = returnUrl, RememberMe = rememberMe }); 346 | } 347 | 348 | // 349 | // POST: /Account/SendCode 350 | [HttpPost] 351 | [AllowAnonymous] 352 | [ValidateAntiForgeryToken] 353 | public async Task SendCode(SendCodeViewModel model) 354 | { 355 | if (!ModelState.IsValid) 356 | { 357 | return View(); 358 | } 359 | 360 | var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); 361 | if (user == null) 362 | { 363 | return View("Error"); 364 | } 365 | 366 | // Generate the token and send it 367 | var code = await _userManager.GenerateTwoFactorTokenAsync(user, model.SelectedProvider); 368 | if (string.IsNullOrWhiteSpace(code)) 369 | { 370 | return View("Error"); 371 | } 372 | 373 | var message = "Your security code is: " + code; 374 | if (model.SelectedProvider == "Email") 375 | { 376 | await _emailSender.SendEmailAsync(await _userManager.GetEmailAsync(user), "Security Code", message); 377 | } 378 | else if (model.SelectedProvider == "Phone") 379 | { 380 | await _smsSender.SendSmsAsync(await _userManager.GetPhoneNumberAsync(user), message); 381 | } 382 | 383 | return RedirectToAction(nameof(VerifyCode), new { Provider = model.SelectedProvider, ReturnUrl = model.ReturnUrl, RememberMe = model.RememberMe }); 384 | } 385 | 386 | // 387 | // GET: /Account/VerifyCode 388 | [HttpGet] 389 | [AllowAnonymous] 390 | public async Task VerifyCode(string provider, bool rememberMe, string returnUrl = null) 391 | { 392 | // Require that the user has already logged in via username/password or external login 393 | var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); 394 | if (user == null) 395 | { 396 | return View("Error"); 397 | } 398 | return View(new VerifyCodeViewModel { Provider = provider, ReturnUrl = returnUrl, RememberMe = rememberMe }); 399 | } 400 | 401 | // 402 | // POST: /Account/VerifyCode 403 | [HttpPost] 404 | [AllowAnonymous] 405 | [ValidateAntiForgeryToken] 406 | public async Task VerifyCode(VerifyCodeViewModel model) 407 | { 408 | if (!ModelState.IsValid) 409 | { 410 | return View(model); 411 | } 412 | 413 | // The following code protects for brute force attacks against the two factor codes. 414 | // If a user enters incorrect codes for a specified amount of time then the user account 415 | // will be locked out for a specified amount of time. 416 | var result = await _signInManager.TwoFactorSignInAsync(model.Provider, model.Code, model.RememberMe, model.RememberBrowser); 417 | if (result.Succeeded) 418 | { 419 | return RedirectToLocal(model.ReturnUrl); 420 | } 421 | if (result.IsLockedOut) 422 | { 423 | _logger.LogWarning(7, "User account locked out."); 424 | return View("Lockout"); 425 | } 426 | else 427 | { 428 | ModelState.AddModelError("", "Invalid code."); 429 | return View(model); 430 | } 431 | } 432 | 433 | #region Helpers 434 | 435 | private void AddErrors(IdentityResult result) 436 | { 437 | foreach (var error in result.Errors) 438 | { 439 | ModelState.AddModelError(string.Empty, error.Description); 440 | } 441 | } 442 | 443 | private async Task GetCurrentUserAsync() 444 | { 445 | return await _userManager.GetUserAsync(HttpContext.User); 446 | } 447 | 448 | private IActionResult RedirectToLocal(string returnUrl) 449 | { 450 | if (Url.IsLocalUrl(returnUrl)) 451 | { 452 | return Redirect(returnUrl); 453 | } 454 | else 455 | { 456 | return RedirectToAction(nameof(HomeController.Index), "Home"); 457 | } 458 | } 459 | 460 | #endregion 461 | } 462 | } 463 | -------------------------------------------------------------------------------- /src/RC1toRC2/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | 7 | namespace RC1toRC2.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | public IActionResult Index() 12 | { 13 | return View(); 14 | } 15 | 16 | public IActionResult About() 17 | { 18 | ViewData["Message"] = "Your application description page."; 19 | 20 | return View(); 21 | } 22 | 23 | public IActionResult Contact() 24 | { 25 | ViewData["Message"] = "Your contact page."; 26 | 27 | return View(); 28 | } 29 | 30 | public IActionResult Error() 31 | { 32 | return View(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/RC1toRC2/Controllers/ManageController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Security.Claims; 6 | using Microsoft.AspNetCore.Authorization; 7 | using Microsoft.AspNetCore.Identity; 8 | using Microsoft.AspNetCore.Mvc; 9 | using Microsoft.Extensions.Logging; 10 | using RC1toRC2.Models; 11 | using RC1toRC2.Services; 12 | using RC1toRC2.ViewModels.Manage; 13 | 14 | namespace RC1toRC2.Controllers 15 | { 16 | [Authorize] 17 | public class ManageController : Controller 18 | { 19 | private readonly UserManager _userManager; 20 | private readonly SignInManager _signInManager; 21 | private readonly IEmailSender _emailSender; 22 | private readonly ISmsSender _smsSender; 23 | private readonly ILogger _logger; 24 | 25 | public ManageController( 26 | UserManager userManager, 27 | SignInManager signInManager, 28 | IEmailSender emailSender, 29 | ISmsSender smsSender, 30 | ILoggerFactory loggerFactory) 31 | { 32 | _userManager = userManager; 33 | _signInManager = signInManager; 34 | _emailSender = emailSender; 35 | _smsSender = smsSender; 36 | _logger = loggerFactory.CreateLogger(); 37 | } 38 | 39 | // 40 | // GET: /Manage/Index 41 | [HttpGet] 42 | public async Task Index(ManageMessageId? message = null) 43 | { 44 | ViewData["StatusMessage"] = 45 | message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." 46 | : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." 47 | : message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set." 48 | : message == ManageMessageId.Error ? "An error has occurred." 49 | : message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added." 50 | : message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed." 51 | : ""; 52 | 53 | var user = await GetCurrentUserAsync(); 54 | var model = new IndexViewModel 55 | { 56 | HasPassword = await _userManager.HasPasswordAsync(user), 57 | PhoneNumber = await _userManager.GetPhoneNumberAsync(user), 58 | TwoFactor = await _userManager.GetTwoFactorEnabledAsync(user), 59 | Logins = await _userManager.GetLoginsAsync(user), 60 | BrowserRemembered = await _signInManager.IsTwoFactorClientRememberedAsync(user) 61 | }; 62 | return View(model); 63 | } 64 | 65 | // 66 | // POST: /Manage/RemoveLogin 67 | [HttpPost] 68 | [ValidateAntiForgeryToken] 69 | public async Task RemoveLogin(RemoveLoginViewModel account) 70 | { 71 | ManageMessageId? message = ManageMessageId.Error; 72 | var user = await GetCurrentUserAsync(); 73 | if (user != null) 74 | { 75 | var result = await _userManager.RemoveLoginAsync(user, account.LoginProvider, account.ProviderKey); 76 | if (result.Succeeded) 77 | { 78 | await _signInManager.SignInAsync(user, isPersistent: false); 79 | message = ManageMessageId.RemoveLoginSuccess; 80 | } 81 | } 82 | return RedirectToAction(nameof(ManageLogins), new { Message = message }); 83 | } 84 | 85 | // 86 | // GET: /Manage/AddPhoneNumber 87 | public IActionResult AddPhoneNumber() 88 | { 89 | return View(); 90 | } 91 | 92 | // 93 | // POST: /Manage/AddPhoneNumber 94 | [HttpPost] 95 | [ValidateAntiForgeryToken] 96 | public async Task AddPhoneNumber(AddPhoneNumberViewModel model) 97 | { 98 | if (!ModelState.IsValid) 99 | { 100 | return View(model); 101 | } 102 | // Generate the token and send it 103 | var user = await GetCurrentUserAsync(); 104 | var code = await _userManager.GenerateChangePhoneNumberTokenAsync(user, model.PhoneNumber); 105 | await _smsSender.SendSmsAsync(model.PhoneNumber, "Your security code is: " + code); 106 | return RedirectToAction(nameof(VerifyPhoneNumber), new { PhoneNumber = model.PhoneNumber }); 107 | } 108 | 109 | // 110 | // POST: /Manage/EnableTwoFactorAuthentication 111 | [HttpPost] 112 | [ValidateAntiForgeryToken] 113 | public async Task EnableTwoFactorAuthentication() 114 | { 115 | var user = await GetCurrentUserAsync(); 116 | if (user != null) 117 | { 118 | await _userManager.SetTwoFactorEnabledAsync(user, true); 119 | await _signInManager.SignInAsync(user, isPersistent: false); 120 | _logger.LogInformation(1, "User enabled two-factor authentication."); 121 | } 122 | return RedirectToAction(nameof(Index), "Manage"); 123 | } 124 | 125 | // 126 | // POST: /Manage/DisableTwoFactorAuthentication 127 | [HttpPost] 128 | [ValidateAntiForgeryToken] 129 | public async Task DisableTwoFactorAuthentication() 130 | { 131 | var user = await GetCurrentUserAsync(); 132 | if (user != null) 133 | { 134 | await _userManager.SetTwoFactorEnabledAsync(user, false); 135 | await _signInManager.SignInAsync(user, isPersistent: false); 136 | _logger.LogInformation(2, "User disabled two-factor authentication."); 137 | } 138 | return RedirectToAction(nameof(Index), "Manage"); 139 | } 140 | 141 | // 142 | // GET: /Manage/VerifyPhoneNumber 143 | [HttpGet] 144 | public async Task VerifyPhoneNumber(string phoneNumber) 145 | { 146 | var code = await _userManager.GenerateChangePhoneNumberTokenAsync(await GetCurrentUserAsync(), phoneNumber); 147 | // Send an SMS to verify the phone number 148 | return phoneNumber == null ? View("Error") : View(new VerifyPhoneNumberViewModel { PhoneNumber = phoneNumber }); 149 | } 150 | 151 | // 152 | // POST: /Manage/VerifyPhoneNumber 153 | [HttpPost] 154 | [ValidateAntiForgeryToken] 155 | public async Task VerifyPhoneNumber(VerifyPhoneNumberViewModel model) 156 | { 157 | if (!ModelState.IsValid) 158 | { 159 | return View(model); 160 | } 161 | var user = await GetCurrentUserAsync(); 162 | if (user != null) 163 | { 164 | var result = await _userManager.ChangePhoneNumberAsync(user, model.PhoneNumber, model.Code); 165 | if (result.Succeeded) 166 | { 167 | await _signInManager.SignInAsync(user, isPersistent: false); 168 | return RedirectToAction(nameof(Index), new { Message = ManageMessageId.AddPhoneSuccess }); 169 | } 170 | } 171 | // If we got this far, something failed, redisplay the form 172 | ModelState.AddModelError(string.Empty, "Failed to verify phone number"); 173 | return View(model); 174 | } 175 | 176 | // 177 | // POST: /Manage/RemovePhoneNumber 178 | [HttpPost] 179 | [ValidateAntiForgeryToken] 180 | public async Task RemovePhoneNumber() 181 | { 182 | var user = await GetCurrentUserAsync(); 183 | if (user != null) 184 | { 185 | var result = await _userManager.SetPhoneNumberAsync(user, null); 186 | if (result.Succeeded) 187 | { 188 | await _signInManager.SignInAsync(user, isPersistent: false); 189 | return RedirectToAction(nameof(Index), new { Message = ManageMessageId.RemovePhoneSuccess }); 190 | } 191 | } 192 | return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); 193 | } 194 | 195 | // 196 | // GET: /Manage/ChangePassword 197 | [HttpGet] 198 | public IActionResult ChangePassword() 199 | { 200 | return View(); 201 | } 202 | 203 | // 204 | // POST: /Manage/ChangePassword 205 | [HttpPost] 206 | [ValidateAntiForgeryToken] 207 | public async Task ChangePassword(ChangePasswordViewModel model) 208 | { 209 | if (!ModelState.IsValid) 210 | { 211 | return View(model); 212 | } 213 | var user = await GetCurrentUserAsync(); 214 | if (user != null) 215 | { 216 | var result = await _userManager.ChangePasswordAsync(user, model.OldPassword, model.NewPassword); 217 | if (result.Succeeded) 218 | { 219 | await _signInManager.SignInAsync(user, isPersistent: false); 220 | _logger.LogInformation(3, "User changed their password successfully."); 221 | return RedirectToAction(nameof(Index), new { Message = ManageMessageId.ChangePasswordSuccess }); 222 | } 223 | AddErrors(result); 224 | return View(model); 225 | } 226 | return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); 227 | } 228 | 229 | // 230 | // GET: /Manage/SetPassword 231 | [HttpGet] 232 | public IActionResult SetPassword() 233 | { 234 | return View(); 235 | } 236 | 237 | // 238 | // POST: /Manage/SetPassword 239 | [HttpPost] 240 | [ValidateAntiForgeryToken] 241 | public async Task SetPassword(SetPasswordViewModel model) 242 | { 243 | if (!ModelState.IsValid) 244 | { 245 | return View(model); 246 | } 247 | 248 | var user = await GetCurrentUserAsync(); 249 | if (user != null) 250 | { 251 | var result = await _userManager.AddPasswordAsync(user, model.NewPassword); 252 | if (result.Succeeded) 253 | { 254 | await _signInManager.SignInAsync(user, isPersistent: false); 255 | return RedirectToAction(nameof(Index), new { Message = ManageMessageId.SetPasswordSuccess }); 256 | } 257 | AddErrors(result); 258 | return View(model); 259 | } 260 | return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); 261 | } 262 | 263 | //GET: /Manage/ManageLogins 264 | [HttpGet] 265 | public async Task ManageLogins(ManageMessageId? message = null) 266 | { 267 | ViewData["StatusMessage"] = 268 | message == ManageMessageId.RemoveLoginSuccess ? "The external login was removed." 269 | : message == ManageMessageId.AddLoginSuccess ? "The external login was added." 270 | : message == ManageMessageId.Error ? "An error has occurred." 271 | : ""; 272 | var user = await GetCurrentUserAsync(); 273 | if (user == null) 274 | { 275 | return View("Error"); 276 | } 277 | var userLogins = await _userManager.GetLoginsAsync(user); 278 | var otherLogins = _signInManager.GetExternalAuthenticationSchemes().Where(auth => userLogins.All(ul => auth.AuthenticationScheme != ul.LoginProvider)).ToList(); 279 | ViewData["ShowRemoveButton"] = user.PasswordHash != null || userLogins.Count > 1; 280 | return View(new ManageLoginsViewModel 281 | { 282 | CurrentLogins = userLogins, 283 | OtherLogins = otherLogins 284 | }); 285 | } 286 | 287 | // 288 | // POST: /Manage/LinkLogin 289 | [HttpPost] 290 | [ValidateAntiForgeryToken] 291 | public IActionResult LinkLogin(string provider) 292 | { 293 | // Request a redirect to the external login provider to link a login for the current user 294 | var redirectUrl = Url.Action("LinkLoginCallback", "Manage"); 295 | var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl, _userManager.GetUserId(User)); 296 | return new ChallengeResult(provider, properties); 297 | } 298 | 299 | // 300 | // GET: /Manage/LinkLoginCallback 301 | [HttpGet] 302 | public async Task LinkLoginCallback() 303 | { 304 | var user = await GetCurrentUserAsync(); 305 | if (user == null) 306 | { 307 | return View("Error"); 308 | } 309 | var info = await _signInManager.GetExternalLoginInfoAsync(_userManager.GetUserId(User)); 310 | if (info == null) 311 | { 312 | return RedirectToAction(nameof(ManageLogins), new { Message = ManageMessageId.Error }); 313 | } 314 | var result = await _userManager.AddLoginAsync(user, info); 315 | var message = result.Succeeded ? ManageMessageId.AddLoginSuccess : ManageMessageId.Error; 316 | return RedirectToAction(nameof(ManageLogins), new { Message = message }); 317 | } 318 | 319 | #region Helpers 320 | 321 | private void AddErrors(IdentityResult result) 322 | { 323 | foreach (var error in result.Errors) 324 | { 325 | ModelState.AddModelError(string.Empty, error.Description); 326 | } 327 | } 328 | 329 | public enum ManageMessageId 330 | { 331 | AddPhoneSuccess, 332 | AddLoginSuccess, 333 | ChangePasswordSuccess, 334 | SetTwoFactorSuccess, 335 | SetPasswordSuccess, 336 | RemoveLoginSuccess, 337 | RemovePhoneSuccess, 338 | Error 339 | } 340 | 341 | private async Task GetCurrentUserAsync() 342 | { 343 | return await _userManager.GetUserAsync(HttpContext.User); 344 | } 345 | 346 | #endregion 347 | } 348 | } 349 | -------------------------------------------------------------------------------- /src/RC1toRC2/Migrations/20160515152410_InitialDatabase.Designer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Infrastructure; 4 | using Microsoft.EntityFrameworkCore.Metadata; 5 | using Microsoft.EntityFrameworkCore.Migrations; 6 | using RC1toRC2.Models; 7 | 8 | namespace RC1toRC2.Migrations 9 | { 10 | [DbContext(typeof(ApplicationDbContext))] 11 | [Migration("20160515152410_InitialDatabase")] 12 | partial class InitialDatabase 13 | { 14 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 15 | { 16 | modelBuilder 17 | .HasAnnotation("ProductVersion", "1.0.0-rc2-20901") 18 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 19 | 20 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => 21 | { 22 | b.Property("Id"); 23 | 24 | b.Property("ConcurrencyStamp") 25 | .IsConcurrencyToken(); 26 | 27 | b.Property("Name") 28 | .HasAnnotation("MaxLength", 256); 29 | 30 | b.Property("NormalizedName") 31 | .HasAnnotation("MaxLength", 256); 32 | 33 | b.HasKey("Id"); 34 | 35 | b.HasIndex("NormalizedName") 36 | .HasName("RoleNameIndex"); 37 | 38 | b.ToTable("AspNetRoles"); 39 | }); 40 | 41 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => 42 | { 43 | b.Property("Id") 44 | .ValueGeneratedOnAdd(); 45 | 46 | b.Property("ClaimType"); 47 | 48 | b.Property("ClaimValue"); 49 | 50 | b.Property("RoleId") 51 | .IsRequired(); 52 | 53 | b.HasKey("Id"); 54 | 55 | b.HasIndex("RoleId"); 56 | 57 | b.ToTable("AspNetRoleClaims"); 58 | }); 59 | 60 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => 61 | { 62 | b.Property("Id") 63 | .ValueGeneratedOnAdd(); 64 | 65 | b.Property("ClaimType"); 66 | 67 | b.Property("ClaimValue"); 68 | 69 | b.Property("UserId") 70 | .IsRequired(); 71 | 72 | b.HasKey("Id"); 73 | 74 | b.HasIndex("UserId"); 75 | 76 | b.ToTable("AspNetUserClaims"); 77 | }); 78 | 79 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => 80 | { 81 | b.Property("LoginProvider"); 82 | 83 | b.Property("ProviderKey"); 84 | 85 | b.Property("ProviderDisplayName"); 86 | 87 | b.Property("UserId") 88 | .IsRequired(); 89 | 90 | b.HasKey("LoginProvider", "ProviderKey"); 91 | 92 | b.HasIndex("UserId"); 93 | 94 | b.ToTable("AspNetUserLogins"); 95 | }); 96 | 97 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => 98 | { 99 | b.Property("UserId"); 100 | 101 | b.Property("RoleId"); 102 | 103 | b.HasKey("UserId", "RoleId"); 104 | 105 | b.HasIndex("RoleId"); 106 | 107 | b.HasIndex("UserId"); 108 | 109 | b.ToTable("AspNetUserRoles"); 110 | }); 111 | 112 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken", b => 113 | { 114 | b.Property("UserId"); 115 | 116 | b.Property("LoginProvider"); 117 | 118 | b.Property("Name"); 119 | 120 | b.Property("Value"); 121 | 122 | b.HasKey("UserId", "LoginProvider", "Name"); 123 | 124 | b.ToTable("AspNetUserTokens"); 125 | }); 126 | 127 | modelBuilder.Entity("RC1toRC2.Models.ApplicationUser", b => 128 | { 129 | b.Property("Id"); 130 | 131 | b.Property("AccessFailedCount"); 132 | 133 | b.Property("ConcurrencyStamp") 134 | .IsConcurrencyToken(); 135 | 136 | b.Property("Email") 137 | .HasAnnotation("MaxLength", 256); 138 | 139 | b.Property("EmailConfirmed"); 140 | 141 | b.Property("LockoutEnabled"); 142 | 143 | b.Property("LockoutEnd"); 144 | 145 | b.Property("NormalizedEmail") 146 | .HasAnnotation("MaxLength", 256); 147 | 148 | b.Property("NormalizedUserName") 149 | .HasAnnotation("MaxLength", 256); 150 | 151 | b.Property("PasswordHash"); 152 | 153 | b.Property("PhoneNumber"); 154 | 155 | b.Property("PhoneNumberConfirmed"); 156 | 157 | b.Property("SecurityStamp"); 158 | 159 | b.Property("TwoFactorEnabled"); 160 | 161 | b.Property("UserName") 162 | .HasAnnotation("MaxLength", 256); 163 | 164 | b.HasKey("Id"); 165 | 166 | b.HasIndex("NormalizedEmail") 167 | .HasName("EmailIndex"); 168 | 169 | b.HasIndex("NormalizedUserName") 170 | .HasName("UserNameIndex"); 171 | 172 | b.ToTable("AspNetUsers"); 173 | }); 174 | 175 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => 176 | { 177 | b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") 178 | .WithMany() 179 | .HasForeignKey("RoleId") 180 | .OnDelete(DeleteBehavior.Cascade); 181 | }); 182 | 183 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => 184 | { 185 | b.HasOne("RC1toRC2.Models.ApplicationUser") 186 | .WithMany() 187 | .HasForeignKey("UserId") 188 | .OnDelete(DeleteBehavior.Cascade); 189 | }); 190 | 191 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => 192 | { 193 | b.HasOne("RC1toRC2.Models.ApplicationUser") 194 | .WithMany() 195 | .HasForeignKey("UserId") 196 | .OnDelete(DeleteBehavior.Cascade); 197 | }); 198 | 199 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => 200 | { 201 | b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") 202 | .WithMany() 203 | .HasForeignKey("RoleId") 204 | .OnDelete(DeleteBehavior.Cascade); 205 | 206 | b.HasOne("RC1toRC2.Models.ApplicationUser") 207 | .WithMany() 208 | .HasForeignKey("UserId") 209 | .OnDelete(DeleteBehavior.Cascade); 210 | }); 211 | } 212 | } 213 | } 214 | -------------------------------------------------------------------------------- /src/RC1toRC2/Migrations/20160515152410_InitialDatabase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.EntityFrameworkCore.Migrations; 4 | using Microsoft.EntityFrameworkCore.Metadata; 5 | 6 | namespace RC1toRC2.Migrations 7 | { 8 | public partial class InitialDatabase : Migration 9 | { 10 | protected override void Up(MigrationBuilder migrationBuilder) 11 | { 12 | migrationBuilder.CreateTable( 13 | name: "AspNetRoles", 14 | columns: table => new 15 | { 16 | Id = table.Column(nullable: false), 17 | ConcurrencyStamp = table.Column(nullable: true), 18 | Name = table.Column(nullable: true), 19 | NormalizedName = table.Column(nullable: true) 20 | }, 21 | constraints: table => 22 | { 23 | table.PrimaryKey("PK_AspNetRoles", x => x.Id); 24 | }); 25 | 26 | migrationBuilder.CreateTable( 27 | name: "AspNetUserTokens", 28 | columns: table => new 29 | { 30 | UserId = table.Column(nullable: false), 31 | LoginProvider = table.Column(nullable: false), 32 | Name = table.Column(nullable: false), 33 | Value = table.Column(nullable: true) 34 | }, 35 | constraints: table => 36 | { 37 | table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); 38 | }); 39 | 40 | migrationBuilder.CreateTable( 41 | name: "AspNetUsers", 42 | columns: table => new 43 | { 44 | Id = table.Column(nullable: false), 45 | AccessFailedCount = table.Column(nullable: false), 46 | ConcurrencyStamp = table.Column(nullable: true), 47 | Email = table.Column(nullable: true), 48 | EmailConfirmed = table.Column(nullable: false), 49 | LockoutEnabled = table.Column(nullable: false), 50 | LockoutEnd = table.Column(nullable: true), 51 | NormalizedEmail = table.Column(nullable: true), 52 | NormalizedUserName = table.Column(nullable: true), 53 | PasswordHash = table.Column(nullable: true), 54 | PhoneNumber = table.Column(nullable: true), 55 | PhoneNumberConfirmed = table.Column(nullable: false), 56 | SecurityStamp = table.Column(nullable: true), 57 | TwoFactorEnabled = table.Column(nullable: false), 58 | UserName = table.Column(nullable: true) 59 | }, 60 | constraints: table => 61 | { 62 | table.PrimaryKey("PK_AspNetUsers", x => x.Id); 63 | }); 64 | 65 | migrationBuilder.CreateTable( 66 | name: "AspNetRoleClaims", 67 | columns: table => new 68 | { 69 | Id = table.Column(nullable: false) 70 | .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), 71 | ClaimType = table.Column(nullable: true), 72 | ClaimValue = table.Column(nullable: true), 73 | RoleId = table.Column(nullable: false) 74 | }, 75 | constraints: table => 76 | { 77 | table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); 78 | table.ForeignKey( 79 | name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", 80 | column: x => x.RoleId, 81 | principalTable: "AspNetRoles", 82 | principalColumn: "Id", 83 | onDelete: ReferentialAction.Cascade); 84 | }); 85 | 86 | migrationBuilder.CreateTable( 87 | name: "AspNetUserClaims", 88 | columns: table => new 89 | { 90 | Id = table.Column(nullable: false) 91 | .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), 92 | ClaimType = table.Column(nullable: true), 93 | ClaimValue = table.Column(nullable: true), 94 | UserId = table.Column(nullable: false) 95 | }, 96 | constraints: table => 97 | { 98 | table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); 99 | table.ForeignKey( 100 | name: "FK_AspNetUserClaims_AspNetUsers_UserId", 101 | column: x => x.UserId, 102 | principalTable: "AspNetUsers", 103 | principalColumn: "Id", 104 | onDelete: ReferentialAction.Cascade); 105 | }); 106 | 107 | migrationBuilder.CreateTable( 108 | name: "AspNetUserLogins", 109 | columns: table => new 110 | { 111 | LoginProvider = table.Column(nullable: false), 112 | ProviderKey = table.Column(nullable: false), 113 | ProviderDisplayName = table.Column(nullable: true), 114 | UserId = table.Column(nullable: false) 115 | }, 116 | constraints: table => 117 | { 118 | table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); 119 | table.ForeignKey( 120 | name: "FK_AspNetUserLogins_AspNetUsers_UserId", 121 | column: x => x.UserId, 122 | principalTable: "AspNetUsers", 123 | principalColumn: "Id", 124 | onDelete: ReferentialAction.Cascade); 125 | }); 126 | 127 | migrationBuilder.CreateTable( 128 | name: "AspNetUserRoles", 129 | columns: table => new 130 | { 131 | UserId = table.Column(nullable: false), 132 | RoleId = table.Column(nullable: false) 133 | }, 134 | constraints: table => 135 | { 136 | table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); 137 | table.ForeignKey( 138 | name: "FK_AspNetUserRoles_AspNetRoles_RoleId", 139 | column: x => x.RoleId, 140 | principalTable: "AspNetRoles", 141 | principalColumn: "Id", 142 | onDelete: ReferentialAction.Cascade); 143 | table.ForeignKey( 144 | name: "FK_AspNetUserRoles_AspNetUsers_UserId", 145 | column: x => x.UserId, 146 | principalTable: "AspNetUsers", 147 | principalColumn: "Id", 148 | onDelete: ReferentialAction.Cascade); 149 | }); 150 | 151 | migrationBuilder.CreateIndex( 152 | name: "RoleNameIndex", 153 | table: "AspNetRoles", 154 | column: "NormalizedName"); 155 | 156 | migrationBuilder.CreateIndex( 157 | name: "IX_AspNetRoleClaims_RoleId", 158 | table: "AspNetRoleClaims", 159 | column: "RoleId"); 160 | 161 | migrationBuilder.CreateIndex( 162 | name: "IX_AspNetUserClaims_UserId", 163 | table: "AspNetUserClaims", 164 | column: "UserId"); 165 | 166 | migrationBuilder.CreateIndex( 167 | name: "IX_AspNetUserLogins_UserId", 168 | table: "AspNetUserLogins", 169 | column: "UserId"); 170 | 171 | migrationBuilder.CreateIndex( 172 | name: "IX_AspNetUserRoles_RoleId", 173 | table: "AspNetUserRoles", 174 | column: "RoleId"); 175 | 176 | migrationBuilder.CreateIndex( 177 | name: "IX_AspNetUserRoles_UserId", 178 | table: "AspNetUserRoles", 179 | column: "UserId"); 180 | 181 | migrationBuilder.CreateIndex( 182 | name: "EmailIndex", 183 | table: "AspNetUsers", 184 | column: "NormalizedEmail"); 185 | 186 | migrationBuilder.CreateIndex( 187 | name: "UserNameIndex", 188 | table: "AspNetUsers", 189 | column: "NormalizedUserName"); 190 | } 191 | 192 | protected override void Down(MigrationBuilder migrationBuilder) 193 | { 194 | migrationBuilder.DropTable( 195 | name: "AspNetRoleClaims"); 196 | 197 | migrationBuilder.DropTable( 198 | name: "AspNetUserClaims"); 199 | 200 | migrationBuilder.DropTable( 201 | name: "AspNetUserLogins"); 202 | 203 | migrationBuilder.DropTable( 204 | name: "AspNetUserRoles"); 205 | 206 | migrationBuilder.DropTable( 207 | name: "AspNetUserTokens"); 208 | 209 | migrationBuilder.DropTable( 210 | name: "AspNetRoles"); 211 | 212 | migrationBuilder.DropTable( 213 | name: "AspNetUsers"); 214 | } 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /src/RC1toRC2/Migrations/ApplicationDbContextModelSnapshot.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Infrastructure; 4 | using Microsoft.EntityFrameworkCore.Metadata; 5 | using Microsoft.EntityFrameworkCore.Migrations; 6 | using RC1toRC2.Models; 7 | 8 | namespace RC1toRC2.Migrations 9 | { 10 | [DbContext(typeof(ApplicationDbContext))] 11 | partial class ApplicationDbContextModelSnapshot : ModelSnapshot 12 | { 13 | protected override void BuildModel(ModelBuilder modelBuilder) 14 | { 15 | modelBuilder 16 | .HasAnnotation("ProductVersion", "1.0.0-rc2-20901") 17 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 18 | 19 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => 20 | { 21 | b.Property("Id"); 22 | 23 | b.Property("ConcurrencyStamp") 24 | .IsConcurrencyToken(); 25 | 26 | b.Property("Name") 27 | .HasAnnotation("MaxLength", 256); 28 | 29 | b.Property("NormalizedName") 30 | .HasAnnotation("MaxLength", 256); 31 | 32 | b.HasKey("Id"); 33 | 34 | b.HasIndex("NormalizedName") 35 | .HasName("RoleNameIndex"); 36 | 37 | b.ToTable("AspNetRoles"); 38 | }); 39 | 40 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => 41 | { 42 | b.Property("Id") 43 | .ValueGeneratedOnAdd(); 44 | 45 | b.Property("ClaimType"); 46 | 47 | b.Property("ClaimValue"); 48 | 49 | b.Property("RoleId") 50 | .IsRequired(); 51 | 52 | b.HasKey("Id"); 53 | 54 | b.HasIndex("RoleId"); 55 | 56 | b.ToTable("AspNetRoleClaims"); 57 | }); 58 | 59 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => 60 | { 61 | b.Property("Id") 62 | .ValueGeneratedOnAdd(); 63 | 64 | b.Property("ClaimType"); 65 | 66 | b.Property("ClaimValue"); 67 | 68 | b.Property("UserId") 69 | .IsRequired(); 70 | 71 | b.HasKey("Id"); 72 | 73 | b.HasIndex("UserId"); 74 | 75 | b.ToTable("AspNetUserClaims"); 76 | }); 77 | 78 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => 79 | { 80 | b.Property("LoginProvider"); 81 | 82 | b.Property("ProviderKey"); 83 | 84 | b.Property("ProviderDisplayName"); 85 | 86 | b.Property("UserId") 87 | .IsRequired(); 88 | 89 | b.HasKey("LoginProvider", "ProviderKey"); 90 | 91 | b.HasIndex("UserId"); 92 | 93 | b.ToTable("AspNetUserLogins"); 94 | }); 95 | 96 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => 97 | { 98 | b.Property("UserId"); 99 | 100 | b.Property("RoleId"); 101 | 102 | b.HasKey("UserId", "RoleId"); 103 | 104 | b.HasIndex("RoleId"); 105 | 106 | b.HasIndex("UserId"); 107 | 108 | b.ToTable("AspNetUserRoles"); 109 | }); 110 | 111 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken", b => 112 | { 113 | b.Property("UserId"); 114 | 115 | b.Property("LoginProvider"); 116 | 117 | b.Property("Name"); 118 | 119 | b.Property("Value"); 120 | 121 | b.HasKey("UserId", "LoginProvider", "Name"); 122 | 123 | b.ToTable("AspNetUserTokens"); 124 | }); 125 | 126 | modelBuilder.Entity("RC1toRC2.Models.ApplicationUser", b => 127 | { 128 | b.Property("Id"); 129 | 130 | b.Property("AccessFailedCount"); 131 | 132 | b.Property("ConcurrencyStamp") 133 | .IsConcurrencyToken(); 134 | 135 | b.Property("Email") 136 | .HasAnnotation("MaxLength", 256); 137 | 138 | b.Property("EmailConfirmed"); 139 | 140 | b.Property("LockoutEnabled"); 141 | 142 | b.Property("LockoutEnd"); 143 | 144 | b.Property("NormalizedEmail") 145 | .HasAnnotation("MaxLength", 256); 146 | 147 | b.Property("NormalizedUserName") 148 | .HasAnnotation("MaxLength", 256); 149 | 150 | b.Property("PasswordHash"); 151 | 152 | b.Property("PhoneNumber"); 153 | 154 | b.Property("PhoneNumberConfirmed"); 155 | 156 | b.Property("SecurityStamp"); 157 | 158 | b.Property("TwoFactorEnabled"); 159 | 160 | b.Property("UserName") 161 | .HasAnnotation("MaxLength", 256); 162 | 163 | b.HasKey("Id"); 164 | 165 | b.HasIndex("NormalizedEmail") 166 | .HasName("EmailIndex"); 167 | 168 | b.HasIndex("NormalizedUserName") 169 | .HasName("UserNameIndex"); 170 | 171 | b.ToTable("AspNetUsers"); 172 | }); 173 | 174 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => 175 | { 176 | b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") 177 | .WithMany() 178 | .HasForeignKey("RoleId") 179 | .OnDelete(DeleteBehavior.Cascade); 180 | }); 181 | 182 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => 183 | { 184 | b.HasOne("RC1toRC2.Models.ApplicationUser") 185 | .WithMany() 186 | .HasForeignKey("UserId") 187 | .OnDelete(DeleteBehavior.Cascade); 188 | }); 189 | 190 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => 191 | { 192 | b.HasOne("RC1toRC2.Models.ApplicationUser") 193 | .WithMany() 194 | .HasForeignKey("UserId") 195 | .OnDelete(DeleteBehavior.Cascade); 196 | }); 197 | 198 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => 199 | { 200 | b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") 201 | .WithMany() 202 | .HasForeignKey("RoleId") 203 | .OnDelete(DeleteBehavior.Cascade); 204 | 205 | b.HasOne("RC1toRC2.Models.ApplicationUser") 206 | .WithMany() 207 | .HasForeignKey("UserId") 208 | .OnDelete(DeleteBehavior.Cascade); 209 | }); 210 | } 211 | } 212 | } 213 | -------------------------------------------------------------------------------- /src/RC1toRC2/Models/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 6 | using Microsoft.EntityFrameworkCore; 7 | 8 | namespace RC1toRC2.Models 9 | { 10 | public class ApplicationDbContext : IdentityDbContext 11 | { 12 | public ApplicationDbContext(DbContextOptions options) 13 | : base(options) 14 | { 15 | } 16 | 17 | protected override void OnModelCreating(ModelBuilder builder) 18 | { 19 | base.OnModelCreating(builder); 20 | // Customize the ASP.NET Identity model and override the defaults if needed. 21 | // For example, you can rename the ASP.NET Identity table names and more. 22 | // Add your customizations after calling base.OnModelCreating(builder); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/RC1toRC2/Models/ApplicationUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 6 | 7 | namespace RC1toRC2.Models 8 | { 9 | // Add profile data for application users by adding properties to the ApplicationUser class 10 | public class ApplicationUser : IdentityUser 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/RC1toRC2/Project_Readme.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Welcome to ASP.NET 5 6 | 127 | 128 | 129 | 130 | 138 | 139 |
140 |
141 |

This application consists of:

142 |
    143 |
  • Sample pages using ASP.NET MVC 6
  • 144 |
  • Gulp and Bower for managing client-side libraries
  • 145 |
  • Theming using Bootstrap
  • 146 |
147 |
148 | 160 | 172 | 181 | 182 | 185 |
186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /src/RC1toRC2/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:3228/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "RC1toRC2": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "launchUrl": "http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/RC1toRC2/RC1toRC2.xproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 14.0 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | 7 | 8 | 9 | 7b0d8e85-f5d0-48e6-b39a-f9207c03c0c0 10 | RC1toRC2 11 | .\obj 12 | .\bin\ 13 | v4.5.2 14 | 15 | 16 | 2.0 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/RC1toRC2/Services/IEmailSender.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace RC1toRC2.Services 7 | { 8 | public interface IEmailSender 9 | { 10 | Task SendEmailAsync(string email, string subject, string message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/RC1toRC2/Services/ISmsSender.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace RC1toRC2.Services 7 | { 8 | public interface ISmsSender 9 | { 10 | Task SendSmsAsync(string number, string message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/RC1toRC2/Services/MessageServices.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace RC1toRC2.Services 7 | { 8 | // This class is used by the application to send Email and SMS 9 | // when you turn on two-factor authentication in ASP.NET Identity. 10 | // For more details see this link http://go.microsoft.com/fwlink/?LinkID=532713 11 | public class AuthMessageSender : IEmailSender, ISmsSender 12 | { 13 | public Task SendEmailAsync(string email, string subject, string message) 14 | { 15 | // Plug in your email service here to send an email. 16 | return Task.FromResult(0); 17 | } 18 | 19 | public Task SendSmsAsync(string number, string message) 20 | { 21 | // Plug in your SMS service here to send a text message. 22 | return Task.FromResult(0); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/RC1toRC2/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Builder; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 9 | using Microsoft.EntityFrameworkCore; 10 | using Microsoft.EntityFrameworkCore.Infrastructure; 11 | using Microsoft.Extensions.Configuration; 12 | using Microsoft.Extensions.DependencyInjection; 13 | using Microsoft.Extensions.Logging; 14 | using RC1toRC2.Models; 15 | using RC1toRC2.Services; 16 | 17 | namespace RC1toRC2 18 | { 19 | public class Startup 20 | { 21 | public Startup(IHostingEnvironment env) 22 | { 23 | // Set up configuration sources. 24 | 25 | var builder = new ConfigurationBuilder() 26 | .SetBasePath(env.ContentRootPath) 27 | .AddJsonFile("appsettings.json") 28 | .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true); 29 | 30 | if (env.IsDevelopment()) 31 | { 32 | // For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709 33 | builder.AddUserSecrets(); 34 | 35 | // This will push telemetry data through Application Insights pipeline faster, allowing you to view results immediately. 36 | builder.AddApplicationInsightsSettings(developerMode: true); 37 | } 38 | 39 | builder.AddEnvironmentVariables(); 40 | Configuration = builder.Build(); 41 | } 42 | 43 | public IConfigurationRoot Configuration { get; set; } 44 | 45 | // This method gets called by the runtime. Use this method to add services to the container. 46 | public void ConfigureServices(IServiceCollection services) 47 | { 48 | // Add framework services. 49 | services.AddApplicationInsightsTelemetry(Configuration); 50 | 51 | services.AddDbContext(options => 52 | options.UseSqlServer(Configuration["Data:DefaultConnection:ConnectionString"])); 53 | 54 | services.AddIdentity() 55 | .AddEntityFrameworkStores() 56 | .AddDefaultTokenProviders(); 57 | 58 | services.AddMvc(); 59 | 60 | // Add application services. 61 | services.AddTransient(); 62 | services.AddTransient(); 63 | } 64 | 65 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 66 | public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) 67 | { 68 | loggerFactory.AddConsole(Configuration.GetSection("Logging")); 69 | loggerFactory.AddDebug(); 70 | 71 | app.UseApplicationInsightsRequestTelemetry(); 72 | 73 | if (env.IsDevelopment()) 74 | { 75 | app.UseBrowserLink(); 76 | app.UseDeveloperExceptionPage(); 77 | app.UseDatabaseErrorPage(); 78 | } 79 | else 80 | { 81 | app.UseExceptionHandler("/Home/Error"); 82 | 83 | // For more details on creating database during deployment see http://go.microsoft.com/fwlink/?LinkID=615859 84 | try 85 | { 86 | using (var serviceScope = app.ApplicationServices.GetRequiredService() 87 | .CreateScope()) 88 | { 89 | serviceScope.ServiceProvider.GetService() 90 | .Database.Migrate(); 91 | } 92 | } 93 | catch { } 94 | } 95 | 96 | app.UseApplicationInsightsExceptionTelemetry(); 97 | 98 | app.UseStaticFiles(); 99 | 100 | app.UseIdentity(); 101 | 102 | // To configure external authentication please see http://go.microsoft.com/fwlink/?LinkID=532715 103 | 104 | app.UseMvc(routes => 105 | { 106 | routes.MapRoute( 107 | name: "default", 108 | template: "{controller=Home}/{action=Index}/{id?}"); 109 | }); 110 | } 111 | 112 | // Entry point for the application. 113 | public static void Main(string[] args) 114 | { 115 | var host = new WebHostBuilder() 116 | .UseKestrel() 117 | .UseContentRoot(Directory.GetCurrentDirectory()) 118 | .UseIISIntegration() 119 | .UseStartup() 120 | .Build(); 121 | 122 | host.Run(); 123 | } 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /src/RC1toRC2/ViewModels/Account/ExternalLoginConfirmationViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace RC1toRC2.ViewModels.Account 8 | { 9 | public class ExternalLoginConfirmationViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/RC1toRC2/ViewModels/Account/ForgotPasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace RC1toRC2.ViewModels.Account 8 | { 9 | public class ForgotPasswordViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/RC1toRC2/ViewModels/Account/LoginViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace RC1toRC2.ViewModels.Account 8 | { 9 | public class LoginViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | 15 | [Required] 16 | [DataType(DataType.Password)] 17 | public string Password { get; set; } 18 | 19 | [Display(Name = "Remember me?")] 20 | public bool RememberMe { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/RC1toRC2/ViewModels/Account/RegisterViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace RC1toRC2.ViewModels.Account 8 | { 9 | public class RegisterViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | [Display(Name = "Email")] 14 | public string Email { get; set; } 15 | 16 | [Required] 17 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 18 | [DataType(DataType.Password)] 19 | [Display(Name = "Password")] 20 | public string Password { get; set; } 21 | 22 | [DataType(DataType.Password)] 23 | [Display(Name = "Confirm password")] 24 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] 25 | public string ConfirmPassword { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/RC1toRC2/ViewModels/Account/ResetPasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace RC1toRC2.ViewModels.Account 8 | { 9 | public class ResetPasswordViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | 15 | [Required] 16 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 17 | [DataType(DataType.Password)] 18 | public string Password { get; set; } 19 | 20 | [DataType(DataType.Password)] 21 | [Display(Name = "Confirm password")] 22 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] 23 | public string ConfirmPassword { get; set; } 24 | 25 | public string Code { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/RC1toRC2/ViewModels/Account/SendCodeViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc.Rendering; 6 | 7 | namespace RC1toRC2.ViewModels.Account 8 | { 9 | public class SendCodeViewModel 10 | { 11 | public string SelectedProvider { get; set; } 12 | 13 | public ICollection Providers { get; set; } 14 | 15 | public string ReturnUrl { get; set; } 16 | 17 | public bool RememberMe { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/RC1toRC2/ViewModels/Account/VerifyCodeViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace RC1toRC2.ViewModels.Account 8 | { 9 | public class VerifyCodeViewModel 10 | { 11 | [Required] 12 | public string Provider { get; set; } 13 | 14 | [Required] 15 | public string Code { get; set; } 16 | 17 | public string ReturnUrl { get; set; } 18 | 19 | [Display(Name = "Remember this browser?")] 20 | public bool RememberBrowser { get; set; } 21 | 22 | [Display(Name = "Remember me?")] 23 | public bool RememberMe { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/RC1toRC2/ViewModels/Manage/AddPhoneNumberViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace RC1toRC2.ViewModels.Manage 8 | { 9 | public class AddPhoneNumberViewModel 10 | { 11 | [Required] 12 | [Phone] 13 | [Display(Name = "Phone number")] 14 | public string PhoneNumber { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/RC1toRC2/ViewModels/Manage/ChangePasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace RC1toRC2.ViewModels.Manage 8 | { 9 | public class ChangePasswordViewModel 10 | { 11 | [Required] 12 | [DataType(DataType.Password)] 13 | [Display(Name = "Current password")] 14 | public string OldPassword { get; set; } 15 | 16 | [Required] 17 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 18 | [DataType(DataType.Password)] 19 | [Display(Name = "New password")] 20 | public string NewPassword { get; set; } 21 | 22 | [DataType(DataType.Password)] 23 | [Display(Name = "Confirm new password")] 24 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] 25 | public string ConfirmPassword { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/RC1toRC2/ViewModels/Manage/ConfigureTwoFactorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc.Rendering; 6 | 7 | namespace RC1toRC2.ViewModels.Manage 8 | { 9 | public class ConfigureTwoFactorViewModel 10 | { 11 | public string SelectedProvider { get; set; } 12 | 13 | public ICollection Providers { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/RC1toRC2/ViewModels/Manage/FactorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace RC1toRC2.ViewModels.Manage 7 | { 8 | public class FactorViewModel 9 | { 10 | public string Purpose { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/RC1toRC2/ViewModels/Manage/IndexViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Identity; 6 | 7 | namespace RC1toRC2.ViewModels.Manage 8 | { 9 | public class IndexViewModel 10 | { 11 | public bool HasPassword { get; set; } 12 | 13 | public IList Logins { get; set; } 14 | 15 | public string PhoneNumber { get; set; } 16 | 17 | public bool TwoFactor { get; set; } 18 | 19 | public bool BrowserRemembered { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/RC1toRC2/ViewModels/Manage/ManageLoginsViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Http.Authentication; 6 | using Microsoft.AspNetCore.Identity; 7 | 8 | namespace RC1toRC2.ViewModels.Manage 9 | { 10 | public class ManageLoginsViewModel 11 | { 12 | public IList CurrentLogins { get; set; } 13 | 14 | public IList OtherLogins { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/RC1toRC2/ViewModels/Manage/RemoveLoginViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace RC1toRC2.ViewModels.Manage 8 | { 9 | public class RemoveLoginViewModel 10 | { 11 | public string LoginProvider { get; set; } 12 | public string ProviderKey { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/RC1toRC2/ViewModels/Manage/SetPasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace RC1toRC2.ViewModels.Manage 8 | { 9 | public class SetPasswordViewModel 10 | { 11 | [Required] 12 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 13 | [DataType(DataType.Password)] 14 | [Display(Name = "New password")] 15 | public string NewPassword { get; set; } 16 | 17 | [DataType(DataType.Password)] 18 | [Display(Name = "Confirm new password")] 19 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] 20 | public string ConfirmPassword { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/RC1toRC2/ViewModels/Manage/VerifyPhoneNumberViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace RC1toRC2.ViewModels.Manage 8 | { 9 | public class VerifyPhoneNumberViewModel 10 | { 11 | [Required] 12 | public string Code { get; set; } 13 | 14 | [Required] 15 | [Phone] 16 | [Display(Name = "Phone number")] 17 | public string PhoneNumber { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Account/ConfirmEmail.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Confirm Email"; 3 | } 4 | 5 |

@ViewData["Title"].

6 |
7 |

8 | Thank you for confirming your email. Please Click here to Log in. 9 |

10 |
11 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Account/ExternalLoginConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @model ExternalLoginConfirmationViewModel 2 | @{ 3 | ViewData["Title"] = "Register"; 4 | } 5 | 6 |

@ViewData["Title"].

7 |

Associate your @ViewData["LoginProvider"] account.

8 | 9 |
10 |

Association Form

11 |
12 |
13 | 14 |

15 | You've successfully authenticated with @ViewData["LoginProvider"]. 16 | Please enter a user name for this site below and click the Register button to finish 17 | logging in. 18 |

19 |
20 | 21 |
22 | 23 | 24 |
25 |
26 |
27 |
28 | 29 |
30 |
31 |
32 | 33 | @section Scripts { 34 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 35 | } 36 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Account/ExternalLoginFailure.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Login Failure"; 3 | } 4 | 5 |
6 |

@ViewData["Title"].

7 |

Unsuccessful login with service.

8 |
9 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Account/ForgotPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model ForgotPasswordViewModel 2 | @{ 3 | ViewData["Title"] = "Forgot your password?"; 4 | } 5 | 6 |

@ViewData["Title"].

7 |

8 | For more information on how to enable reset password please see this article. 9 |

10 | 11 | @*
12 |

Enter your email.

13 |
14 |
15 |
16 | 17 |
18 | 19 | 20 |
21 |
22 |
23 |
24 | 25 |
26 |
27 |
*@ 28 | 29 | @section Scripts { 30 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 31 | } 32 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Account/ForgotPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Forgot Password Confirmation"; 3 | } 4 | 5 |

@ViewData["Title"].

6 |

7 | Please check your email to reset your password. 8 |

9 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Account/Lockout.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Locked out"; 3 | } 4 | 5 |
6 |

Locked out.

7 |

This account has been locked out, please try again later.

8 |
9 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Account/Login.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Collections.Generic 2 | @using Microsoft.AspNetCore.Http 3 | @using Microsoft.AspNetCore.Http.Authentication 4 | @model LoginViewModel 5 | @inject SignInManager SignInManager 6 | 7 | @{ 8 | ViewData["Title"] = "Log in"; 9 | } 10 | 11 |

@ViewData["Title"].

12 |
13 |
14 |
15 |
16 |

Use a local account to log in.

17 |
18 |
19 |
20 | 21 |
22 | 23 | 24 |
25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 |
33 |
34 |
35 |
36 | 37 | 38 |
39 |
40 |
41 |
42 |
43 | 44 |
45 |
46 |

47 | Register as a new user? 48 |

49 |

50 | Forgot your password? 51 |

52 |
53 |
54 |
55 |
56 |
57 |

Use another service to log in.

58 |
59 | @{ 60 | var loginProviders = SignInManager.GetExternalAuthenticationSchemes().ToList(); 61 | if (loginProviders.Count == 0) 62 | { 63 |
64 |

65 | There are no external authentication services configured. See this article 66 | for details on setting up this ASP.NET application to support logging in via external services. 67 |

68 |
69 | } 70 | else 71 | { 72 |
73 |
74 |

75 | @foreach (var provider in loginProviders) 76 | { 77 | 78 | } 79 |

80 |
81 |
82 | } 83 | } 84 |
85 |
86 |
87 | 88 | @section Scripts { 89 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 90 | } 91 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Account/Register.cshtml: -------------------------------------------------------------------------------- 1 | @model RegisterViewModel 2 | @{ 3 | ViewData["Title"] = "Register"; 4 | } 5 | 6 |

@ViewData["Title"].

7 | 8 |
9 |

Create a new account.

10 |
11 |
12 |
13 | 14 |
15 | 16 | 17 |
18 |
19 |
20 | 21 |
22 | 23 | 24 |
25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 |
33 |
34 |
35 | 36 |
37 |
38 |
39 | 40 | @section Scripts { 41 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 42 | } 43 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Account/ResetPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model ResetPasswordViewModel 2 | @{ 3 | ViewData["Title"] = "Reset password"; 4 | } 5 | 6 |

@ViewData["Title"].

7 | 8 |
9 |

Reset your password.

10 |
11 |
12 | 13 |
14 | 15 |
16 | 17 | 18 |
19 |
20 |
21 | 22 |
23 | 24 | 25 |
26 |
27 |
28 | 29 |
30 | 31 | 32 |
33 |
34 |
35 |
36 | 37 |
38 |
39 |
40 | 41 | @section Scripts { 42 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 43 | } 44 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Account/ResetPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Reset password confirmation"; 3 | } 4 | 5 |

@ViewData["Title"].

6 |

7 | Your password has been reset. Please Click here to log in. 8 |

9 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Account/SendCode.cshtml: -------------------------------------------------------------------------------- 1 | @model SendCodeViewModel 2 | @{ 3 | ViewData["Title"] = "Send Verification Code"; 4 | } 5 | 6 |

@ViewData["Title"].

7 | 8 |
9 | 10 |
11 |
12 | Select Two-Factor Authentication Provider: 13 | 14 | 15 |
16 |
17 |
18 | 19 | @section Scripts { 20 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 21 | } 22 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Account/VerifyCode.cshtml: -------------------------------------------------------------------------------- 1 | @model VerifyCodeViewModel 2 | @{ 3 | ViewData["Title"] = "Verify"; 4 | } 5 | 6 |

@ViewData["Title"].

7 | 8 |
9 |
10 | 11 | 12 |

@ViewData["Status"]

13 |
14 |
15 | 16 |
17 | 18 | 19 |
20 |
21 |
22 |
23 |
24 | 25 | 26 |
27 |
28 |
29 |
30 |
31 | 32 |
33 |
34 |
35 | 36 | @section Scripts { 37 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 38 | } 39 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "About"; 3 | } 4 |

@ViewData["Title"].

5 |

@ViewData["Message"]

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Contact"; 3 | } 4 |

@ViewData["Title"].

5 |

@ViewData["Message"]

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
18 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 | 67 | 68 | 111 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Manage/AddPhoneNumber.cshtml: -------------------------------------------------------------------------------- 1 | @model AddPhoneNumberViewModel 2 | @{ 3 | ViewData["Title"] = "Add Phone Number"; 4 | } 5 | 6 |

@ViewData["Title"].

7 |
8 |

Add a phone number.

9 |
10 |
11 |
12 | 13 |
14 | 15 | 16 |
17 |
18 |
19 |
20 | 21 |
22 |
23 |
24 | 25 | @section Scripts { 26 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 27 | } 28 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Manage/ChangePassword.cshtml: -------------------------------------------------------------------------------- 1 | @model ChangePasswordViewModel 2 | @{ 3 | ViewData["Title"] = "Change Password"; 4 | } 5 | 6 |

@ViewData["Title"].

7 | 8 |
9 |

Change Password Form

10 |
11 |
12 |
13 | 14 |
15 | 16 | 17 |
18 |
19 |
20 | 21 |
22 | 23 | 24 |
25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 |
33 |
34 |
35 | 36 |
37 |
38 |
39 | 40 | @section Scripts { 41 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 42 | } 43 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Manage/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IndexViewModel 2 | @{ 3 | ViewData["Title"] = "Manage your account"; 4 | } 5 | 6 |

@ViewData["Title"].

7 |

@ViewData["StatusMessage"]

8 | 9 |
10 |

Change your account settings

11 |
12 |
13 |
Password:
14 |
15 | @if (Model.HasPassword) 16 | { 17 | [  Change  ] 18 | } 19 | else 20 | { 21 | [  Create  ] 22 | } 23 |
24 |
External Logins:
25 |
26 | @Model.Logins.Count [  Manage  ] 27 |
28 |
Phone Number:
29 |
30 |

31 | Phone Numbers can used as a second factor of verification in two-factor authentication. 32 | See this article 33 | for details on setting up this ASP.NET application to support two-factor authentication using SMS. 34 |

35 | @*@(Model.PhoneNumber ?? "None") 36 | @if (Model.PhoneNumber != null) 37 | { 38 |
39 | [  Change  ] 40 |
41 | [] 42 |
43 | } 44 | else 45 | { 46 | [  Add  ] 47 | }*@ 48 |
49 | 50 |
Two-Factor Authentication:
51 |
52 |

53 | There are no two-factor authentication providers configured. See this article 54 | for setting up this application to support two-factor authentication. 55 |

56 | @*@if (Model.TwoFactor) 57 | { 58 |
59 | Enabled [] 60 |
61 | } 62 | else 63 | { 64 |
65 | [] Disabled 66 |
67 | }*@ 68 |
69 |
70 |
71 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Manage/ManageLogins.cshtml: -------------------------------------------------------------------------------- 1 | @model ManageLoginsViewModel 2 | @using Microsoft.AspNetCore.Http.Authentication 3 | @{ 4 | ViewData["Title"] = "Manage your external logins"; 5 | } 6 | 7 |

@ViewData["Title"].

8 | 9 |

@ViewData["StatusMessage"]

10 | @if (Model.CurrentLogins.Count > 0) 11 | { 12 |

Registered Logins

13 | 14 | 15 | @foreach (var account in Model.CurrentLogins) 16 | { 17 | 18 | 19 | 35 | 36 | } 37 | 38 |
@account.LoginProvider 20 | @if ((bool)ViewData["ShowRemoveButton"]) 21 | { 22 |
23 |
24 | 25 | 26 | 27 |
28 |
29 | } 30 | else 31 | { 32 | @:   33 | } 34 |
39 | } 40 | @if (Model.OtherLogins.Count > 0) 41 | { 42 |

Add another service to log in.

43 |
44 |
45 |
46 |

47 | @foreach (var provider in Model.OtherLogins) 48 | { 49 | 50 | } 51 |

52 |
53 |
54 | } 55 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Manage/SetPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model SetPasswordViewModel 2 | @{ 3 | ViewData["Title"] = "Set Password"; 4 | } 5 | 6 |

7 | You do not have a local username/password for this site. Add a local 8 | account so you can log in without an external login. 9 |

10 | 11 |
12 |

Set your password

13 |
14 |
15 |
16 | 17 |
18 | 19 | 20 |
21 |
22 |
23 | 24 |
25 | 26 | 27 |
28 |
29 |
30 |
31 | 32 |
33 |
34 |
35 | 36 | @section Scripts { 37 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 38 | } 39 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Manage/VerifyPhoneNumber.cshtml: -------------------------------------------------------------------------------- 1 | @model VerifyPhoneNumberViewModel 2 | @{ 3 | ViewData["Title"] = "Verify Phone Number"; 4 | } 5 | 6 |

@ViewData["Title"].

7 | 8 |
9 | 10 |

Add a phone number.

11 |
@ViewData["Status"]
12 |
13 |
14 |
15 | 16 |
17 | 18 | 19 |
20 |
21 |
22 |
23 | 24 |
25 |
26 |
27 | 28 | @section Scripts { 29 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 30 | } 31 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Error"; 3 | } 4 | 5 |

Error.

6 |

An error occurred while processing your request.

7 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - RC1toRC2 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | @Html.ApplicationInsightsJavaScript(TelemetryConfiguration) 19 | 20 | 21 | 42 |
43 | @RenderBody() 44 |
45 |
46 |

© 2016 - RC1toRC2

47 |
48 |
49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 60 | 64 | 65 | 66 | 67 | @RenderSection("scripts", required: false) 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Security.Claims 2 | 3 | @inject SignInManager SignInManager 4 | @inject UserManager UserManager 5 | 6 | @if (SignInManager.IsSignedIn(User)) 7 | { 8 | 18 | } 19 | else 20 | { 21 | 25 | } 26 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using RC1toRC2 2 | @using RC1toRC2.Models 3 | @using RC1toRC2.ViewModels.Account 4 | @using RC1toRC2.ViewModels.Manage 5 | @using Microsoft.AspNetCore.Identity 6 | @addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" 7 | @inject Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration TelemetryConfiguration 8 | -------------------------------------------------------------------------------- /src/RC1toRC2/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /src/RC1toRC2/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApplicationInsights": { 3 | "InstrumentationKey": "" 4 | }, 5 | "Data": { 6 | "DefaultConnection": { 7 | "ConnectionString": "Server=(localdb)\\mssqllocaldb;Database=aspnet5-RC1toRC2-b999cc38-9bd9-4ee9-9077-1c19a775b496;Trusted_Connection=True;MultipleActiveResultSets=true" 8 | } 9 | }, 10 | "Logging": { 11 | "IncludeScopes": false, 12 | "LogLevel": { 13 | "Default": "Debug", 14 | "System": "Information", 15 | "Microsoft": "Information" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/RC1toRC2/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ASP.NET", 3 | "private": true, 4 | "dependencies": { 5 | "bootstrap": "3.3.5", 6 | "jquery": "2.1.4", 7 | "jquery-validation": "1.14.0", 8 | "jquery-validation-unobtrusive": "3.2.4" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/RC1toRC2/gulpfile.js: -------------------------------------------------------------------------------- 1 | /// 2 | "use strict"; 3 | 4 | var gulp = require("gulp"), 5 | rimraf = require("rimraf"), 6 | concat = require("gulp-concat"), 7 | cssmin = require("gulp-cssmin"), 8 | uglify = require("gulp-uglify"); 9 | 10 | var paths = { 11 | webroot: "./wwwroot/" 12 | }; 13 | 14 | paths.js = paths.webroot + "js/**/*.js"; 15 | paths.minJs = paths.webroot + "js/**/*.min.js"; 16 | paths.css = paths.webroot + "css/**/*.css"; 17 | paths.minCss = paths.webroot + "css/**/*.min.css"; 18 | paths.concatJsDest = paths.webroot + "js/site.min.js"; 19 | paths.concatCssDest = paths.webroot + "css/site.min.css"; 20 | 21 | gulp.task("clean:js", function (cb) { 22 | rimraf(paths.concatJsDest, cb); 23 | }); 24 | 25 | gulp.task("clean:css", function (cb) { 26 | rimraf(paths.concatCssDest, cb); 27 | }); 28 | 29 | gulp.task("clean", ["clean:js", "clean:css"]); 30 | 31 | gulp.task("min:js", function () { 32 | return gulp.src([paths.js, "!" + paths.minJs], { base: "." }) 33 | .pipe(concat(paths.concatJsDest)) 34 | .pipe(uglify()) 35 | .pipe(gulp.dest(".")); 36 | }); 37 | 38 | gulp.task("min:css", function () { 39 | return gulp.src([paths.css, "!" + paths.minCss]) 40 | .pipe(concat(paths.concatCssDest)) 41 | .pipe(cssmin()) 42 | .pipe(gulp.dest(".")); 43 | }); 44 | 45 | gulp.task("min", ["min:js", "min:css"]); 46 | -------------------------------------------------------------------------------- /src/RC1toRC2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ASP.NET", 3 | "version": "0.0.0", 4 | "devDependencies": { 5 | "gulp": "3.8.11", 6 | "gulp-concat": "2.5.2", 7 | "gulp-cssmin": "0.1.7", 8 | "gulp-uglify": "1.2.0", 9 | "rimraf": "2.2.8" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/RC1toRC2/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "userSecretsId": "aspnet5-rc2toRC2-b999cc38-9bd9-4ee9-9077-1c19a775b496", 3 | "version": "1.0.0-*", 4 | "buildOptions": { 5 | "emitEntryPoint": true, 6 | "preserveCompilationContext": true 7 | }, 8 | 9 | "dependencies": { 10 | "Microsoft.NETCore.App": { 11 | "version": "1.0.0-rc2-3002702", 12 | "type": "platform" 13 | }, 14 | "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-final", 15 | "Microsoft.ApplicationInsights.AspNetCore": "1.0.0-rc2-final", 16 | "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-rc2-final", 17 | "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0-rc2-final", 18 | "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-rc2-final", 19 | "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final", 20 | "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final", 21 | "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-rc2-final", 22 | "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final", 23 | "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final", 24 | "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-rc2-final", 25 | "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final", 26 | "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc2-final", 27 | "Microsoft.Extensions.Logging": "1.0.0-rc2-final", 28 | "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", 29 | "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final", 30 | "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc2-final", 31 | "Microsoft.AspNetCore.Razor.Tools": { 32 | "version": "1.0.0-preview1-final", 33 | "type": "build" 34 | }, 35 | "Microsoft.EntityFrameworkCore.Tools": { 36 | "version": "1.0.0-preview1-final", 37 | "type": "build" 38 | }, 39 | "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { 40 | "version": "1.0.0-preview1-final", 41 | "type": "build" 42 | }, 43 | "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { 44 | "version": "1.0.0-preview1-final", 45 | "type": "build" 46 | }, 47 | "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final", 48 | "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final" 49 | }, 50 | 51 | "tools": { 52 | "Microsoft.AspNetCore.Razor.Tools": { 53 | "version": "1.0.0-preview1-final", 54 | "imports": "portable-net45+win8+dnxcore50" 55 | }, 56 | "Microsoft.AspNetCore.Server.IISIntegration.Tools": { 57 | "version": "1.0.0-preview1-final", 58 | "imports": "portable-net45+win8+dnxcore50" 59 | }, 60 | "Microsoft.EntityFrameworkCore.Tools": { 61 | "version": "1.0.0-preview1-final", 62 | "imports": [ 63 | "portable-net45+win8+dnxcore50", 64 | "portable-net45+win8" 65 | ] 66 | }, 67 | "Microsoft.Extensions.SecretManager.Tools": { 68 | "version": "1.0.0-preview1-final", 69 | "imports": "portable-net45+win8+dnxcore50" 70 | }, 71 | "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { 72 | "version": "1.0.0-preview1-final", 73 | "imports": [ 74 | "portable-net45+win8+dnxcore50", 75 | "portable-net45+win8" 76 | ] 77 | } 78 | 79 | }, 80 | 81 | "frameworks": { 82 | "netcoreapp1.0": { 83 | "imports": [ 84 | "dotnet5.6", 85 | "dnxcore50", 86 | "portable-net45+win8" 87 | ] 88 | } 89 | //"net452": { } 90 | }, 91 | 92 | "runtimeOptions": { 93 | "gcServer": true 94 | }, 95 | 96 | "publishOptions": { 97 | "include": [ 98 | "wwwroot", 99 | "Views", 100 | "appsettings.json", 101 | "web.config" 102 | ] 103 | }, 104 | 105 | "scripts": { 106 | "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ] 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /src/RC1toRC2/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | /// 8 | -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Wrapping element */ 7 | /* Set some basic padding to keep content from hitting the edges */ 8 | .body-content { 9 | padding-left: 15px; 10 | padding-right: 15px; 11 | } 12 | 13 | /* Set widths on the form inputs since otherwise they're 100% wide */ 14 | input, 15 | select, 16 | textarea { 17 | max-width: 280px; 18 | } 19 | 20 | /* Carousel */ 21 | .carousel-caption { 22 | z-index: 10 !important; 23 | } 24 | 25 | .carousel-caption p { 26 | font-size: 20px; 27 | line-height: 1.4; 28 | } 29 | 30 | @media (min-width: 768px) { 31 | .carousel-caption { 32 | z-index: 10 !important; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shawnwildermuth/ASPNETCoreRC1ToRC2/a0156c8882259442df2d2b114dd5b43145044b86/src/RC1toRC2/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/images/ASP-NET-Banners-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shawnwildermuth/ASPNETCoreRC1ToRC2/a0156c8882259442df2d2b114dd5b43145044b86/src/RC1toRC2/wwwroot/images/ASP-NET-Banners-01.png -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/images/ASP-NET-Banners-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shawnwildermuth/ASPNETCoreRC1ToRC2/a0156c8882259442df2d2b114dd5b43145044b86/src/RC1toRC2/wwwroot/images/ASP-NET-Banners-02.png -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/images/Banner-01-Azure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shawnwildermuth/ASPNETCoreRC1ToRC2/a0156c8882259442df2d2b114dd5b43145044b86/src/RC1toRC2/wwwroot/images/Banner-01-Azure.png -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/images/Banner-02-VS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shawnwildermuth/ASPNETCoreRC1ToRC2/a0156c8882259442df2d2b114dd5b43145044b86/src/RC1toRC2/wwwroot/images/Banner-02-VS.png -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your Javascript code. 2 | -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": ">= 1.9.1" 33 | }, 34 | "version": "3.3.5", 35 | "_release": "3.3.5", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.5", 39 | "commit": "16b48259a62f576e52c903c476bd42b90ab22482" 40 | }, 41 | "_source": "git://github.com/twbs/bootstrap.git", 42 | "_target": "3.3.5", 43 | "_originalSource": "bootstrap" 44 | } -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2015 Twitter, Inc 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shawnwildermuth/ASPNETCoreRC1ToRC2/a0156c8882259442df2d2b114dd5b43145044b86/src/RC1toRC2/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shawnwildermuth/ASPNETCoreRC1ToRC2/a0156c8882259442df2d2b114dd5b43145044b86/src/RC1toRC2/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shawnwildermuth/ASPNETCoreRC1ToRC2/a0156c8882259442df2d2b114dd5b43145044b86/src/RC1toRC2/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shawnwildermuth/ASPNETCoreRC1ToRC2/a0156c8882259442df2d2b114dd5b43145044b86/src/RC1toRC2/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "version": "3.2.4", 4 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 5 | "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.", 6 | "main": [ 7 | "jquery.validate.unobtrusive.js" 8 | ], 9 | "ignore": [ 10 | "**/.*", 11 | "*.json", 12 | "*.md", 13 | "*.txt", 14 | "gulpfile.js" 15 | ], 16 | "keywords": [ 17 | "jquery", 18 | "asp.net", 19 | "mvc", 20 | "validation", 21 | "unobtrusive" 22 | ], 23 | "authors": [ 24 | "Microsoft" 25 | ], 26 | "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm", 27 | "repository": { 28 | "type": "git", 29 | "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git" 30 | }, 31 | "dependencies": { 32 | "jquery-validation": ">=1.8", 33 | "jquery": ">=1.8" 34 | }, 35 | "_release": "3.2.4", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.2.4", 39 | "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7" 40 | }, 41 | "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git", 42 | "_target": "3.2.4", 43 | "_originalSource": "jquery-validation-unobtrusive" 44 | } -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | ** Unobtrusive validation support library for jQuery and jQuery Validate 3 | ** Copyright (C) Microsoft Corporation. All rights reserved. 4 | */ 5 | 6 | /*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */ 7 | /*global document: false, jQuery: false */ 8 | 9 | (function ($) { 10 | var $jQval = $.validator, 11 | adapters, 12 | data_validation = "unobtrusiveValidation"; 13 | 14 | function setValidationValues(options, ruleName, value) { 15 | options.rules[ruleName] = value; 16 | if (options.message) { 17 | options.messages[ruleName] = options.message; 18 | } 19 | } 20 | 21 | function splitAndTrim(value) { 22 | return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g); 23 | } 24 | 25 | function escapeAttributeValue(value) { 26 | // As mentioned on http://api.jquery.com/category/selectors/ 27 | return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1"); 28 | } 29 | 30 | function getModelPrefix(fieldName) { 31 | return fieldName.substr(0, fieldName.lastIndexOf(".") + 1); 32 | } 33 | 34 | function appendModelPrefix(value, prefix) { 35 | if (value.indexOf("*.") === 0) { 36 | value = value.replace("*.", prefix); 37 | } 38 | return value; 39 | } 40 | 41 | function onError(error, inputElement) { // 'this' is the form element 42 | var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"), 43 | replaceAttrValue = container.attr("data-valmsg-replace"), 44 | replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null; 45 | 46 | container.removeClass("field-validation-valid").addClass("field-validation-error"); 47 | error.data("unobtrusiveContainer", container); 48 | 49 | if (replace) { 50 | container.empty(); 51 | error.removeClass("input-validation-error").appendTo(container); 52 | } 53 | else { 54 | error.hide(); 55 | } 56 | } 57 | 58 | function onErrors(event, validator) { // 'this' is the form element 59 | var container = $(this).find("[data-valmsg-summary=true]"), 60 | list = container.find("ul"); 61 | 62 | if (list && list.length && validator.errorList.length) { 63 | list.empty(); 64 | container.addClass("validation-summary-errors").removeClass("validation-summary-valid"); 65 | 66 | $.each(validator.errorList, function () { 67 | $("
  • ").html(this.message).appendTo(list); 68 | }); 69 | } 70 | } 71 | 72 | function onSuccess(error) { // 'this' is the form element 73 | var container = error.data("unobtrusiveContainer"); 74 | 75 | if (container) { 76 | var replaceAttrValue = container.attr("data-valmsg-replace"), 77 | replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null; 78 | 79 | container.addClass("field-validation-valid").removeClass("field-validation-error"); 80 | error.removeData("unobtrusiveContainer"); 81 | 82 | if (replace) { 83 | container.empty(); 84 | } 85 | } 86 | } 87 | 88 | function onReset(event) { // 'this' is the form element 89 | var $form = $(this), 90 | key = '__jquery_unobtrusive_validation_form_reset'; 91 | if ($form.data(key)) { 92 | return; 93 | } 94 | // Set a flag that indicates we're currently resetting the form. 95 | $form.data(key, true); 96 | try { 97 | $form.data("validator").resetForm(); 98 | } finally { 99 | $form.removeData(key); 100 | } 101 | 102 | $form.find(".validation-summary-errors") 103 | .addClass("validation-summary-valid") 104 | .removeClass("validation-summary-errors"); 105 | $form.find(".field-validation-error") 106 | .addClass("field-validation-valid") 107 | .removeClass("field-validation-error") 108 | .removeData("unobtrusiveContainer") 109 | .find(">*") // If we were using valmsg-replace, get the underlying error 110 | .removeData("unobtrusiveContainer"); 111 | } 112 | 113 | function validationInfo(form) { 114 | var $form = $(form), 115 | result = $form.data(data_validation), 116 | onResetProxy = $.proxy(onReset, form), 117 | defaultOptions = $jQval.unobtrusive.options || {}, 118 | execInContext = function (name, args) { 119 | var func = defaultOptions[name]; 120 | func && $.isFunction(func) && func.apply(form, args); 121 | } 122 | 123 | if (!result) { 124 | result = { 125 | options: { // options structure passed to jQuery Validate's validate() method 126 | errorClass: defaultOptions.errorClass || "input-validation-error", 127 | errorElement: defaultOptions.errorElement || "span", 128 | errorPlacement: function () { 129 | onError.apply(form, arguments); 130 | execInContext("errorPlacement", arguments); 131 | }, 132 | invalidHandler: function () { 133 | onErrors.apply(form, arguments); 134 | execInContext("invalidHandler", arguments); 135 | }, 136 | messages: {}, 137 | rules: {}, 138 | success: function () { 139 | onSuccess.apply(form, arguments); 140 | execInContext("success", arguments); 141 | } 142 | }, 143 | attachValidation: function () { 144 | $form 145 | .off("reset." + data_validation, onResetProxy) 146 | .on("reset." + data_validation, onResetProxy) 147 | .validate(this.options); 148 | }, 149 | validate: function () { // a validation function that is called by unobtrusive Ajax 150 | $form.validate(); 151 | return $form.valid(); 152 | } 153 | }; 154 | $form.data(data_validation, result); 155 | } 156 | 157 | return result; 158 | } 159 | 160 | $jQval.unobtrusive = { 161 | adapters: [], 162 | 163 | parseElement: function (element, skipAttach) { 164 | /// 165 | /// Parses a single HTML element for unobtrusive validation attributes. 166 | /// 167 | /// The HTML element to be parsed. 168 | /// [Optional] true to skip attaching the 169 | /// validation to the form. If parsing just this single element, you should specify true. 170 | /// If parsing several elements, you should specify false, and manually attach the validation 171 | /// to the form when you are finished. The default is false. 172 | var $element = $(element), 173 | form = $element.parents("form")[0], 174 | valInfo, rules, messages; 175 | 176 | if (!form) { // Cannot do client-side validation without a form 177 | return; 178 | } 179 | 180 | valInfo = validationInfo(form); 181 | valInfo.options.rules[element.name] = rules = {}; 182 | valInfo.options.messages[element.name] = messages = {}; 183 | 184 | $.each(this.adapters, function () { 185 | var prefix = "data-val-" + this.name, 186 | message = $element.attr(prefix), 187 | paramValues = {}; 188 | 189 | if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy) 190 | prefix += "-"; 191 | 192 | $.each(this.params, function () { 193 | paramValues[this] = $element.attr(prefix + this); 194 | }); 195 | 196 | this.adapt({ 197 | element: element, 198 | form: form, 199 | message: message, 200 | params: paramValues, 201 | rules: rules, 202 | messages: messages 203 | }); 204 | } 205 | }); 206 | 207 | $.extend(rules, { "__dummy__": true }); 208 | 209 | if (!skipAttach) { 210 | valInfo.attachValidation(); 211 | } 212 | }, 213 | 214 | parse: function (selector) { 215 | /// 216 | /// Parses all the HTML elements in the specified selector. It looks for input elements decorated 217 | /// with the [data-val=true] attribute value and enables validation according to the data-val-* 218 | /// attribute values. 219 | /// 220 | /// Any valid jQuery selector. 221 | 222 | // $forms includes all forms in selector's DOM hierarchy (parent, children and self) that have at least one 223 | // element with data-val=true 224 | var $selector = $(selector), 225 | $forms = $selector.parents() 226 | .addBack() 227 | .filter("form") 228 | .add($selector.find("form")) 229 | .has("[data-val=true]"); 230 | 231 | $selector.find("[data-val=true]").each(function () { 232 | $jQval.unobtrusive.parseElement(this, true); 233 | }); 234 | 235 | $forms.each(function () { 236 | var info = validationInfo(this); 237 | if (info) { 238 | info.attachValidation(); 239 | } 240 | }); 241 | } 242 | }; 243 | 244 | adapters = $jQval.unobtrusive.adapters; 245 | 246 | adapters.add = function (adapterName, params, fn) { 247 | /// Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation. 248 | /// The name of the adapter to be added. This matches the name used 249 | /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name). 250 | /// [Optional] An array of parameter names (strings) that will 251 | /// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and 252 | /// mmmm is the parameter name). 253 | /// The function to call, which adapts the values from the HTML 254 | /// attributes into jQuery Validate rules and/or messages. 255 | /// 256 | if (!fn) { // Called with no params, just a function 257 | fn = params; 258 | params = []; 259 | } 260 | this.push({ name: adapterName, params: params, adapt: fn }); 261 | return this; 262 | }; 263 | 264 | adapters.addBool = function (adapterName, ruleName) { 265 | /// Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where 266 | /// the jQuery Validate validation rule has no parameter values. 267 | /// The name of the adapter to be added. This matches the name used 268 | /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name). 269 | /// [Optional] The name of the jQuery Validate rule. If not provided, the value 270 | /// of adapterName will be used instead. 271 | /// 272 | return this.add(adapterName, function (options) { 273 | setValidationValues(options, ruleName || adapterName, true); 274 | }); 275 | }; 276 | 277 | adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) { 278 | /// Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where 279 | /// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and 280 | /// one for min-and-max). The HTML parameters are expected to be named -min and -max. 281 | /// The name of the adapter to be added. This matches the name used 282 | /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name). 283 | /// The name of the jQuery Validate rule to be used when you only 284 | /// have a minimum value. 285 | /// The name of the jQuery Validate rule to be used when you only 286 | /// have a maximum value. 287 | /// The name of the jQuery Validate rule to be used when you 288 | /// have both a minimum and maximum value. 289 | /// [Optional] The name of the HTML attribute that 290 | /// contains the minimum value. The default is "min". 291 | /// [Optional] The name of the HTML attribute that 292 | /// contains the maximum value. The default is "max". 293 | /// 294 | return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) { 295 | var min = options.params.min, 296 | max = options.params.max; 297 | 298 | if (min && max) { 299 | setValidationValues(options, minMaxRuleName, [min, max]); 300 | } 301 | else if (min) { 302 | setValidationValues(options, minRuleName, min); 303 | } 304 | else if (max) { 305 | setValidationValues(options, maxRuleName, max); 306 | } 307 | }); 308 | }; 309 | 310 | adapters.addSingleVal = function (adapterName, attribute, ruleName) { 311 | /// Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where 312 | /// the jQuery Validate validation rule has a single value. 313 | /// The name of the adapter to be added. This matches the name used 314 | /// in the data-val-nnnn HTML attribute(where nnnn is the adapter name). 315 | /// [Optional] The name of the HTML attribute that contains the value. 316 | /// The default is "val". 317 | /// [Optional] The name of the jQuery Validate rule. If not provided, the value 318 | /// of adapterName will be used instead. 319 | /// 320 | return this.add(adapterName, [attribute || "val"], function (options) { 321 | setValidationValues(options, ruleName || adapterName, options.params[attribute]); 322 | }); 323 | }; 324 | 325 | $jQval.addMethod("__dummy__", function (value, element, params) { 326 | return true; 327 | }); 328 | 329 | $jQval.addMethod("regex", function (value, element, params) { 330 | var match; 331 | if (this.optional(element)) { 332 | return true; 333 | } 334 | 335 | match = new RegExp(params).exec(value); 336 | return (match && (match.index === 0) && (match[0].length === value.length)); 337 | }); 338 | 339 | $jQval.addMethod("nonalphamin", function (value, element, nonalphamin) { 340 | var match; 341 | if (nonalphamin) { 342 | match = value.match(/\W/g); 343 | match = match && match.length >= nonalphamin; 344 | } 345 | return match; 346 | }); 347 | 348 | if ($jQval.methods.extension) { 349 | adapters.addSingleVal("accept", "mimtype"); 350 | adapters.addSingleVal("extension", "extension"); 351 | } else { 352 | // for backward compatibility, when the 'extension' validation method does not exist, such as with versions 353 | // of JQuery Validation plugin prior to 1.10, we should use the 'accept' method for 354 | // validating the extension, and ignore mime-type validations as they are not supported. 355 | adapters.addSingleVal("extension", "extension", "accept"); 356 | } 357 | 358 | adapters.addSingleVal("regex", "pattern"); 359 | adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"); 360 | adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range"); 361 | adapters.addMinMax("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength"); 362 | adapters.add("equalto", ["other"], function (options) { 363 | var prefix = getModelPrefix(options.element.name), 364 | other = options.params.other, 365 | fullOtherName = appendModelPrefix(other, prefix), 366 | element = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0]; 367 | 368 | setValidationValues(options, "equalTo", element); 369 | }); 370 | adapters.add("required", function (options) { 371 | // jQuery Validate equates "required" with "mandatory" for checkbox elements 372 | if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") { 373 | setValidationValues(options, "required", true); 374 | } 375 | }); 376 | adapters.add("remote", ["url", "type", "additionalfields"], function (options) { 377 | var value = { 378 | url: options.params.url, 379 | type: options.params.type || "GET", 380 | data: {} 381 | }, 382 | prefix = getModelPrefix(options.element.name); 383 | 384 | $.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) { 385 | var paramName = appendModelPrefix(fieldName, prefix); 386 | value.data[paramName] = function () { 387 | var field = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']"); 388 | // For checkboxes and radio buttons, only pick up values from checked fields. 389 | if (field.is(":checkbox")) { 390 | return field.filter(":checked").val() || field.filter(":hidden").val() || ''; 391 | } 392 | else if (field.is(":radio")) { 393 | return field.filter(":checked").val() || ''; 394 | } 395 | return field.val(); 396 | }; 397 | }); 398 | 399 | setValidationValues(options, "remote", value); 400 | }); 401 | adapters.add("password", ["min", "nonalphamin", "regex"], function (options) { 402 | if (options.params.min) { 403 | setValidationValues(options, "minlength", options.params.min); 404 | } 405 | if (options.params.nonalphamin) { 406 | setValidationValues(options, "nonalphamin", options.params.nonalphamin); 407 | } 408 | if (options.params.regex) { 409 | setValidationValues(options, "regex", options.params.regex); 410 | } 411 | }); 412 | 413 | $(function () { 414 | $jQval.unobtrusive.parse(document); 415 | }); 416 | }(jQuery)); -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** Unobtrusive validation support library for jQuery and jQuery Validate 3 | ** Copyright (C) Microsoft Corporation. All rights reserved. 4 | */ 5 | !function(a){function e(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function n(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function t(a){return a.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function r(a){return a.substr(0,a.lastIndexOf(".")+1)}function i(a,e){return 0===a.indexOf("*.")&&(a=a.replace("*.",e)),a}function o(e,n){var r=a(this).find("[data-valmsg-for='"+t(n[0].name)+"']"),i=r.attr("data-valmsg-replace"),o=i?a.parseJSON(i)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error"),e.data("unobtrusiveContainer",r),o?(r.empty(),e.removeClass("input-validation-error").appendTo(r)):e.hide()}function d(e,n){var t=a(this).find("[data-valmsg-summary=true]"),r=t.find("ul");r&&r.length&&n.errorList.length&&(r.empty(),t.addClass("validation-summary-errors").removeClass("validation-summary-valid"),a.each(n.errorList,function(){a("
  • ").html(this.message).appendTo(r)}))}function s(e){var n=e.data("unobtrusiveContainer");if(n){var t=n.attr("data-valmsg-replace"),r=t?a.parseJSON(t):null;n.addClass("field-validation-valid").removeClass("field-validation-error"),e.removeData("unobtrusiveContainer"),r&&n.empty()}}function l(e){var n=a(this),t="__jquery_unobtrusive_validation_form_reset";if(!n.data(t)){n.data(t,!0);try{n.data("validator").resetForm()}finally{n.removeData(t)}n.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function m(e){var n=a(e),t=n.data(v),r=a.proxy(l,e),i=p.unobtrusive.options||{},m=function(n,t){var r=i[n];r&&a.isFunction(r)&&r.apply(e,t)};return t||(t={options:{errorClass:i.errorClass||"input-validation-error",errorElement:i.errorElement||"span",errorPlacement:function(){o.apply(e,arguments),m("errorPlacement",arguments)},invalidHandler:function(){d.apply(e,arguments),m("invalidHandler",arguments)},messages:{},rules:{},success:function(){s.apply(e,arguments),m("success",arguments)}},attachValidation:function(){n.off("reset."+v,r).on("reset."+v,r).validate(this.options)},validate:function(){return n.validate(),n.valid()}},n.data(v,t)),t}var u,p=a.validator,v="unobtrusiveValidation";p.unobtrusive={adapters:[],parseElement:function(e,n){var t,r,i,o=a(e),d=o.parents("form")[0];d&&(t=m(d),t.options.rules[e.name]=r={},t.options.messages[e.name]=i={},a.each(this.adapters,function(){var n="data-val-"+this.name,t=o.attr(n),s={};void 0!==t&&(n+="-",a.each(this.params,function(){s[this]=o.attr(n+this)}),this.adapt({element:e,form:d,message:t,params:s,rules:r,messages:i}))}),a.extend(r,{__dummy__:!0}),n||t.attachValidation())},parse:function(e){var n=a(e),t=n.parents().addBack().filter("form").add(n.find("form")).has("[data-val=true]");n.find("[data-val=true]").each(function(){p.unobtrusive.parseElement(this,!0)}),t.each(function(){var a=m(this);a&&a.attachValidation()})}},u=p.unobtrusive.adapters,u.add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},u.addBool=function(a,n){return this.add(a,function(t){e(t,n||a,!0)})},u.addMinMax=function(a,n,t,r,i,o){return this.add(a,[i||"min",o||"max"],function(a){var i=a.params.min,o=a.params.max;i&&o?e(a,r,[i,o]):i?e(a,n,i):o&&e(a,t,o)})},u.addSingleVal=function(a,n,t){return this.add(a,[n||"val"],function(r){e(r,t||a,r.params[n])})},p.addMethod("__dummy__",function(a,e,n){return!0}),p.addMethod("regex",function(a,e,n){var t;return this.optional(e)?!0:(t=new RegExp(n).exec(a),t&&0===t.index&&t[0].length===a.length)}),p.addMethod("nonalphamin",function(a,e,n){var t;return n&&(t=a.match(/\W/g),t=t&&t.length>=n),t}),p.methods.extension?(u.addSingleVal("accept","mimtype"),u.addSingleVal("extension","extension")):u.addSingleVal("extension","extension","accept"),u.addSingleVal("regex","pattern"),u.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),u.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),u.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),u.add("equalto",["other"],function(n){var o=r(n.element.name),d=n.params.other,s=i(d,o),l=a(n.form).find(":input").filter("[name='"+t(s)+"']")[0];e(n,"equalTo",l)}),u.add("required",function(a){("INPUT"!==a.element.tagName.toUpperCase()||"CHECKBOX"!==a.element.type.toUpperCase())&&e(a,"required",!0)}),u.add("remote",["url","type","additionalfields"],function(o){var d={url:o.params.url,type:o.params.type||"GET",data:{}},s=r(o.element.name);a.each(n(o.params.additionalfields||o.element.name),function(e,n){var r=i(n,s);d.data[r]=function(){var e=a(o.form).find(":input").filter("[name='"+t(r)+"']");return e.is(":checkbox")?e.filter(":checked").val()||e.filter(":hidden").val()||"":e.is(":radio")?e.filter(":checked").val()||"":e.val()}}),e(o,"remote",d)}),u.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&e(a,"minlength",a.params.min),a.params.nonalphamin&&e(a,"nonalphamin",a.params.nonalphamin),a.params.regex&&e(a,"regex",a.params.regex)}),a(function(){p.unobtrusive.parse(document)})}(jQuery); -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "http://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jzaefferer/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.14.0", 31 | "_release": "1.14.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.14.0", 35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48" 36 | }, 37 | "_source": "git://github.com/jzaefferer/jquery-validation.git", 38 | "_target": ">=1.8", 39 | "_originalSource": "jquery-validation" 40 | } -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/lib/jquery-validation/dist/additional-methods.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 2 | * http://jqueryvalidation.org/ 3 | * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ 4 | !function(a){"function"==typeof define&&define.amd?define(["jquery","./jquery.validate.min"],a):a(jQuery)}(function(a){!function(){function b(a){return a.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}a.validator.addMethod("maxWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length<=d},a.validator.format("Please enter {0} words or less.")),a.validator.addMethod("minWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length>=d},a.validator.format("Please enter at least {0} words.")),a.validator.addMethod("rangeWords",function(a,c,d){var e=b(a),f=/\b\w+\b/g;return this.optional(c)||e.match(f).length>=d[0]&&e.match(f).length<=d[1]},a.validator.format("Please enter between {0} and {1} words."))}(),a.validator.addMethod("accept",function(b,c,d){var e,f,g="string"==typeof d?d.replace(/\s/g,"").replace(/,/g,"|"):"image/*",h=this.optional(c);if(h)return h;if("file"===a(c).attr("type")&&(g=g.replace(/\*/g,".*"),c.files&&c.files.length))for(e=0;ec;c++)d=h-c,e=f.substring(c,c+1),g+=d*e;return g%11===0},"Please specify a valid bank account number"),a.validator.addMethod("bankorgiroaccountNL",function(b,c){return this.optional(c)||a.validator.methods.bankaccountNL.call(this,b,c)||a.validator.methods.giroaccountNL.call(this,b,c)},"Please specify a valid bank or giro account number"),a.validator.addMethod("bic",function(a,b){return this.optional(b)||/^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(a)},"Please specify a valid BIC code"),a.validator.addMethod("cifES",function(a){"use strict";var b,c,d,e,f,g,h=[];if(a=a.toUpperCase(),!a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)"))return!1;for(d=0;9>d;d++)h[d]=parseInt(a.charAt(d),10);for(c=h[2]+h[4]+h[6],e=1;8>e;e+=2)f=(2*h[e]).toString(),g=f.charAt(1),c+=parseInt(f.charAt(0),10)+(""===g?0:parseInt(g,10));return/^[ABCDEFGHJNPQRSUVW]{1}/.test(a)?(c+="",b=10-parseInt(c.charAt(c.length-1),10),a+=b,h[8].toString()===String.fromCharCode(64+b)||h[8].toString()===a.charAt(a.length-1)):!1},"Please specify a valid CIF number."),a.validator.addMethod("cpfBR",function(a){if(a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,""),11!==a.length)return!1;var b,c,d,e,f=0;if(b=parseInt(a.substring(9,10),10),c=parseInt(a.substring(10,11),10),d=function(a,b){var c=10*a%11;return(10===c||11===c)&&(c=0),c===b},""===a||"00000000000"===a||"11111111111"===a||"22222222222"===a||"33333333333"===a||"44444444444"===a||"55555555555"===a||"66666666666"===a||"77777777777"===a||"88888888888"===a||"99999999999"===a)return!1;for(e=1;9>=e;e++)f+=parseInt(a.substring(e-1,e),10)*(11-e);if(d(f,b)){for(f=0,e=1;10>=e;e++)f+=parseInt(a.substring(e-1,e),10)*(12-e);return d(f,c)}return!1},"Please specify a valid CPF number"),a.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9\-]+/.test(a))return!1;a=a.replace(/\D/g,"");var d=0;return c.mastercard&&(d|=1),c.visa&&(d|=2),c.amex&&(d|=4),c.dinersclub&&(d|=8),c.enroute&&(d|=16),c.discover&&(d|=32),c.jcb&&(d|=64),c.unknown&&(d|=128),c.all&&(d=255),1&d&&/^(5[12345])/.test(a)?16===a.length:2&d&&/^(4)/.test(a)?16===a.length:4&d&&/^(3[47])/.test(a)?15===a.length:8&d&&/^(3(0[012345]|[68]))/.test(a)?14===a.length:16&d&&/^(2(014|149))/.test(a)?15===a.length:32&d&&/^(6011)/.test(a)?16===a.length:64&d&&/^(3)/.test(a)?16===a.length:64&d&&/^(2131|1800)/.test(a)?15===a.length:128&d?!0:!1},"Please enter a valid credit card number."),a.validator.addMethod("currency",function(a,b,c){var d,e="string"==typeof c,f=e?c:c[0],g=e?!0:c[1];return f=f.replace(/,/g,""),f=g?f+"]":f+"]?",d="^["+f+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",d=new RegExp(d),this.optional(b)||d.test(a)},"Please specify a valid currency"),a.validator.addMethod("dateFA",function(a,b){return this.optional(b)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(a)},a.validator.messages.date),a.validator.addMethod("dateITA",function(a,b){var c,d,e,f,g,h=!1,i=/^\d{1,2}\/\d{1,2}\/\d{4}$/;return i.test(a)?(c=a.split("/"),d=parseInt(c[0],10),e=parseInt(c[1],10),f=parseInt(c[2],10),g=new Date(Date.UTC(f,e-1,d,12,0,0,0)),h=g.getUTCFullYear()===f&&g.getUTCMonth()===e-1&&g.getUTCDate()===d?!0:!1):h=!1,this.optional(b)||h},a.validator.messages.date),a.validator.addMethod("dateNL",function(a,b){return this.optional(b)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(a)},a.validator.messages.date),a.validator.addMethod("extension",function(a,b,c){return c="string"==typeof c?c.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(b)||a.match(new RegExp("\\.("+c+")$","i"))},a.validator.format("Please enter a value with a valid extension.")),a.validator.addMethod("giroaccountNL",function(a,b){return this.optional(b)||/^[0-9]{1,7}$/.test(a)},"Please specify a valid giro account number"),a.validator.addMethod("iban",function(a,b){if(this.optional(b))return!0;var c,d,e,f,g,h,i,j,k,l=a.replace(/ /g,"").toUpperCase(),m="",n=!0,o="",p="";if(c=l.substring(0,2),h={AL:"\\d{8}[\\dA-Z]{16}",AD:"\\d{8}[\\dA-Z]{12}",AT:"\\d{16}",AZ:"[\\dA-Z]{4}\\d{20}",BE:"\\d{12}",BH:"[A-Z]{4}[\\dA-Z]{14}",BA:"\\d{16}",BR:"\\d{23}[A-Z][\\dA-Z]",BG:"[A-Z]{4}\\d{6}[\\dA-Z]{8}",CR:"\\d{17}",HR:"\\d{17}",CY:"\\d{8}[\\dA-Z]{16}",CZ:"\\d{20}",DK:"\\d{14}",DO:"[A-Z]{4}\\d{20}",EE:"\\d{16}",FO:"\\d{14}",FI:"\\d{14}",FR:"\\d{10}[\\dA-Z]{11}\\d{2}",GE:"[\\dA-Z]{2}\\d{16}",DE:"\\d{18}",GI:"[A-Z]{4}[\\dA-Z]{15}",GR:"\\d{7}[\\dA-Z]{16}",GL:"\\d{14}",GT:"[\\dA-Z]{4}[\\dA-Z]{20}",HU:"\\d{24}",IS:"\\d{22}",IE:"[\\dA-Z]{4}\\d{14}",IL:"\\d{19}",IT:"[A-Z]\\d{10}[\\dA-Z]{12}",KZ:"\\d{3}[\\dA-Z]{13}",KW:"[A-Z]{4}[\\dA-Z]{22}",LV:"[A-Z]{4}[\\dA-Z]{13}",LB:"\\d{4}[\\dA-Z]{20}",LI:"\\d{5}[\\dA-Z]{12}",LT:"\\d{16}",LU:"\\d{3}[\\dA-Z]{13}",MK:"\\d{3}[\\dA-Z]{10}\\d{2}",MT:"[A-Z]{4}\\d{5}[\\dA-Z]{18}",MR:"\\d{23}",MU:"[A-Z]{4}\\d{19}[A-Z]{3}",MC:"\\d{10}[\\dA-Z]{11}\\d{2}",MD:"[\\dA-Z]{2}\\d{18}",ME:"\\d{18}",NL:"[A-Z]{4}\\d{10}",NO:"\\d{11}",PK:"[\\dA-Z]{4}\\d{16}",PS:"[\\dA-Z]{4}\\d{21}",PL:"\\d{24}",PT:"\\d{21}",RO:"[A-Z]{4}[\\dA-Z]{16}",SM:"[A-Z]\\d{10}[\\dA-Z]{12}",SA:"\\d{2}[\\dA-Z]{18}",RS:"\\d{18}",SK:"\\d{20}",SI:"\\d{15}",ES:"\\d{20}",SE:"\\d{20}",CH:"\\d{5}[\\dA-Z]{12}",TN:"\\d{20}",TR:"\\d{5}[\\dA-Z]{17}",AE:"\\d{3}\\d{16}",GB:"[A-Z]{4}\\d{14}",VG:"[\\dA-Z]{4}\\d{16}"},g=h[c],"undefined"!=typeof g&&(i=new RegExp("^[A-Z]{2}\\d{2}"+g+"$",""),!i.test(l)))return!1;for(d=l.substring(4,l.length)+l.substring(0,4),j=0;j9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number"),a.validator.addMethod("nieES",function(a){"use strict";return a=a.toUpperCase(),a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")?/^[T]{1}/.test(a)?a[8]===/^[T]{1}[A-Z0-9]{8}$/.test(a):/^[XYZ]{1}/.test(a)?a[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.replace("X","0").replace("Y","1").replace("Z","2").substring(0,8)%23):!1:!1},"Please specify a valid NIE number."),a.validator.addMethod("nifES",function(a){"use strict";return a=a.toUpperCase(),a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")?/^[0-9]{8}[A-Z]{1}$/.test(a)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8,0)%23)===a.charAt(8):/^[KLM]{1}/.test(a)?a[8]===String.fromCharCode(64):!1:!1},"Please specify a valid NIF number."),jQuery.validator.addMethod("notEqualTo",function(b,c,d){return this.optional(c)||!a.validator.methods.equalTo.call(this,b,c,d)},"Please enter a different value, values must not be the same."),a.validator.addMethod("nowhitespace",function(a,b){return this.optional(b)||/^\S+$/i.test(a)},"No white space please"),a.validator.addMethod("pattern",function(a,b,c){return this.optional(b)?!0:("string"==typeof c&&(c=new RegExp("^(?:"+c+")$")),c.test(a))},"Invalid format."),a.validator.addMethod("phoneNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid phone number."),a.validator.addMethod("phoneUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number"),a.validator.addMethod("phoneUS",function(a,b){return a=a.replace(/\s+/g,""),this.optional(b)||a.length>9&&a.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/)},"Please specify a valid phone number"),a.validator.addMethod("phonesUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number"),a.validator.addMethod("postalCodeCA",function(a,b){return this.optional(b)||/^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeBR",function(a,b){return this.optional(b)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(a)},"Informe um CEP válido."),a.validator.addMethod("postalcodeIT",function(a,b){return this.optional(b)||/^\d{5}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeNL",function(a,b){return this.optional(b)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postcodeUK",function(a,b){return this.optional(b)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(a)},"Please specify a valid UK postcode"),a.validator.addMethod("require_from_group",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_req_grp")?f.data("valid_req_grp"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length>=d[0];return f.data("valid_req_grp",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),h},a.validator.format("Please fill at least {0} of these fields.")),a.validator.addMethod("skip_or_fill_minimum",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_skip")?f.data("valid_skip"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length,i=0===h||h>=d[0];return f.data("valid_skip",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),i},a.validator.format("Please either skip these fields or fill at least {0} of them.")),a.validator.addMethod("stateUS",function(a,b,c){var d,e="undefined"==typeof c,f=e||"undefined"==typeof c.caseSensitive?!1:c.caseSensitive,g=e||"undefined"==typeof c.includeTerritories?!1:c.includeTerritories,h=e||"undefined"==typeof c.includeMilitary?!1:c.includeMilitary;return d=g||h?g&&h?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":g?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",d=f?new RegExp(d):new RegExp(d,"i"),this.optional(b)||d.test(a)},"Please specify a valid state"),a.validator.addMethod("strippedminlength",function(b,c,d){return a(b).text().length>=d},a.validator.format("Please enter at least {0} characters")),a.validator.addMethod("time",function(a,b){return this.optional(b)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(a)},"Please enter a valid time, between 00:00 and 23:59"),a.validator.addMethod("time12h",function(a,b){return this.optional(b)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(a)},"Please enter a valid time in 12-hour am/pm format"),a.validator.addMethod("url2",function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},a.validator.messages.url),a.validator.addMethod("vinUS",function(a){if(17!==a.length)return!1;var b,c,d,e,f,g,h=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],i=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],j=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],k=0;for(b=0;17>b;b++){if(e=j[b],d=a.slice(b,b+1),8===b&&(g=d),isNaN(d)){for(c=0;c").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),e=c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),void 0!==e?e:!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,d=d.concat(c.errorList)}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){return!!a.trim(""+a(b).val())},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||-1!==a.inArray(c.keyCode,d)||(b.name in this.submitted||b===this.lastElement)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this.form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!a(this).is(e.ignore)&&e[d].call(c,this,b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c=this.clean(b),d=this.validationTargetFor(c),e=!0;return this.lastElement=d,void 0===d?delete this.invalid[c.name]:(this.prepareElement(d),this.currentElements=a(d),e=this.check(d)!==!1,e?delete this.invalid[d.name]:this.invalid[d.name]=!0),a(b).attr("aria-invalid",!e),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),e},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors();var b,c=this.elements().removeData("previousValue").removeAttr("aria-invalid");if(this.settings.unhighlight)for(b=0;c[b];b++)this.settings.unhighlight.call(this,c[b],this.settings.errorClass,"");else c.removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d=a(b),e=b.type;return"radio"===e||"checkbox"===e?this.findByName(b.name).filter(":checked").val():"number"===e&&"undefined"!=typeof b.validity?b.validity.badInput?!1:d.val():(c=d.val(),"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j instanceof TypeError&&(j.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;aWarning: No message defined for "+b.name+"")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b,method:c.method}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g=this.errorsFor(b),h=this.idOrName(b),i=a(b).attr("aria-describedby");g.length?(g.removeClass(this.settings.validClass).addClass(this.settings.errorClass),g.html(c)):(g=a("<"+this.settings.errorElement+">").attr("id",h+"-error").addClass(this.settings.errorClass).html(c||""),d=g,this.settings.wrapper&&(d=g.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b),g.is("label")?g.attr("for",h):0===g.parents("label[for='"+h+"']").length&&(f=g.attr("id").replace(/(:|\.|\[|\]|\$)/g,"\\$1"),i?i.match(new RegExp("\\b"+f+"\\b"))||(i+=" "+f):i=f,a(b).attr("aria-describedby",i),e=this.groups[b.name],e&&a.each(this.groups,function(b,c){c===e&&a("[name='"+b+"']",this.currentForm).attr("aria-describedby",g.attr("id"))}))),!c&&this.settings.success&&(g.text(""),"string"==typeof this.settings.success?g.addClass(this.settings.success):this.settings.success(g,b)),this.toShow=this.toShow.add(g)},errorsFor:function(b){var c=this.idOrName(b),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+d.replace(/\s+/g,", #")),this.errors().filter(e)},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+b+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.off(".validate-equalTo").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e,f,g=this.previousValue(c);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),g.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=g.message,d="string"==typeof d&&{url:d}||d,g.old===b?g.valid:(g.old=b,e=this,this.startRequest(c),f={},f[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:f,context:e.currentForm,success:function(d){var f,h,i,j=d===!0||"true"===d;e.settings.messages[c.name].remote=g.originalMessage,j?(i=e.formSubmitted,e.prepareElement(c),e.formSubmitted=i,e.successList.push(c),delete e.invalid[c.name],e.showErrors()):(f={},h=d||e.defaultMessage(c,"remote"),f[c.name]=g.message=a.isFunction(h)?h(b):h,e.invalid[c.name]=!0,e.showErrors(f)),g.valid=j,e.stopRequest(c,j)}},d)),"pending")}}});var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)})}); -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "version": "2.1.4", 4 | "main": "dist/jquery.js", 5 | "license": "MIT", 6 | "ignore": [ 7 | "**/.*", 8 | "build", 9 | "dist/cdn", 10 | "speed", 11 | "test", 12 | "*.md", 13 | "AUTHORS.txt", 14 | "Gruntfile.js", 15 | "package.json" 16 | ], 17 | "devDependencies": { 18 | "sizzle": "2.1.1-jquery.2.1.2", 19 | "requirejs": "2.1.10", 20 | "qunit": "1.14.0", 21 | "sinon": "1.8.1" 22 | }, 23 | "keywords": [ 24 | "jquery", 25 | "javascript", 26 | "library" 27 | ], 28 | "homepage": "https://github.com/jquery/jquery", 29 | "_release": "2.1.4", 30 | "_resolution": { 31 | "type": "version", 32 | "tag": "2.1.4", 33 | "commit": "7751e69b615c6eca6f783a81e292a55725af6b85" 34 | }, 35 | "_source": "git://github.com/jquery/jquery.git", 36 | "_target": "2.1.4", 37 | "_originalSource": "jquery" 38 | } -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/lib/jquery/MIT-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2014 jQuery Foundation and other contributors 2 | http://jquery.com/ 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/RC1toRC2/wwwroot/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | --------------------------------------------------------------------------------