From 718526b089faa79b1b817e405bc08776d4090c69 Mon Sep 17 00:00:00 2001 From: Robert Anderson <randerson@lbsd.net> Date: Wed, 18 Mar 2009 10:18:05 +0000 Subject: [PATCH] Not used anymore --- webui/policy-add.php | 128 -------------------------------- webui/policy-delete.php | 137 ----------------------------------- webui/policy-member-main.php | 126 -------------------------------- 3 files changed, 391 deletions(-) delete mode 100644 webui/policy-add.php delete mode 100644 webui/policy-delete.php delete mode 100644 webui/policy-member-main.php diff --git a/webui/policy-add.php b/webui/policy-add.php deleted file mode 100644 index f53c96ea..00000000 --- a/webui/policy-add.php +++ /dev/null @@ -1,128 +0,0 @@ -<?php -# Policy add -# Copyright (C) 2008, LinuxRulz -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -include_once("includes/header.php"); -include_once("includes/footer.php"); -include_once("includes/db.php"); -include_once("includes/tooltips.php"); - - - -$db = connect_db(); - - - -printHeader(array( - "Tabs" => array( - "Back to policies" => "policy-main.php" - ), -)); - - - -if ($_POST['frmaction'] == "add") { -?> - <p class="pageheader">Add Policy</p> - - <form method="post" action="policy-add.php"> - <div> - <input type="hidden" name="frmaction" value="add2" /> - </div> - <table class="entry"> - <tr> - <td class="entrytitle">Name</td> - <td><input type="text" name="policy_name" /></td> - </tr> - <tr> - <td class="entrytitle">Priority</td> - <td> - <input type="text" size="4" name="policy_priority" /> - <?php tooltip('policy_priority'); ?> - </td> - </tr> - <tr> - <td class="entrytitle texttop">Description</td> - <td><textarea name="policy_description" cols="40" rows="5" /></textarea></td> - </tr> - <tr> - <td colspan="2"> - <input type="submit" /> - </td> - </tr> - </table> - </form> - -<?php - -# Check we have all params -} elseif ($_POST['frmaction'] == "add2") { -?> - <p class="pageheader">Policy Add Results</p> - -<?php - # Check name - if (empty($_POST['policy_name'])) { -?> - <div class="warning">Policy name cannot be empty</div> -<?php - - # Check priority - } elseif (!isset($_POST['policy_priority'])) { -?> - <div class="warning">Policy priority cannot be empty</div> -<?php - - # Check description - } elseif (empty($_POST['policy_description'])) { -?> - <div class="warning">Policy description cannot be empty</div> -<?php - - } else { - $stmt = $db->prepare("INSERT INTO ${DB_TABLE_PREFIX}policies (Name,Priority,Description,Disabled) VALUES (?,?,?,1)"); - - $res = $stmt->execute(array( - $_POST['policy_name'], - $_POST['policy_priority'], - $_POST['policy_description'] - )); - if ($res) { -?> - <div class="notice">Policy created</div> -<?php - } else { -?> - <div class="warning">Failed to create policy</div> - <div class="warning"><?php print_r($stmt->errorInfo()) ?></div> -<?php - } - - } - - -} else { -?> - <div class="warning">Invalid invocation</div> -<?php -} - -printFooter(); - - -# vim: ts=4 -?> diff --git a/webui/policy-delete.php b/webui/policy-delete.php deleted file mode 100644 index 2e36962d..00000000 --- a/webui/policy-delete.php +++ /dev/null @@ -1,137 +0,0 @@ -<?php -# Module: Policy delete -# Copyright (C) 2008, LinuxRulz -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - - -include_once("includes/header.php"); -include_once("includes/footer.php"); -include_once("includes/db.php"); - - - -$db = connect_db(); - - - -printHeader(array( - "Tabs" => array( - "Back to policies" => "policy-main.php", - ), -)); - - - -# Display delete confirm screen -if ($_POST['frmaction'] == "delete") { - - # Check a policy was selected - if (isset($_POST['policy_id'])) { -?> - <p class="pageheader">Delete Policy</p> - - <form action="policy-delete.php" method="post"> - <div> - <input type="hidden" name="frmaction" value="delete2" /> - <input type="hidden" name="policy_id" value="<?php echo $_POST['policy_id']; ?>" /> - </div> - - <div class="textcenter"> - Are you very sure? <br /> - <input type="submit" name="confirm" value="yes" /> - <input type="submit" name="confirm" value="no" /> - </div> - </form> -<?php - } else { -?> - <div class="warning">No policy selected</div> -<?php - } - - - -# SQL Updates -} elseif ($_POST['frmaction'] == "delete2") { -?> - <p class="pageheader">Policy Delete Results</p> -<?php - if (isset($_POST['policy_id'])) { - - - if ($_POST['confirm'] == "yes") { - $db->beginTransaction(); - - $res = $db->exec("DELETE FROM ${DB_TABLE_PREFIX}policy_members WHERE PolicyID = ".$db->quote($_POST['policy_id'])); - if ($res !== FALSE) { -?> - <div class="notice">Policy members deleted</div> -<?php - } else { -?> - <div class="warning">Error deleting policy members!</div> - <div class="warning"><?php print_r($db->errorInfo()) ?></div> -<?php - $db->rollback(); - } - - if ($res !== FALSE) { - $res = $db->exec("DELETE FROM ${DB_TABLE_PREFIX}policies WHERE ID = ".$db->quote($_POST['policy_id'])); - if ($res) { -?> - <div class="notice">Policy deleted</div> -<?php - } else { -?> - <div class="warning">Error deleting policy!</div> - <div class="warning"><?php print_r($db->errorInfo()) ?></div> -<?php - $db->rollback(); - } - } - - if ($res) { - $db->commit(); - } - } else { -?> - <div class="notice">Policy not deleted, aborted by user</div> -<?php - } - - # Warn - } else { -?> - <div class="warning">Invocation error, no policy ID</div> -<?php - } - - - -} else { -?> - <div class="warning">Invalid invocation</div> -<?php -} - - -printFooter(); - - -# vim: ts=4 -?> - diff --git a/webui/policy-member-main.php b/webui/policy-member-main.php deleted file mode 100644 index b18eebf0..00000000 --- a/webui/policy-member-main.php +++ /dev/null @@ -1,126 +0,0 @@ -<?php -# Policy ACL main screen -# Copyright (C) 2008, LinuxRulz -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -include_once("includes/header.php"); -include_once("includes/footer.php"); -include_once("includes/db.php"); - - - -$db = connect_db(); - - - -printHeader(array( - "Tabs" => array( - "Back to policies" => "policy-main.php" - ), -)); - - -# Check a policy was selected -if (isset($_REQUEST['policy_id'])) { - -?> - <p class="pageheader">Policy Members</p> - -<?php - - $policy_stmt = $db->prepare("SELECT Name FROM ${DB_TABLE_PREFIX}policies WHERE ID = ?"); - $policy_stmt->execute(array($_REQUEST['policy_id'])); - $row = $policy_stmt->fetchObject(); - $policy_stmt->closeCursor(); -?> - <form id="main_form" action="policy-member-main.php" method="post"> - <div> - <input type="hidden" name="policy_id" value="<?php echo $_REQUEST['policy_id'] ?>" /> - </div> - <div class="textcenter"> - <div class="notice">Policy: <?php echo $row->name ?></div> - - Action - <select id="main_form_action" name="frmaction" - onchange=" - var myform = document.getElementById('main_form'); - var myobj = document.getElementById('main_form_action'); - - if (myobj.selectedIndex == 2) { - myform.action = 'policy-member-add.php'; - myform.submit(); - } else if (myobj.selectedIndex == 4) { - myform.action = 'policy-member-change.php'; - myform.submit(); - } else if (myobj.selectedIndex == 5) { - myform.action = 'policy-member-delete.php'; - myform.submit(); - } -"> - - <option selected="selected">select action</option> - <option disabled="disabled"> - - - - - - - - - - - </option> - <option value="add">Add</option> - <option disabled="disabled"> - - - - - - - - - - - </option> - <option value="change">Change</option> - <option value="delete">Delete</option> - </select> - </div> - - <p /> - - <table class="results" style="width: 75%;"> - <tr class="resultstitle"> - <td id="noborder"></td> - <td class="textcenter">Source</td> - <td class="textcenter">Destination</td> - <td class="textcenter">Disabled</td> - </tr> -<?php - - $stmt = $db->prepare("SELECT ID, Source, Destination, Disabled FROM ${DB_TABLE_PREFIX}policy_members WHERE PolicyID = ?"); - $res = $stmt->execute(array($_REQUEST['policy_id'])); - - $i = 0; - - # Loop with rows - while ($row = $stmt->fetchObject()) { -?> - <tr class="resultsitem"> - <td><input type="radio" name="policy_member_id" value="<?php echo $row->id ?>" /></td> - <td class="textcenter"><?php echo is_null($row->source) ? 'any' : $row->source ?></td> - <td class="textcenter"><?php echo is_null($row->destination) ? 'any' : $row->destination ?></td> - <td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no' ?></td> - </tr> -<?php - } - $stmt->closeCursor(); -?> - </table> - </form> -<?php -} else { -?> - <div class="warning">Invalid invocation</div> -<?php -} - - -printFooter(); - - -# vim: ts=4 -?> -- GitLab