aboutsummaryrefslogtreecommitdiffstats
path: root/packages/freeradiusclients.xml
diff options
context:
space:
mode:
Diffstat (limited to 'packages/freeradiusclients.xml')
-rw-r--r--packages/freeradiusclients.xml48
1 files changed, 17 insertions, 31 deletions
diff --git a/packages/freeradiusclients.xml b/packages/freeradiusclients.xml
index c24d01eb..d3dc95ec 100644
--- a/packages/freeradiusclients.xml
+++ b/packages/freeradiusclients.xml
@@ -1,6 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
<packagegui>
<name>freeradiusclients</name>
<title>FreeRADIUS: Clients</title>
+ <include_file>freeradius.inc</include_file>
<tabs>
<tab>
<text>Users</text>
@@ -16,7 +18,6 @@
<url>/pkg_edit.php?xml=freeradiussettings.xml&amp;id=0</url>
</tab>
</tabs>
- <configpath>installedpackages->package->$packagename->configuration->settings</configpath>
<adddeleteeditpagefields>
<columnitem>
<fielddescr>Client</fielddescr>
@@ -33,52 +34,37 @@
</adddeleteeditpagefields>
<fields>
<field>
- <fielddescr>Client</fielddescr>
<fieldname>client</fieldname>
- <description>Enter the client's IP address here</description>
+ <fielddescr>Client</fielddescr>
+ <description>Enter the client's IP address.</description>
<type>input</type>
+ <required/>
</field>
<field>
- <fielddescr>Shortname</fielddescr>
<fieldname>shortname</fieldname>
- <description>Enter the client's shortname here</description>
+ <fielddescr>Shortname</fielddescr>
+ <description>Enter the client's shortname.</description>
<type>input</type>
+ <required/>
</field>
<field>
- <fielddescr>Shared Secret</fielddescr>
<fieldname>sharedsecret</fieldname>
+ <fielddescr>Shared Secret</fielddescr>
<description>Enter the client's shared secret here</description>
<type>password</type>
+ <required/>
</field>
<field>
- <fielddescr>Description</fielddescr>
<fieldname>description</fieldname>
+ <fielddescr>Description</fielddescr>
<description>Enter the description of the user here</description>
<type>input</type>
</field>
</fields>
- <custom_php_command_before_form>
- function sync_package_freeradius_clients() {
- conf_mount_rw();
- config_lock();
- global $config;
- $fout = fopen("/usr/local/etc/raddb/clients.conf","w");
- fwrite($fout, "# This file was automatically generated by the pfSense\n# package management system.\n\n");
- fwrite($fout, "client 127.0.0.1" . "{\n" . "secret = pfsense\n" . "shortname = localhost\n}\n\n");
- if($config['installedpackages']['freeradiusclients']['config'] != "") {
- foreach($config['installedpackages']['freeradiusclients']['config'] as $rowhelper) {
- fwrite($fout, "client " . $rowhelper['client'] . "{\n" . "secret = " . $rowhelper['sharedsecret'] . "\nshortname = " . $rowhelper['shortname'] . "\n}\n\n");
- }
- }
- fclose($fout);
- conf_mount_ro();
- config_unlock();
- restart_service("freeradius");
- }
- sync_package_freeradius_clients();
- </custom_php_command_before_form>
- <custom_add_php_command>
- sync_package_freeradius_clients();
- </custom_add_php_command>
+ <custom_delete_php_command>
+ freeradius_clients_resync();
+ </custom_delete_php_command>
+ <custom_php_resync_config_command>
+ freeradius_clients_resync();
+ </custom_php_resync_config_command>
</packagegui>
-