public ActionResult NewPage() { SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); wwBuildInfo.wwBuildInfo wwbi = new wwBuildInfo.wwBuildInfo(); ViewData["VersionNumber"] = wwbi.GetVersion(); ViewData["SoftwareName"] = wwbi.GetName(); DataSet templates = sa.GetTemplates(); ViewData["TemplateHtml"] = ""; foreach (DataRow dr in templates.Tables[0].Rows) { ViewData["TemplateHtml"] = ViewData["TemplateHtml"].ToString() + string.Format(@" <div class='item' data-value='{0}'> <div class='ui tiny header'>{0}</div> <label>{1}</label> </div> ", dr["name"], dr["description"]); } ViewData["SiteName"] = getSiteSettings()["SiteName"]; if (_signInManager.IsSignedIn(User)) { return(View()); } else { return(RedirectToAction("ViewPage", "Page")); } }
public static void Main(string[] args) { SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); if (!sa.IsDBSetup()) { sa.SetupDB(); } CreateWebHostBuilder(args).Build().Run(); }
public ActionResult DeletePageForm(string pageName) { if (_signInManager.IsSignedIn(User)) { SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); sa.DeletePage(pageName); return(RedirectToAction("ViewPage", new { id = "Index" })); } else { return(RedirectToAction("ViewPage", "Page")); } }
public ActionResult DeleteTemplateForm(string templateId) { if (_signInManager.IsSignedIn(User)) { SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); sa.DeleteTemplate(templateId); return(RedirectToAction("ManageTemplates")); } else { return(RedirectToAction("ViewPage", "Page")); } }
public ActionResult NewTemplateForm(string templateName) { if (_signInManager.IsSignedIn(User)) { SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); string templateID = sa.NewTemplate(templateName); return(RedirectToAction("EditTemplate", new { id = templateID })); } else { return(RedirectToAction("ViewPage", "Page")); } }
public ActionResult EditTemplateForm(string templateName, string templateDesc, string HtmlEdit, string CssEdit, string JsEdit, string HeadEdit, string templateId) { if (_signInManager.IsSignedIn(User)) { SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); sa.EditTemplate(templateId, templateName, templateDesc, HtmlEdit, CssEdit, JsEdit, HeadEdit); return(RedirectToAction("ManageTemplates")); } else { return(RedirectToAction("ViewPage", "Page")); } }
public ActionResult NewEmptyPage(string pageName, string saveAsDraft) { if (_signInManager.IsSignedIn(User)) { SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); string newPageName = ((saveAsDraft == "true") ? "Draft|" : "") + pageName; // Create the new page sa.CreateEmptyPage(newPageName); // Send to the page return(RedirectToAction("EditPage", new { id = newPageName })); } else { return(RedirectToAction("ViewPage", "Page")); } }
public ActionResult ManageTemplates() { SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); wwBuildInfo.wwBuildInfo wwbi = new wwBuildInfo.wwBuildInfo(); ViewData["VersionNumber"] = wwbi.GetVersion(); ViewData["SoftwareName"] = wwbi.GetName(); ViewData["allTemplates"] = sa.GetAllTemplates().Tables[0]; ViewData["SiteName"] = getSiteSettings()["SiteName"]; if (_signInManager.IsSignedIn(User)) { return(View()); } else { return(RedirectToAction("ViewPage", "Page")); } }
public ActionResult EditPage(string id) { if (id == null) { return(RedirectToAction("ViewPage")); } SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); wwBuildInfo.wwBuildInfo wwbi = new wwBuildInfo.wwBuildInfo(); string fixNameCaps = sa.FixNameCaps(id); if (fixNameCaps == "") { return(RedirectToAction("ViewPage")); } ViewData["PageName"] = ((fixNameCaps == "") ? id : fixNameCaps); //ViewData["CustomHtml"] = "<div class='ui label'>Testing html \" ` ` \" chars</div>"; string[] pageContents = sa.GetPageByName(id); for (int i = 0; i < 4; i++) { pageContents[i] = pageContents[i].Replace("\n", "").Replace("\\", "\\\\").Replace("\"", "\\\"").Replace("\r", "\\r"); } ViewData["HtmlEdit"] = pageContents[0]; ViewData["CssEdit"] = pageContents[1]; ViewData["JsEdit"] = pageContents[2]; ViewData["HeadEdit"] = pageContents[3]; try { ViewData["ShowUndraftButton"] = (ViewData["PageName"].ToString().Substring(0, 6) == "Draft|") ? "true" : "false"; } catch (Exception ex) { ViewData["ShowUndraftButton"] = "false"; } ViewData["VersionNumber"] = wwbi.GetVersion(); ViewData["SoftwareName"] = wwbi.GetName(); ViewData["SiteName"] = getSiteSettings()["SiteName"]; if (_signInManager.IsSignedIn(User)) { return(View()); } else { return(RedirectToAction("ViewPage", "Page")); } }
public ActionResult NewTemplatePage(string pageName, string template, string saveAsDraft) { if (_signInManager.IsSignedIn(User)) { SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); string newPageName = ((saveAsDraft == "true") ? "Draft|" : "") + pageName; // Create the new page DataSet selectedTemplate = sa.GetTemplateByName(template); DataRow dR = selectedTemplate.Tables[0].Rows[0]; sa.NewPage(newPageName, dR["contents_html"].ToString(), dR["contents_css"].ToString(), dR["contents_js"].ToString(), dR["contents_head"].ToString()); // Send to the page return(RedirectToAction("EditPage", new { id = newPageName })); } else { return(RedirectToAction("ViewPage", "Page")); } }
public ActionResult EditTemplate(string id) { if (id == null) { return(RedirectToAction("ManageTemplates")); } SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); wwBuildInfo.wwBuildInfo wwbi = new wwBuildInfo.wwBuildInfo(); string fixNameCaps = sa.FixNameCapsTemplate(id); if (fixNameCaps == "") { return(RedirectToAction("ManageTemplates")); } ViewData["TemplateName"] = ((fixNameCaps == "") ? id : fixNameCaps); ViewData["TemplateId"] = id; //ViewData["CustomHtml"] = "<div class='ui label'>Testing html \" ` ` \" chars</div>"; DataRow pageContentsDR = sa.GetTemplateById(id).Tables[0].Rows[0]; string[] pageContents = { pageContentsDR["contents_html"].ToString(), pageContentsDR["contents_css"].ToString(), pageContentsDR["contents_js"].ToString(), pageContentsDR["contents_head"].ToString() }; for (int i = 0; i < 4; i++) { pageContents[i] = pageContents[i].Replace("\n", "").Replace("\\", "\\\\").Replace("\"", "\\\"").Replace("\r", "\\r"); } ViewData["HtmlEdit"] = pageContents[0]; ViewData["CssEdit"] = pageContents[1]; ViewData["JsEdit"] = pageContents[2]; ViewData["HeadEdit"] = pageContents[3]; ViewData["TemplateDesc"] = pageContentsDR["description"]; ViewData["VersionNumber"] = wwbi.GetVersion(); ViewData["SoftwareName"] = wwbi.GetName(); ViewData["SiteName"] = getSiteSettings()["SiteName"]; if (_signInManager.IsSignedIn(User)) { return(View()); } else { return(RedirectToAction("ViewPage", "Page")); } }
public ActionResult EditPageForm(string pageName, string HtmlEdit, string CssEdit, string JsEdit, string HeadEdit, string saveAsDraft) { if (_signInManager.IsSignedIn(User)) { SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); string newPageName = pageName; if (saveAsDraft == "Yes") { newPageName = "Draft|" + pageName; } else if (saveAsDraft == "Undraft") { newPageName = pageName.Substring(6); sa.DeletePage(pageName); } sa.NewPage(newPageName, HtmlEdit, CssEdit, JsEdit, HeadEdit); return(RedirectToAction("ViewPage", new { id = newPageName })); } else { return(RedirectToAction("ViewPage", "Page")); } }
public ActionResult RegisterUserForm(string registerEmail) { if (_signInManager.IsSignedIn(User)) { SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); wwBuildInfo.wwBuildInfo wwbi = new wwBuildInfo.wwBuildInfo(); string code = sa.AddRegisterToken(RandomString(64), DateTime.Now.AddDays(30)); var callbackUrl = Url.Page( "/Account/Register", pageHandler: null, values: new { area = "Identity", code }, protocol: Request.Scheme); _emailSender.SendEmailAsync( registerEmail, "Register an account on " + wwbi.getSiteSettings()["SiteName"], $"To create an account, please <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>click here</a>."); return(RedirectToAction("ControlPanel")); } else { return(RedirectToAction("ViewPage", "Page")); } }
public IActionResult RunSqlQuery(string query) { if (_signInManager.IsSignedIn(User)) { SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); DataSet qe = sa.RunSqlQuery(query); string jsonString; // Turn the DataSet into a json object try { jsonString = JsonConvert.SerializeObject(qe.Tables[0]); } catch (Exception ex) { if (ex.Message == "Cannot find table 0.") { //jsonString = "{\"Status\": \"The command completed successfully.\"}"; DataTable dataTable = new DataTable(); dataTable.Columns.Add("Status"); DataRow dataRow = dataTable.NewRow(); dataRow["Status"] = "The command completed successfully."; dataTable.Rows.Add(dataRow); jsonString = JsonConvert.SerializeObject(dataTable); } else { throw ex; } } return(Json(jsonString)); } else { return(RedirectToAction("ViewPage", "Page")); } }
#pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { #line 5 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" wwBuildInfo.wwBuildInfo wwbi = new wwBuildInfo.wwBuildInfo(); ViewData["SoftwareName"] = wwbi.GetName(); ViewData["VersionNumber"] = wwbi.GetVersion(); ViewData["ProjectUrl"] = wwbi.GetUrl(); ViewData["SiteName"] = wwbi.getSiteSettings()["SiteName"]; #line default #line hidden BeginContext(410, 2, true); WriteLiteral("\r\n"); EndContext(); #line 13 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" Layout = null; #line default #line hidden BeginContext(439, 2, true); WriteLiteral("\r\n"); EndContext(); #line 17 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" string token = HttpContext.Request.Query["code"].ToString(); SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); bool tokenValid = sa.CheckRegisterToken(token); #line default #line hidden BeginContext(624, 33, true); WriteLiteral("\r\n<!DOCTYPE html>\r\n\r\n<html>\r\n "); EndContext(); BeginContext(657, 875, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("head", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "e4f68a2e8f34932e72d6946f26a9cbc55ae00b9d8039", async() => { BeginContext(663, 28, true); WriteLiteral("\r\n <title>Register | "); EndContext(); BeginContext(692, 20, false); #line 27 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" Write(ViewData["SiteName"]); #line default #line hidden EndContext(); BeginContext(712, 813, true); WriteLiteral(@"</title> <script src=""https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js""></script> <link rel=""stylesheet"" type=""text/css"" href=""https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.css""> <script src=""https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.js""></script> <style> body { margin: 14px; /*margin-right: 14px;*/ } </style> <script> function decodeHtml(html) { var txt = document.createElement(""textarea""); txt.innerHTML = html; return txt.value; } $( document ).ready(function() { $('.dropdown').dropdown(); }); </script> "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1532, 6, true); WriteLiteral("\r\n "); EndContext(); BeginContext(1538, 2123, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("body", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "e4f68a2e8f34932e72d6946f26a9cbc55ae00b9d10414", async() => { BeginContext(1544, 10, true); WriteLiteral("\r\n "); EndContext(); BeginContext(1554, 26, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("partial", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "e4f68a2e8f34932e72d6946f26a9cbc55ae00b9d10802", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.Name = (string)__tagHelperAttribute_0.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1580, 2, true); WriteLiteral("\r\n"); EndContext(); #line 50 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" if (UserManager.Users.ToList().Count < 1 || SignInManager.IsSignedIn(User) || tokenValid) { #line default #line hidden BeginContext(1682, 46, true); WriteLiteral(" <div id=\"customContent\">\r\n "); EndContext(); BeginContext(1728, 1648, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "e4f68a2e8f34932e72d6946f26a9cbc55ae00b9d12496", async() => { BeginContext(1787, 152, true); WriteLiteral("\r\n <h1>Register an account</h1>\r\n <p>Once you click \"Register\", the credentials will have full access to all of the tools "); EndContext(); BeginContext(1940, 24, false); #line 54 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" Write(ViewData["SoftwareName"]); #line default #line hidden EndContext(); BeginContext(1964, 174, true); WriteLiteral(" has to offer, including editing and deleting pages, and uploading files to the server. Don\'t do this if the owner of the new credentials isn\'t trusted.</p>\r\n "); EndContext(); BeginContext(2138, 40, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "e4f68a2e8f34932e72d6946f26a9cbc55ae00b9d13687", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.ValidationSummaryTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper); #line 55 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper.ValidationSummary = global::Microsoft.AspNetCore.Mvc.Rendering.ValidationSummary.All; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-validation-summary", __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper.ValidationSummary, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(2178, 106, true); WriteLiteral("\r\n <div class=\"ui form\">\r\n <div class=\"field\">\r\n "); EndContext(); BeginContext(2284, 37, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("label", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "e4f68a2e8f34932e72d6946f26a9cbc55ae00b9d15542", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.LabelTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper); #line 58 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Input.Email); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(2321, 26, true); WriteLiteral("\r\n "); EndContext(); BeginContext(2347, 44, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "e4f68a2e8f34932e72d6946f26a9cbc55ae00b9d17230", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper); #line 59 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Input.Email); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_1.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(2391, 26, true); WriteLiteral("\r\n "); EndContext(); BeginContext(2417, 66, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("span", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "e4f68a2e8f34932e72d6946f26a9cbc55ae00b9d19134", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.ValidationMessageTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper); #line 60 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Input.Email); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-validation-for", __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(2483, 95, true); WriteLiteral("\r\n </div>\r\n <div class=\"field\">\r\n "); EndContext(); BeginContext(2578, 40, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("label", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "e4f68a2e8f34932e72d6946f26a9cbc55ae00b9d21057", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.LabelTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper); #line 63 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Input.Password); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(2618, 26, true); WriteLiteral("\r\n "); EndContext(); BeginContext(2644, 50, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "e4f68a2e8f34932e72d6946f26a9cbc55ae00b9d22748", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper); #line 64 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Input.Password); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_3.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(2694, 26, true); WriteLiteral("\r\n "); EndContext(); BeginContext(2720, 69, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("span", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "e4f68a2e8f34932e72d6946f26a9cbc55ae00b9d24655", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.ValidationMessageTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper); #line 65 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Input.Password); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-validation-for", __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(2789, 95, true); WriteLiteral("\r\n </div>\r\n <div class=\"field\">\r\n "); EndContext(); BeginContext(2884, 47, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("label", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "e4f68a2e8f34932e72d6946f26a9cbc55ae00b9d26581", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.LabelTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper); #line 68 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Input.ConfirmPassword); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(2931, 26, true); WriteLiteral("\r\n "); EndContext(); BeginContext(2957, 57, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "e4f68a2e8f34932e72d6946f26a9cbc55ae00b9d28279", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper); #line 69 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Input.ConfirmPassword); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_3.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(3014, 26, true); WriteLiteral("\r\n "); EndContext(); BeginContext(3040, 76, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("span", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "e4f68a2e8f34932e72d6946f26a9cbc55ae00b9d30193", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.ValidationMessageTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper); #line 70 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Input.ConfirmPassword); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-validation-for", __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(3116, 50, true); WriteLiteral("\r\n </div>\r\n "); EndContext(); BeginContext(3166, 68, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "e4f68a2e8f34932e72d6946f26a9cbc55ae00b9d32077", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_4.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4); #line 72 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Input.RegisterToken); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); BeginWriteTagHelperAttribute(); #line 72 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" WriteLiteral(token); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.Value = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("value", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.Value, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(3234, 135, true); WriteLiteral("\r\n </div>\r\n <br>\r\n <button type=\"submit\" class=\"ui button\">Register</button>\r\n "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper); if (__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.RouteValues == null) { throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-returnUrl", "Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper", "RouteValues")); } BeginWriteTagHelperAttribute(); #line 52 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" WriteLiteral(Model.ReturnUrl); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.RouteValues["returnUrl"] = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-returnUrl", __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.RouteValues["returnUrl"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_5.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_5); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(3376, 16, true); WriteLiteral("\r\n </div>"); EndContext(); #line 77 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" } else { #line default #line hidden BeginContext(3411, 62, true); WriteLiteral(" <h1>You are not authorized to access this page.</h1>\r\n"); EndContext(); #line 80 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" } #line default #line hidden BeginContext(3484, 105, true); WriteLiteral(" <div class=\"ui divider\"></div>\r\n <span id=\"version\" class=\"ui small grey text\">Powered by "); EndContext(); BeginContext(3590, 24, false); #line 82 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" Write(ViewData["SoftwareName"]); #line default #line hidden EndContext(); BeginContext(3614, 1, true); WriteLiteral(" "); EndContext(); BeginContext(3616, 25, false); #line 82 "/home/benjamin/webweb-core/webweb/Areas/Identity/Pages/Account/Register.cshtml" Write(ViewData["VersionNumber"]); #line default #line hidden EndContext(); BeginContext(3641, 13, true); WriteLiteral("</span>\r\n "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(3661, 13, true); WriteLiteral("\r\n</html>\r\n\r\n"); EndContext(); DefineSection("Scripts", async() => { BeginContext(3692, 6, true); WriteLiteral("\r\n "); EndContext(); BeginContext(3698, 44, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("partial", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "e4f68a2e8f34932e72d6946f26a9cbc55ae00b9d39601", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.Name = (string)__tagHelperAttribute_6.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_6); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(3742, 2, true); WriteLiteral("\r\n"); EndContext(); } ); }
#pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { #line 1 "/home/benjamin/webweb-core/webweb/Views/Page/ManageTemplates.cshtml" Layout = null; #line default #line hidden BeginContext(24, 1, true); WriteLiteral("\n"); EndContext(); BeginContext(45, 29, true); WriteLiteral("\n<!DOCTYPE html>\n\n<html>\n "); EndContext(); BeginContext(74, 862, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("head", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "69b2e4b850b731ecc3d957342ef9070414c942cc5355", async() => { BeginContext(80, 35, true); WriteLiteral("\n <title>Manage Templates | "); EndContext(); BeginContext(116, 20, false); #line 11 "/home/benjamin/webweb-core/webweb/Views/Page/ManageTemplates.cshtml" Write(ViewData["SiteName"]); #line default #line hidden EndContext(); BeginContext(136, 793, true); WriteLiteral(@"</title> <script src=""https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js""></script> <link rel=""stylesheet"" type=""text/css"" href=""https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.css""> <script src=""https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.js""></script> <style> body { margin: 14px; /*margin-right: 14px;*/ } </style> <script> function decodeHtml(html) { var txt = document.createElement(""textarea""); txt.innerHTML = html; return txt.value; } $( document ).ready(function() { $('.dropdown').dropdown(); }); </script> "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(936, 5, true); WriteLiteral("\n "); EndContext(); BeginContext(941, 3217, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("body", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "69b2e4b850b731ecc3d957342ef9070414c942cc7708", async() => { BeginContext(947, 1333, true); WriteLiteral(@" <!--<div class=""ui inverted menu""> <a href=""/"" class=""item""> Home </a> <form class=""right item"" id=""navigateForm"" action=""/Page/NavigateForm"" method=""post""> <div class=""ui inverted transparent input""> <input type=""text"" name=""pageName"" placeholder=""Navigate to...""> </div> <button type=""submit"" class=""ui black button"">Go</button> </form> <div class=""ui inverted dropdown icon item""> <i class=""wrench icon""></i> <div class=""menu""> <a class=""item"" href=""/ViewPage/Special|List of pages""> Special|List of pages </a> <a class=""item"" href=""/NewPage""> New Page </a> <a class=""item"" href=""/ManageTemplates""> Manage Templates </a> <a "); WriteLiteral(@"class=""item"" href=""/ManageFiles""> Manage Files </a> <a class=""item"" href=""/Admin/ControlPanel""> Control Panel </a> <a class=""item"" href=""/Docs/About""> About "); EndContext(); BeginContext(2281, 24, false); #line 62 "/home/benjamin/webweb-core/webweb/Views/Page/ManageTemplates.cshtml" Write(ViewData["SoftwareName"]); #line default #line hidden EndContext(); BeginContext(2305, 213, true); WriteLiteral("\n </a>\n <a class=\"item\" href=\"/Docs/Syntax\">\n Syntax Guide\n </a>\n </div>\n </div>\n </div>-->\n "); EndContext(); BeginContext(2518, 26, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("partial", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "69b2e4b850b731ecc3d957342ef9070414c942cc10087", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.Name = (string)__tagHelperAttribute_0.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(2544, 372, true); WriteLiteral(@" <div id=""customContent""> <div class=""ui header""> Manage Templates </div> <table class=""ui celled table""> <thead><tr> <th>Name</th> <th>Description</th> <th>Actions</th> </tr></thead> <tbody> "); EndContext(); #line 82 "/home/benjamin/webweb-core/webweb/Views/Page/ManageTemplates.cshtml" SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); DataRowCollection allTemplates = sa.GetAllTemplates().Tables[0].Rows; #line default #line hidden BeginContext(3124, 20, true); WriteLiteral(" "); EndContext(); #line 86 "/home/benjamin/webweb-core/webweb/Views/Page/ManageTemplates.cshtml" foreach (DataRow row in allTemplates) { #line default #line hidden BeginContext(3205, 53, true); WriteLiteral(" <tr>\n <td>"); EndContext(); BeginContext(3259, 11, false); #line 89 "/home/benjamin/webweb-core/webweb/Views/Page/ManageTemplates.cshtml" Write(row["name"]); #line default #line hidden EndContext(); BeginContext(3270, 34, true); WriteLiteral("</td>\n <td>"); EndContext(); BeginContext(3305, 18, false); #line 90 "/home/benjamin/webweb-core/webweb/Views/Page/ManageTemplates.cshtml" Write(row["description"]); #line default #line hidden EndContext(); BeginContext(3323, 66, true); WriteLiteral("</td>\n <td><a class=\"ui yellow icon button\""); EndContext(); BeginWriteAttribute("href", " href=\"", 3389, "\"", 3420, 2); WriteAttributeValue("", 3396, "/EditTemplate/", 3396, 14, true); #line 91 "/home/benjamin/webweb-core/webweb/Views/Page/ManageTemplates.cshtml" WriteAttributeValue("", 3410, row["id"], 3410, 10, false); #line default #line hidden EndWriteAttribute(); BeginContext(3421, 65, true); WriteLiteral("><i class=\"pencil icon\"></i></a></td>\n </tr> \n"); EndContext(); #line 93 "/home/benjamin/webweb-core/webweb/Views/Page/ManageTemplates.cshtml" } #line default #line hidden BeginContext(3508, 142, true); WriteLiteral(" </tbody>\n </table>\n <div class=\"ui header\">\n New Template\n </div>\n "); EndContext(); BeginContext(3650, 317, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "69b2e4b850b731ecc3d957342ef9070414c942cc14290", async() => { BeginContext(3722, 238, true); WriteLiteral("\n <div class=\"ui action input\">\n <input type=\"text\" name=\"templateName\" placeholder=\"Title\">\n <button type=\"submit\" class=\"ui button\">Create</button>\n </div>\n "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_3.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(3967, 120, true); WriteLiteral("\n </div>\n <div class=\"ui divider\"></div>\n <span id=\"version\" class=\"ui small grey text\">Powered by "); EndContext(); BeginContext(4088, 24, false); #line 107 "/home/benjamin/webweb-core/webweb/Views/Page/ManageTemplates.cshtml" Write(ViewData["SoftwareName"]); #line default #line hidden EndContext(); BeginContext(4112, 1, true); WriteLiteral(" "); EndContext(); BeginContext(4114, 25, false); #line 107 "/home/benjamin/webweb-core/webweb/Views/Page/ManageTemplates.cshtml" Write(ViewData["VersionNumber"]); #line default #line hidden EndContext(); BeginContext(4139, 12, true); WriteLiteral("</span>\n "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(4158, 13, true); WriteLiteral("\n</html>\n\n\n\n\n"); EndContext(); }
public ActionResult ViewPage(string id) { if (id == null) { //return RedirectToAction("Index", "Home"); id = "Index"; } SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess(); wwBuildInfo.wwBuildInfo wwbi = new wwBuildInfo.wwBuildInfo(); //ViewData["CustomHtml"] = "<div class='ui label'>Testing html \" ` ` \" chars</div>"; string[] pageData = sa.GetPageByName(id); string pageContents = pageData[0]; string fixNameCaps = sa.FixNameCaps(id); List <string> authCredentials = new List <string>(); ViewData["PageName"] = ((fixNameCaps == "") ? id : fixNameCaps); if (pageContents == "") { ViewData["CustomHtml"] = @"<div class=""ui negative message""> <div class=""header""> 404 Error </div> <p>Either this page is empty or it does not exist. </p></div>"; ViewData["ErrorShown"] = true; } else { ViewData["CustomHtml"] = applySyntaxRules(pageContents, ViewData["PageName"].ToString()); Dictionary <string, object> authProcessedText = applyAuthenticationRules(ViewData["CustomHtml"].ToString()); ViewData["CustomHtml"] = (string)authProcessedText["outText"]; authCredentials = (List <string>)authProcessedText["authCredentials"]; } string newHtml = ViewData["CustomHtml"].ToString().Replace("{{HIDENAVBAR}}\r\n", ""); if (newHtml != ViewData["CustomHtml"].ToString()) { ViewData["ShowNavbar"] = false; ViewData["CustomHtml"] = newHtml; } else { ViewData["ShowNavbar"] = true; } newHtml = ViewData["CustomHtml"].ToString().Replace("{{NOMARGIN}}\r\n", ""); if (newHtml != ViewData["CustomHtml"].ToString()) { ViewData["NoMargin"] = true; ViewData["CustomHtml"] = newHtml; } else { ViewData["NoMargin"] = false; } ViewData["CustomCss"] = pageData[1]; ViewData["CustomJs"] = pageData[2]; ViewData["CustomHead"] = pageData[3]; ViewData["VersionNumber"] = wwbi.GetVersion(); ViewData["SoftwareName"] = wwbi.GetName(); ViewData["SiteName"] = getSiteSettings()["SiteName"]; if (_userManager.Users.ToList().Count < 1) { return(RedirectToPage("/Account/Register", new { area = "Identity" })); } bool credentialMatches = true; if (authCredentials.Count > 0) { credentialMatches = false; var req = HttpContext.Request; var auth = req.Headers["Authorization"]; if (!string.IsNullOrEmpty(auth)) { var cred = ASCIIEncoding.ASCII.GetString(Convert.FromBase64String(auth.ToString().Substring(6))).Split(':'); var user = new { Name = cred[0], Pass = cred[1] }; foreach (string credentialPair in authCredentials) { var credentialList = credentialPair.Split("|"); if (user.Name == credentialList[0] && user.Pass == credentialList[1]) { credentialMatches = true; break; // Don't keep going through the credential list } } } } try { if (!credentialMatches) { HttpContext.Response.Headers.Add("WWW-Authenticate", "Basic realm=\"This page is protected, please enter the username and password specific to the page.\""); return(new UnauthorizedResult()); } if ((!_signInManager.IsSignedIn(User)) && (ViewData["PageName"].ToString().Substring(0, 6) == "Draft|")) { return(RedirectToAction("ViewPage", "Page", new { id = "Index" })); } return(View()); } catch (Exception ex) { // Sometimes the string isn't long enough to be substringed return(View()); } }