diff --git a/static/css/main.css b/static/css/main.css index dcf13bb9..39da52ee 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -455,3 +455,6 @@ td.details-control{ .tooltip-inner { width:300px !important; } +#capture_passwords { + display:none; +} diff --git a/static/js/app/landing_pages.js b/static/js/app/landing_pages.js index 550048b4..4450eeff 100644 --- a/static/js/app/landing_pages.js +++ b/static/js/app/landing_pages.js @@ -9,7 +9,20 @@ var pages = [] function save(idx) { var page = {} page.name = $("#name").val() - page.html = CKEDITOR.instances["html_editor"].getData(); + editor = CKEDITOR.instances["html_editor"] + html = editor.getData(); + ck_dom = $(html) + // Handle capturing credentials + if ($("#capture_credentials_checkbox").prop("checked")) { + ck_dom.find("form").attr("action", "") + if (!$("#capture_passwords_checkbox").prop("checked")) { + // Remove the name so the credential isn't submitted + ck_dom.find("input[type='password']").removeAttr("name") + } + } else { + ck_dom.find("form").attr("action", "#") + } + page.html = editor.getData(); if (idx != -1) { page.id = pages[idx].id api.pageId.put(page) @@ -163,5 +176,8 @@ $(document).ready(function() { } }, this)); }; + $("#capture_credentials_checkbox").change(function(){ + $("#capture_passwords").toggle() + }) load() }) diff --git a/templates/landing_pages.html b/templates/landing_pages.html index 6efe51f8..172079ee 100644 --- a/templates/landing_pages.html +++ b/templates/landing_pages.html @@ -80,6 +80,17 @@ +