diff --git a/assets/page.erb b/assets/page.erb index 05966d4..ca8ee20 100644 --- a/assets/page.erb +++ b/assets/page.erb @@ -144,6 +144,19 @@

<%= hostname %> status - MALP

+<% if authenticated %> +
+ +<% end %> + <% unless authenticated %>
Sign In
diff --git a/cgi-bin/malp.rb b/cgi-bin/malp.rb index 3023c91..e789d52 100755 --- a/cgi-bin/malp.rb +++ b/cgi-bin/malp.rb @@ -79,6 +79,19 @@ if cgi.request_method == "POST" && !authenticated end end +if cgi.params.key?("content") + if authenticated + cgi.out("type" => "text/html", "charset" => "UTF-8") do + "

Content placeholder

" + end + else + cgi.out("Status" => "403 Forbidden", "type" => "text/plain", "charset" => "UTF-8") do + "Forbidden" + end + end + exit +end + template = ERB.new(File.read(File.join(ASSETS_DIR, "page.erb"))) out_params = { "type" => "text/html", "charset" => "UTF-8" }