aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorAlexander Wilke <nachtfalkeaw@web.de>2011-12-20 21:13:52 +0000
committerAlexander Wilke <nachtfalkeaw@web.de>2011-12-20 21:13:52 +0000
commite0ae5992698e3d8560d4b782b4d6d2a265217e16 (patch)
treef9a8dc07064e27a1e57ba259f61d0f16eded6f43 /config
parent7f1becd1b46bb93d5caa642598e13aacb6c85fc5 (diff)
downloadpfsense-packages-e0ae5992698e3d8560d4b782b4d6d2a265217e16.tar.gz
pfsense-packages-e0ae5992698e3d8560d4b782b4d6d2a265217e16.tar.bz2
pfsense-packages-e0ae5992698e3d8560d4b782b4d6d2a265217e16.zip
Added tab to view freeradius config files
Diffstat (limited to 'config')
-rwxr-xr-x[-rw-r--r--]config/freeradius2/freeradius.inc0
-rw-r--r--config/freeradius2/freeradius.xml9
-rw-r--r--config/freeradius2/freeradius_view_config.php144
-rw-r--r--config/freeradius2/freeradiusclients.xml4
-rw-r--r--config/freeradius2/freeradiuseapconf.xml4
-rw-r--r--config/freeradius2/freeradiusinterfaces.xml4
-rw-r--r--[-rwxr-xr-x]config/freeradius2/freeradiussettings.xml4
-rw-r--r--config/freeradius2/freeradiussqlconf.xml4
8 files changed, 173 insertions, 0 deletions
diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc
index ad113469..ad113469 100644..100755
--- a/config/freeradius2/freeradius.inc
+++ b/config/freeradius2/freeradius.inc
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,8 +89,17 @@
<text>SQL</text>
<url>/pkg_edit.php?xml=freeradiussqlconf.xml&amp;id=0</url>
</tab>
+ <tab>
+ <text>View config</text>
+ <url>/freeradius_view_config.php</url>
+ </tab>
</tabs>
<additional_files_needed>
+ <prefix>/usr/local/www/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.org/packages/config/freeradius2/freeradius_view_config.php</item>
+ </additional_files_needed>
+ <additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
<chmod>0755</chmod>
<item>http://www.pfsense.org/packages/config/freeradius2/freeradiusclients.xml</item>
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 @@
+<?php
+/*
+ postfix_view_config.php
+ part of pfSense (http://www.pfsense.com/)
+ Copyright (C) 2011 Marcello Coutinho <marcellocoutinho@gmail.com>
+ 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 '<textarea rows="50" cols="100%">';
+ print $files[$file]."\n".file_get_contents($files[$file]);
+ print '</textarea>';
+ }
+}
+
+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");
+
+ ?>
+ <body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+ <?php include("fbegin.inc"); ?>
+
+ <?php if($one_two): ?>
+ <p class="pgtitle"><?=$pgtitle?></font></p>
+ <?php endif; ?>
+
+ <?php if ($savemsg) print_info_box($savemsg); ?>
+
+ <form action="freeradius_view_config.php" method="post">
+
+ <div id="mainlevel">
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr><td>
+ <?php
+ $tab_array = array();
+ $tab_array[] = array(gettext("Users"), false, "/pkg.php?xml=freeradius.xml");
+ $tab_array[] = array(gettext("NAS / Clients"), false, "/pkg.php?xml=freeradiusclients.xml");
+ $tab_array[] = array(gettext("Interfaces"), false, "/pkg.php?xml=freeradiusinterfaces.xml");
+ $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeradiussettings.xml&id=0");
+ $tab_array[] = array(gettext("EAP"), false, "/pkg_edit.php?xml=freeradiuseapconf.xml&id=0");
+ $tab_array[] = array(gettext("SQL"), false, "/pkg_edit.php?xml=freeradiussqlconf.xml&id=0");
+ $tab_array[] = array(gettext("View config"), true, "/freeradius_view_config.php");
+ display_top_tabs($tab_array);
+ ?>
+ </td></tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="8" cellspacing="0">
+ <tr><td></td></tr>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("View freeRADIUS configuration files"); ?></td></tr>
+ <tr><td></td></tr>
+ </tr>
+ <tr>
+ <td class="tabcont" >
+ <input type="button" onClick="get_freeradius_file('eap');" id='btn_eap' value="eap.conf">&nbsp;
+ <input type="button" onClick="get_freeradius_file('sql');" id='btn_sql' value="sql.conf">&nbsp;
+ <input type="button" onClick="get_freeradius_file('clients');" id='btn_clients' value="clients.conf">&nbsp;
+ <input type="button" onClick="get_freeradius_file('users');" id='btn_users' value="users">&nbsp;
+ <input type="button" onClick="get_freeradius_file('virtual-server-default');" id='btn_virtual-server-default' value="default">&nbsp;
+ </td>
+ </tr>
+ <tr>
+ <td class="tabcont" >
+ <div id="file_div"></div>
+
+ </td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </form>
+ <script type="text/javascript">
+ function get_freeradius_file(file) {
+ $('btn_'+file).value="reading...";
+ var pars = 'file='+file;
+ var url = "/freeradius_view_config.php";
+ var myAjax = new Ajax.Request(
+ url,
+ {
+ method: 'post',
+ parameters: pars,
+ onComplete: activitycallback_postfix_file
+ });
+ }
+ function activitycallback_postfix_file(transport) {
+ $('file_div').innerHTML = transport.responseText;
+ $('btn_eap').value="eap.conf";
+ $('btn_sql').value="sql.conf";
+ $('btn_clients').value="clients.conf";
+ $('btn_users').value="users";
+ $('btn_virtual').value="default";
+ scroll(0,0);
+ }
+ </script>
+ <?php
+ include("fend.inc");
+ }
+ ?>
+ </body>
+ </html>
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 @@
<text>SQL</text>
<url>/pkg_edit.php?xml=freeradiussqlconf.xml&amp;id=0</url>
</tab>
+ <tab>
+ <text>View config</text>
+ <url>/freeradius_view_config.php</url>
+ </tab>
</tabs>
<adddeleteeditpagefields>
<columnitem>
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 @@
<text>SQL</text>
<url>/pkg_edit.php?xml=freeradiussqlconf.xml&amp;id=0</url>
</tab>
+ <tab>
+ <text>View config</text>
+ <url>/freeradius_view_config.php</url>
+ </tab>
</tabs>
<fields>
<field>
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 @@
<text>SQL</text>
<url>/pkg_edit.php?xml=freeradiussqlconf.xml&amp;id=0</url>
</tab>
+ <tab>
+ <text>View config</text>
+ <url>/freeradius_view_config.php</url>
+ </tab>
</tabs>
<adddeleteeditpagefields>
<columnitem>
diff --git a/config/freeradius2/freeradiussettings.xml b/config/freeradius2/freeradiussettings.xml
index 2f4189fd..25a9a2dd 100755..100644
--- a/config/freeradius2/freeradiussettings.xml
+++ b/config/freeradius2/freeradiussettings.xml
@@ -76,6 +76,10 @@
<text>SQL</text>
<url>/pkg_edit.php?xml=freeradiussqlconf.xml&amp;id=0</url>
</tab>
+ <tab>
+ <text>View config</text>
+ <url>/freeradius_view_config.php</url>
+ </tab>
</tabs>
<fields>
<field>
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 @@
<url>/pkg_edit.php?xml=freeradiussqlconf.xml&amp;id=0</url>
<active/>
</tab>
+ <tab>
+ <text>View config</text>
+ <url>/freeradius_view_config.php</url>
+ </tab>
</tabs>
<fields>
<field>