#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.225
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace System.Web.WebPages.Administration
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Net;
    using System.Web;
    using System.Web.Helpers;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.WebPages;
    using System.Web.WebPages.Html;
    using System.Globalization;
    
    [System.Web.WebPages.PageVirtualPathAttribute("~/Login.cshtml")]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorSingleFileGenerator", "1.0.0.0")]
    public class Login_cshtml : System.Web.WebPages.WebPage
    {
#line hidden

                    // Resolve package relative syntax
                    // Also, if it comes from a static embedded resource, change the path accordingly
                    public override string Href(string virtualPath, params object[] pathParts) {
                        virtualPath = ApplicationPart.ProcessVirtualPath(GetType().Assembly, VirtualPath, virtualPath);
                        return base.Href(virtualPath, pathParts);
                    }
        public Login_cshtml()
        {
        }
        protected System.Web.HttpApplication ApplicationInstance
        {
            get
            {
                return ((System.Web.HttpApplication)(Context.ApplicationInstance));
            }
        }
        public override void Execute()
        {


WriteLiteral("\r\n\r\n");



  
    Page.Title = AdminResources.LoginTitle;

    // No admin password has been registered so redirect
    if(!AdminSecurity.HasAdminPassword()) {
        SiteAdmin.RedirectToRegister(Response);
        return;
    }

    if (IsPost) {
        AntiForgery.Validate();
        var password = Request.Form["password"];

        if (AdminSecurity.CheckPassword(password)) {
            // Get the return url
            var returnUrl = SiteAdmin.GetReturnUrl(Request) ?? SiteAdmin.AdminVirtualPath;

            // Set the admin auth cookie
            AdminSecurity.SetAuthCookie(Response);

            // Redirect to the return url
            Response.Redirect(returnUrl);
        }
        else {
            ModelState.AddError("password", AdminResources.Validation_PasswordIncorrect);
        }
    }


WriteLiteral("\r\n");


DefineSection("Head", () => {

WriteLiteral("\r\n    <script type=\"text/javascript\">\r\n    function showForgotPasswordInfo(){\r\n  " +
"      document.getElementById(\'forgotPasswordInfo\').style.display = \'\';\r\n    }\r\n" +
"    </script>\r\n");


});

WriteLiteral("\r\n\r\n");


Write(Html.ValidationSummary());

WriteLiteral("\r\n<br />\r\n\r\n<form method=\"post\" action=\"\">\r\n    ");


Write(AntiForgery.GetHtml());

WriteLiteral("\r\n    <fieldset>\r\n    <ol>\r\n        <li class=\"password\">\r\n            <label for" +
"=\"password\">");


                             Write(AdminResources.Password);

WriteLiteral(":</label>\r\n            ");


       Write(Html.Password("password"));

WriteLiteral(" ");


                                  Write(Html.ValidationMessage("password", "*"));

WriteLiteral("\r\n    </ol>\r\n    <p class=\"form-actions\">\r\n        <input type=\"submit\" value=\"");


                               Write(AdminResources.Login);

WriteLiteral("\" />\r\n    </p>\r\n    </fieldset>\r\n    <p>\r\n        <a href=\"#\" onclick=\"showForgot" +
"PasswordInfo(); return false;\">");


                                                                 Write(AdminResources.ForgotPassword);

WriteLiteral("</a>\r\n    </p>\r\n</form>\r\n<br />\r\n");


   
    var passwordFileLocation = AdminSecurity.AdminPasswordFile.TrimStart('~', '/');
    var forgotPasswordHelp = String.Format(CultureInfo.CurrentCulture, AdminResources.AdminPasswordChangeInstructions, Html.Encode(passwordFileLocation));


WriteLiteral("<span id=\"forgotPasswordInfo\" style=\"display: none\">");


                                               Write(Html.Raw(forgotPasswordHelp));

WriteLiteral("</span>");


        }
    }
}
#pragma warning restore 1591
