Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • smradius/smradius
  • centiva-shail/smradius
  • nkukard/smradius
3 results
Show changes
Showing
with 0 additions and 849 deletions
webui/images/bullet.jpg

631 B

webui/images/help.gif

302 B

webui/images/menuleft.gif

640 B

webui/images/menuright.gif

1.37 KiB

webui/images/specs_bottom.jpg

871 B

webui/images/strips_onside.jpg

392 B

webui/images/top2.jpg

2.06 KiB

webui/images/valid-css2.png

1.55 KiB

webui/images/valid-xhtml10.png

1.84 KiB

webui/images/wcag1AAA.png

1.56 KiB

<?php
# mysql:host=xx;dbname=yyy
#
# pgsql:host=xx;dbname=yyy
#
# sqlite:////full/unix/path/to/file.db?mode=0666
#
#$DB_DSN="sqlite:////tmp/cluebringer.sqlite";
$DB_DSN="mysql:host=localhost;dbname=smradius";
$DB_USER="root";
$DB_PASS="root";
#$DB_PASS="";
$DB_TABLE_PREFIX="";
#
# THE BELOW SECTION IS UNSUPPORTED AND MEANT FOR THE ORIGINAL SPONSOR OF V2
#
#$DB_POSTFIX_DSN="mysql:host=localhost;dbname=postfix";
#$DB_POSTFIX_USER="root";
#$DB_POSTFIX_PASS="";
?>
<?php
require_once('includes/config.php');
# Connect to DB
function connect_db()
{
global $DB_DSN;
global $DB_USER;
global $DB_PASS;
try {
$dbh = new PDO($DB_DSN, $DB_USER, $DB_PASS, array(
PDO::ATTR_PERSISTENT => false
));
$dbh->setAttribute(PDO::ATTR_CASE,PDO::CASE_LOWER);
} catch (PDOException $e) {
die("Error connecting to Policyd v2 DB: " . $e->getMessage());
}
return $dbh;
}
# Connect to postfix DB
function connect_postfix_db()
{
global $DB_POSTFIX_DSN;
global $DB_POSTFIX_USER;
global $DB_POSTFIX_PASS;
try {
$dbh = new PDO($DB_POSTFIX_DSN, $DB_POSTFIX_USER, $DB_POSTFIX_PASS, array(
PDO::ATTR_PERSISTENT => false
));
$dbh->setAttribute(PDO::ATTR_CASE,PDO::CASE_LOWER);
} catch (PDOException $e) {
die("Error connecting to Postfix DB: " . $e->getMessage());
}
return $dbh;
}
# vim: ts=4
?>
<?php
# Print page footer
function printFooter()
{
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="footer">SMRadiusd - Copyright &copy; 2008-2009, LinuxRulz - <a href="http://www.policyd.org/v2/">http://www.policyd.org/v2/</a></td>
</tr>
<tr>
<td>
<div id="footerimages">
<img src="images/valid-xhtml10.png" alt="XHTML 1.0 Valid Logo"/>
<img src="images/valid-css2.png" alt="CSS 2.0 Valid Logo"/>
<img src="images/wcag1AAA.png" alt="Level Tripple-A Conformance"/>
</div>
</td>
</tr>
</table>
</body>
</html>
<?php
}
?>
<?php
include_once("includes/config.php");
# Print out HTML header
function printHeader($params = NULL)
{
global $DB_POSTFIX_DSN;
# Pull in params
if (!is_null($params)) {
if (isset($params['Tabs'])) {
$tabs = $params['Tabs'];
}
if (isset($params['js.onLoad'])) {
$jsOnLoad = $params['js.onLoad'];
}
if (isset($params['Title'])) {
$title = $params['Title'];
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Policyd Web Administration</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script type="text/javascript" src="tooltips/BubbleTooltips.js"></script>
<script type="text/javascript">
window.onload=function(){enableTooltips(null,"img")};
</script>
</head>
<body<?php if (!empty($jsOnLoad)) { echo " onLoad=\"".$jsOnLoad."\""; } ?>>
<table id="maintable">
<tr>
<td id="header">SMRadiusd Web Administration</td>
</tr>
<tr>
<td>
<table>
<tr>
<td id="menu">
<img style="margin-top:-1px; margin-left:-1px;" src="images/top2.jpg" alt="" />
<p><a href=".">Home</a></p>
<p>Control Panel</p>
<ul>
<li><a href="user-main.php">Users</a></li>
<li><a href="group-main.php">Groups</a></li>
</ul>
<img style="margin-left:-1px; margin-bottom: -6px" src="images/specs_bottom.jpg" alt="" />
</td>
<td class="content">
<table class="content">
<?php
# Check if we must display tabs or not
if (!empty($tabs)) {
?>
<tr><td id="topmenu"><ul>
<?php
foreach ($tabs as $key => $value) {
?> <li>
<a href="<?php echo $value ?>"
title="<?php echo $key ?>">
<span><?php echo $key ?></span></a>
</li>
<?php
}
?>
</ul></td></tr>
<?php
}
?>
<tr>
<td>
<?php
}
# vim: ts=4
?>
<?php
# Tooltip data
$tooltips['user_attributes_operator'] = "Maximum Operator Length: xxxx";
?>
<?php
# Main index file
# 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");
printHeader();
?>
<p class="pageheader">Features Supported</p>
<ul>
<li>Protocols
<ul>
<li>Bizanga
<a title="Help on Bizanga protocol" href="http://www.policyd.org/tiki-index.php?page=Bizanga&structure=Documentation" class="help">
<img src="images/help.gif" alt="Help" />
</a>
</li>
<li>Postfix
<a title="Help on Postfix protocol" href="http://www.policyd.org/tiki-index.php?page=Postfix&structure=Documentation" class="help">
<img src="images/help.gif" alt="Help" />
</a>
</li>
</ul>
</li>
<li>Policies &amp; Policy Groups
<a title="Help on policies and groups" href="http://www.policyd.org/tiki-index.php?page=Policies%20%26%20Groups&structure=Documentation" class="help">
<img src="images/help.gif" alt="Help" />
</a>
<ul>
<li>Define policy groups made up of various combinations of tags.</li>
<li>Define and manage policies comprising of ACL's which can include groups.</li>
</ul>
</li>
</ul>
<?php
printFooter();
# vim: ts=4
?>
<?php
# Policy change
# 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"
),
));
# Display change screen
if ($_POST['frmaction'] == "change") {
# Check a policy was selected
if (isset($_POST['policy_id'])) {
# Prepare statement
$stmt = $db->prepare("SELECT ID, Name, Priority, Description, Disabled FROM ${DB_TABLE_PREFIX}policies WHERE ID = ?");
?>
<p class="pageheader">Update Policies</p>
<form action="policy-change.php" method="post">
<div>
<input type="hidden" name="frmaction" value="change2" />
<input type="hidden" name="policy_id" value="<?php echo $_POST['policy_id']; ?>" />
</div>
<?php
$res = $stmt->execute(array($_POST['policy_id']));
$row = $stmt->fetchObject();
$stmt->closeCursor();
?>
<table class="entry" style="width: 75%;">
<tr>
<td></td>
<td class="entrytitle textcenter">Old Value</td>
<td class="entrytitle textcenter">New Value</td>
</tr>
<tr>
<td class="entrytitle">Name</td>
<td class="oldval"><?php echo $row->name ?></td>
<td><input type="text" name="policy_name" /></td>
</tr>
<tr>
<td class="entrytitle">Priority</td>
<td class="oldval"><?php echo $row->priority ?></td>
<td>
<input type="text" name="policy_priority" />
<?php tooltip('policy_priority'); ?>
</td>
</tr>
<tr>
<td class="entrytitle texttop">Description</td>
<td class="oldval texttop"><?php echo $row->description ?></td>
<td><textarea name="policy_description" cols="40" rows="5"></textarea></td>
</tr>
<tr>
<td class="entrytitle">Disabled</td>
<td class="oldval"><?php echo $row->disabled ? 'yes' : 'no' ?></td>
<td>
<select name="policy_disabled">
<option value="">--</option>
<option value="0">No</option>
<option value="1">Yes</option>
</select>
</td>
</tr>
</table>
<p />
<div class="textcenter">
<input type="submit" />
</div>
</form>
<?php
} else {
?>
<div class="warning">No policy selected</div>
<?php
}
# SQL Updates
} elseif ($_POST['frmaction'] == "change2") {
?>
<p class="pageheader">Policy Update Results</p>
<?php
$updates = array();
if (!empty($_POST['policy_name'])) {
array_push($updates,"Name = ".$db->quote($_POST['policy_name']));
}
if (isset($_POST['policy_priority']) && $_POST['policy_priority'] != "") {
array_push($updates,"Priority = ".$db->quote($_POST['policy_priority']));
}
if (!empty($_POST['policy_description'])) {
array_push($updates,"Description = ".$db->quote($_POST['policy_description']));
}
if (isset($_POST['policy_disabled']) && $_POST['policy_disabled'] != "") {
array_push($updates ,"Disabled = ".$db->quote($_POST['policy_disabled']));
}
# Check if we have updates
if (sizeof($updates) > 0) {
$updateStr = implode(', ',$updates);
$res = $db->exec("UPDATE ${DB_TABLE_PREFIX}policies SET $updateStr WHERE ID = ".$db->quote($_POST['policy_id']));
if ($res) {
?>
<div class="notice">Policy updated</div>
<?php
} else {
?>
<div class="warning">Error updating policy!</div>
<div class="warning"><?php print_r($db->errorInfo()) ?></div>
<?php
}
} else {
?>
<div class="warning">No changes made to policy</div>
<?php
}
} else {
?>
<div class="warning">Invalid invocation</div>
<?php
}
printFooter();
# vim: ts=4
?>
<?php
# Policy group change
# 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 groups" => "policy-group-main.php"
),
));
# Display change screen
if ($_POST['frmaction'] == "change") {
# Check a policy was selected
if (isset($_POST['policy_group_id'])) {
# Prepare statement
$stmt = $db->prepare("SELECT ID, Name, Disabled FROM ${DB_TABLE_PREFIX}policy_groups WHERE ID = ?");
?>
<p class="pageheader">Update Policy Group</p>
<form action="policy-group-change.php" method="post">
<div>
<input type="hidden" name="frmaction" value="change2" />
<input type="hidden" name="policy_group_id" value="<?php echo $_POST['policy_group_id']; ?>" />
</div>
<?php
$res = $stmt->execute(array($_POST['policy_group_id']));
$row = $stmt->fetchObject();
$stmt->closeCursor();
?>
<table class="entry" style="width: 75%;">
<tr>
<td></td>
<td class="entrytitle textcenter">Old Value</td>
<td class="entrytitle textcenter">New Value</td>
</tr>
<tr>
<td class="entrytitle">Name</td>
<td class="oldval"><?php echo $row->name ?></td>
<td><input type="text" name="policy_group_name" /></td>
</tr>
<tr>
<td class="entrytitle">Disabled</td>
<td class="oldval"><?php echo $row->disabled ? 'yes' : 'no' ?></td>
<td>
<select name="policy_group_disabled" />
<option value="">--</option>
<option value="0">No</option>
<option value="1">Yes</option>
</select>
</td>
</tr>
</table>
<p />
<div class="textcenter">
<input type="submit" />
</div>
</form>
<?php
} else {
?>
<div class="warning">No policy selected</div>
<?php
}
# SQL Updates
} elseif ($_POST['frmaction'] == "change2") {
?>
<p class="pageheader">Policy Group Update Results</p>
<?php
$updates = array();
if (!empty($_POST['policy_group_name'])) {
array_push($updates,"Name = ".$db->quote($_POST['policy_group_name']));
}
if (isset($_POST['policy_group_disabled']) && $_POST['policy_group_disabled'] != "") {
array_push($updates ,"Disabled = ".$db->quote($_POST['policy_group_disabled']));
}
# Check if we have updates
if (sizeof($updates) > 0) {
$updateStr = implode(', ',$updates);
$res = $db->exec("UPDATE ${DB_TABLE_PREFIX}policy_groups SET $updateStr WHERE ID = ".$db->quote($_POST['policy_group_id']));
if ($res) {
?>
<div class="notice">Policy group updated</div>
<?php
} else {
?>
<div class="warning">Error updating policy group!</div>
<div class="warning"><?php print_r($db->errorInfo()) ?></div>
<?php
}
} else {
?>
<div class="warning">No changes made to policy group</div>
<?php
}
} else {
?>
<div class="warning">Invalid invocation</div>
<?php
}
printFooter();
# vim: ts=4
?>
<?php
# Policy group member 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 groups" => "policy-group-main.php",
"Back to members" => "policy-group-member-main.php?policy_group_id=".$_POST['policy_group_id'],
),
));
if ($_POST['frmaction'] == "add") {
?>
<p class="pageheader">Add Policy Group Member</p>
<?php
?>
<form method="post" action="policy-group-member-add.php">
<div>
<input type="hidden" name="frmaction" value="add2" />
<input type="hidden" name="policy_group_id" value="<?php echo $_POST['policy_group_id'] ?>" />
</div>
<table class="entry">
<tr>
<td class="entrytitle">
Member
<?php tooltip('policy_group_member'); ?>
</td>
<td><input type="text" name="policy_group_member_member" /></td>
</tr>
<tr>
<td class="entrytitle">Comment</td>
<td><textarea name="policy_group_member_comment" 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 Group Member Add Results</p>
<?php
$stmt = $db->prepare("INSERT INTO ${DB_TABLE_PREFIX}policy_group_members (PolicyGroupID,Member,Comment,Disabled) VALUES (?,?,?,1)");
$res = $stmt->execute(array(
$_POST['policy_group_id'],
$_POST['policy_group_member_member'],
$_POST['policy_group_member_comment']
));
if ($res) {
?>
<div class="notice">Policy group member created</div>
<?php
} else {
?>
<div class="warning">Failed to create policy group member</div>
<div class="warning"><?php print_r($stmt->errorInfo()) ?></div>
<?php
}
} else {
?>
<div class="warning">Invalid invocation</div>
<?php
}
printFooter();
# vim: ts=4
?>
<?php
# Policy group member change
# 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 groups" => "policy-group-main.php",
"Back to members" => "policy-group-member-main.php?policy_group_id=".$_POST['policy_group_id'],
),
));
# Display change screen
if ($_POST['frmaction'] == "change") {
# Check a policy was selected
if (isset($_POST['policy_group_member_id'])) {
# Prepare statement
$stmt = $db->prepare("SELECT ID, Member, Comment, Disabled FROM ${DB_TABLE_PREFIX}policy_group_members WHERE ID = ?");
?>
<p class="pageheader">Update Policy Group Member</p>
<form action="policy-group-member-change.php" method="post">
<div>
<input type="hidden" name="frmaction" value="change2" />
<input type="hidden" name="policy_group_id" value="<?php echo $_POST['policy_group_id']; ?>" />
<input type="hidden" name="policy_group_member_id" value="<?php echo $_POST['policy_group_member_id']; ?>" />
</div>
<?php
$res = $stmt->execute(array($_POST['policy_group_member_id']));
$row = $stmt->fetchObject();
$stmt->closeCursor();
?>
<table class="entry" style="width: 75%;">
<tr>
<td></td>
<td class="entrytitle textcenter">Old Value</td>
<td class="entrytitle textcenter">New Value</td>
</tr>
<tr>
<td class="entrytitle">
Member
<?php tooltip('policy_group_member'); ?>
</td>
<td class="oldval"><?php echo $row->member ?></td>
<td><input type="text" name="policy_group_member_member" /></td>
</tr>
<tr>
<td class="entrytitle texttop">Comment</td>
<td class="oldval texttop"><?php echo $row->comment ?></td>
<td><textarea name="policy_group_member_comment" cols="40" rows="5"></textarea></td>
</tr>
<tr>
<td class="entrytitle">Disabled</td>
<td class="oldval"><?php echo $row->disabled ? 'yes' : 'no' ?></td>
<td>
<select name="policy_group_member_disabled">
<option value="">--</option>
<option value="0">No</option>
<option value="1">Yes</option>
</select>
</td>
</tr>
</table>
<p />
<div class="textcenter">
<input type="submit" />
</div>
</form>
<?php
} else {
?>
<div class="warning">No policy selected</div>
<?php
}
# SQL Updates
} elseif ($_POST['frmaction'] == "change2") {
?>
<p class="pageheader">Policy Group Member Update Results</p>
<?php
$updates = array();
if (!empty($_POST['policy_group_member_member'])) {
array_push($updates,"Member = ".$db->quote($_POST['policy_group_member_member']));
}
if (!empty($_POST['policy_group_member_comment'])) {
array_push($updates,"Comment = ".$db->quote($_POST['policy_group_member_comment']));
}
if (isset($_POST['policy_group_member_disabled']) && $_POST['policy_group_member_disabled'] != "") {
array_push($updates ,"Disabled = ".$db->quote($_POST['policy_group_member_disabled']));
}
# Check if we have updates
if (sizeof($updates) > 0) {
$updateStr = implode(', ',$updates);
$res = $db->exec("UPDATE ${DB_TABLE_PREFIX}policy_group_members SET $updateStr WHERE ID = ".$db->quote($_POST['policy_group_member_id']));
if ($res) {
?>
<div class="notice">Policy group member updated</div>
<?php
} else {
?>
<div class="warning">Error updating policy group member!</div>
<div class="warning"><?php print_r($db->errorInfo()) ?></div>
<?php
}
} else {
?>
<div class="warning">No changes made to policy group member</div>
<?php
}
} else {
?>
<div class="warning">Invalid invocation</div>
<?php
}
printFooter();
# vim: ts=4
?>