#!/usr/bin/perl
require "wiz_resources";

$page_to_edit=param("page");
header("Delete Page ('".page_name($page_to_edit)."')","","edit");

if ($user ne "") {
  $verify=param("verify");
  $verify="" unless (defined($verify));
  if ($verify eq "true") {
    unlink "${homesite}$page_to_edit";
    headline("Page Deleted","","","The page '".page_name($page_to_edit)."' has been deleted.  Please update your other pages to make sure they take into account this change (in the list of links on each page).");
    set_change_date();
    print "<p><a href=\"$default_cgi/edit\">Continue editing</a>";
  } else {
    headline("Verification: delete '".page_name($page_to_edit)."'","","","Are you sure you want to delete this page?  All information contained on it will be lost.");
        print "<p>\n<a href=\"$ENV{REQUEST_URI}&verify=true\"><font color=\"#ff0000\">Continue: override safety check and delete</font></a> or <a href=\"$default_cgi/edit\"><font color=\"#00CC00\">Stop: go back to editing page</font></a>";
  }
} else {
  headline("Error: Access denied","red","","You should not use this page unless you have logged into the system.  Please <a href=\"$default_cgi/login\">log in</a> and try again.");
}
footer();
