diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-02-18 23:42:04 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-02-18 23:42:04 +0000 |
commit | 504d24c4e316cb8cba7a1d045b09284159b704c6 (patch) | |
tree | 296bc8df5ba7e295fc34aa2425a5285abd24b455 | |
parent | 2f2f88fa02ae7d90c51e92dbdfe7f6528345a485 (diff) | |
download | pfsense-packages-504d24c4e316cb8cba7a1d045b09284159b704c6.tar.gz pfsense-packages-504d24c4e316cb8cba7a1d045b09284159b704c6.tar.bz2 pfsense-packages-504d24c4e316cb8cba7a1d045b09284159b704c6.zip |
Update colin's FreeRADIUS packag
-rw-r--r-- | packages/freeradius.xml | 38 | ||||
-rw-r--r-- | packages/freeradiusclients.xml | 29 |
2 files changed, 50 insertions, 17 deletions
diff --git a/packages/freeradius.xml b/packages/freeradius.xml index 68d6eb38..fd0e0be1 100644 --- a/packages/freeradius.xml +++ b/packages/freeradius.xml @@ -1,19 +1,29 @@ <packagegui> <name>freeradius</name> <menu> - <name>RADIUS Users</name> - <tooltiptext>Add, edit, and delete RADIUS users.</tooltiptext> + <name>FreeRADIUS</name> + <tooltiptext>Modify FreeRADIUS users, clients, and settings.</tooltiptext> <section>Services</section> <configfile>freeradius.xml</configfile> </menu> - <menu> - <name>RADIUS Clients</name> - <tooltiptext>Add, edit, and delete RADIUS clients.</tooltiptext> - <section>Services</section> - <configfile>freeradiusclients.xml</configfile> - </menu> + <tabs> + <tab> + <text>Users</text> + <url>/pkg_edit.php?xml=freeradius.xml</url> + <active/> + </tab> + <tab> + <text>Clients</text> + <url>/pkg_edit.php?xml=freeradiusclients.xml</url> + </tab> + <tab> + <text>Settings</text> + <url>/pkg_edit.php?xml=freeradiussettings.xml</url> + </tab> + </tabs> <additional_files_needed> <item>http://www.pfsense.com/packages/config/freeradiusclients.xml</item> + <item>http://www.pfsense.com/packages/config/freeradiussettings.xml</item> </additional_files_needed> <configpath>installedpackages->package->$packagename->configuration->settings</configpath> <adddeleteeditpagefields> @@ -46,6 +56,18 @@ <type>input</type> </field> </fields> + <custom_php_install_command> + global $config; + $fout = fopen("/usr/local/etc/raddb/clients.conf","w"); + fwrite($fout, "client 127.0.0.1" . "{\n" . "secret = pfsense\n" . "shortname = localhost\n}\n\n"); + fclose($fout); + mwexec("rm /usr/local/etc/rc.d/radiusd*"); + $fout = fopen("/usr/local/etc/rc.d/radiusd.sh","w"); + fwrite($fout,"#!/bin/sh\n\n/usr/local/sbin/radiusd -d /usr/local/etc/raddb\n"); + fclose($fout); + mwexec("chmod a+x /usr/local/etc/rc.d/radiusd.sh"); + mwexec("/usr/local/etc/rc.d/radiusd.sh"); + </custom_php_install_command> <custom_php_command_before_form> function sync_package() { diff --git a/packages/freeradiusclients.xml b/packages/freeradiusclients.xml index 61fbe5bc..89598ac1 100644 --- a/packages/freeradiusclients.xml +++ b/packages/freeradiusclients.xml @@ -6,6 +6,21 @@ <section>Services</section> <configfile>freeradiusclients.xml</configfile> </menu> + <tabs> + <tab> + <text>Users</text> + <url>/pkg_edit.php?xml=freeradius.xml</url> + </tab> + <tab> + <text>Clients</text> + <url>/pkg_edit.php?xml=freeradiusclients.xml</url> + <active/> + </tab> + <tab> + <text>Settings</text> + <url>/pkg_edit.php?xml=freeradiussettings.xml</url> + </tab> + </tabs> <configpath>installedpackages->package->$packagename->configuration->settings</configpath> <adddeleteeditpagefields> <columnitem> @@ -34,10 +49,12 @@ <description>Enter the client's shortname here</description> <type>input</type> </field> + <field> <fielddescr>Shared Secret</fielddescr> <fieldname>sharedsecret</fieldname> <description>Enter the client's shared secret here</description> <type>password</type> + </field> <field> <fielddescr>Description</fielddescr> <fieldname>description</fieldname> @@ -45,19 +62,13 @@ <type>input</type> </field> </fields> - <custom_php_install_command> - global $config; - system("rm /usr/local/etc/raddb/clients*"); - $fout = fopen("/usr/local/etc/raddb/clients.conf","w"); - fwrite($fout, "client 127.0.0.1 {\n secret = pfsense\n shortname = localhost\n}\n\n"); - fclose($fout); - </custom_php_install_command> <custom_php_command_before_form> function sync_package() { global $config; $fout = fopen("/usr/local/etc/raddb/clients.conf","w"); - if($config['installedpackages']['freeradius']['config'] != "") { - foreach($config['installedpackages']['freeradius']['config'] as $rowhelper) { + if($config['installedpackages']['freeradiusclients']['config'] != "") { + fwrite($fout, "client 127.0.0.1" . "{\n" . "secret = pfsense\n" . "shortname = localhost\n}\n\n"); + foreach($config['installedpackages']['freeradiusclients']['config'] as $rowhelper) { fwrite($fout, "client " . $rowhelper['client'] . "{\n" . "secret = " . $rowhelper['sharedsecret'] . "\nshortname = " . $rowhelper['shortname'] . "\n}\n\n"); } } |