From e0ae5992698e3d8560d4b782b4d6d2a265217e16 Mon Sep 17 00:00:00 2001 From: Alexander Wilke Date: Tue, 20 Dec 2011 21:13:52 +0000 Subject: Added tab to view freeradius config files --- config/freeradius2/freeradius.inc | 0 config/freeradius2/freeradius.xml | 9 ++ config/freeradius2/freeradius_view_config.php | 144 ++++++++++++++++++++++++++ config/freeradius2/freeradiusclients.xml | 4 + config/freeradius2/freeradiuseapconf.xml | 4 + config/freeradius2/freeradiusinterfaces.xml | 4 + config/freeradius2/freeradiussettings.xml | 4 + config/freeradius2/freeradiussqlconf.xml | 4 + 8 files changed, 173 insertions(+) mode change 100644 => 100755 config/freeradius2/freeradius.inc create mode 100644 config/freeradius2/freeradius_view_config.php mode change 100755 => 100644 config/freeradius2/freeradiussettings.xml (limited to 'config/freeradius2') diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc old mode 100644 new mode 100755 diff --git a/config/freeradius2/freeradius.xml b/config/freeradius2/freeradius.xml index 674a6266..78a0d984 100644 --- a/config/freeradius2/freeradius.xml +++ b/config/freeradius2/freeradius.xml @@ -89,7 +89,16 @@ SQL /pkg_edit.php?xml=freeradiussqlconf.xml&id=0 + + View config + /freeradius_view_config.php + + + /usr/local/www/ + 0755 + http://www.pfsense.org/packages/config/freeradius2/freeradius_view_config.php + /usr/local/pkg/ 0755 diff --git a/config/freeradius2/freeradius_view_config.php b/config/freeradius2/freeradius_view_config.php new file mode 100644 index 00000000..9db6a682 --- /dev/null +++ b/config/freeradius2/freeradius_view_config.php @@ -0,0 +1,144 @@ + + based on varnish_view_config. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +require("guiconfig.inc"); +function get_file($file){ + $files['eap']="/usr/local/etc/raddb/eap.conf"; + $files['sql']="/usr/local/etc/raddb/sql.conf"; + $files['clients']="/usr/local/etc/raddb/clients.conf"; + $files['users']="/usr/local/etc/raddb/users"; + $files['virtual-server-default']="/usr/local/etc/raddb/sites-enabled/default"; + + + if ($files[$file]!="" && file_exists($files[$file])){ + print ''; + } +} + +if ($_REQUEST['file']!=""){ + get_file($_REQUEST['file']); + } +else{ + $pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); + if(strstr($pfSversion, "1.2")) + $one_two = true; + + $pgtitle = "Services: freeRADIUS View Configuration"; + include("head.inc"); + + ?> + + + + +

+ + + + +
+ +
+ + + + + +
+ +
+
+ + + + + + + + + + + + +
+   +   +   +   +   +
+
+ +
+
+
+
+
+ + + + diff --git a/config/freeradius2/freeradiusclients.xml b/config/freeradius2/freeradiusclients.xml index cf18458c..b88eccf8 100644 --- a/config/freeradius2/freeradiusclients.xml +++ b/config/freeradius2/freeradiusclients.xml @@ -75,6 +75,10 @@ SQL /pkg_edit.php?xml=freeradiussqlconf.xml&id=0 + + View config + /freeradius_view_config.php + diff --git a/config/freeradius2/freeradiuseapconf.xml b/config/freeradius2/freeradiuseapconf.xml index 00aaf3bc..f427ab84 100644 --- a/config/freeradius2/freeradiuseapconf.xml +++ b/config/freeradius2/freeradiuseapconf.xml @@ -76,6 +76,10 @@ SQL /pkg_edit.php?xml=freeradiussqlconf.xml&id=0 + + View config + /freeradius_view_config.php + diff --git a/config/freeradius2/freeradiusinterfaces.xml b/config/freeradius2/freeradiusinterfaces.xml index cfc8cb14..a50cf8b1 100644 --- a/config/freeradius2/freeradiusinterfaces.xml +++ b/config/freeradius2/freeradiusinterfaces.xml @@ -75,6 +75,10 @@ SQL /pkg_edit.php?xml=freeradiussqlconf.xml&id=0 + + View config + /freeradius_view_config.php + diff --git a/config/freeradius2/freeradiussettings.xml b/config/freeradius2/freeradiussettings.xml old mode 100755 new mode 100644 index 2f4189fd..25a9a2dd --- a/config/freeradius2/freeradiussettings.xml +++ b/config/freeradius2/freeradiussettings.xml @@ -76,6 +76,10 @@ SQL /pkg_edit.php?xml=freeradiussqlconf.xml&id=0 + + View config + /freeradius_view_config.php + diff --git a/config/freeradius2/freeradiussqlconf.xml b/config/freeradius2/freeradiussqlconf.xml index c8af86d6..15e9ee76 100644 --- a/config/freeradius2/freeradiussqlconf.xml +++ b/config/freeradius2/freeradiussqlconf.xml @@ -76,6 +76,10 @@ /pkg_edit.php?xml=freeradiussqlconf.xml&id=0 + + View config + /freeradius_view_config.php + -- cgit v1.2.3