From 4930644974239211b217a6241781db91808a3778 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 21 Feb 2001 23:48:19 +0000 Subject: [PATCH] add icradius_secrets config file to export to a non-Freeside MySQL database for ICRADIUS --- bin/svc_acct.export | 18 ++++++++++++++---- htdocs/docs/config.html | 1 + 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/bin/svc_acct.export b/bin/svc_acct.export index 636921a40..3280904f6 100755 --- a/bin/svc_acct.export +++ b/bin/svc_acct.export @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# $Id: svc_acct.export,v 1.16 2000-07-06 13:23:29 ivan Exp $ +# $Id: svc_acct.export,v 1.17 2001-02-21 23:48:19 ivan Exp $ # # Create and export password files: passwd, passwd.adjunct, shadow, # acp_passwd, acp_userinfo, acp_dialup, users @@ -38,7 +38,11 @@ # ivan@sisd.com 98-sep-18 # # $Log: svc_acct.export,v $ -# Revision 1.16 2000-07-06 13:23:29 ivan +# Revision 1.17 2001-02-21 23:48:19 ivan +# add icradius_secrets config file to export to a non-Freeside MySQL database for +# ICRADIUS +# +# Revision 1.16 2000/07/06 13:23:29 ivan # tyop # # Revision 1.15 2000/07/06 08:57:28 ivan @@ -64,6 +68,7 @@ use strict; use vars qw($conf); use Fcntl qw(:flock); use IO::Handle; +use DBI; use FS::Conf; use FS::SSH qw(scp ssh); use FS::UID qw(adminsuidsetup datasrc dbh); @@ -98,8 +103,13 @@ my $icradius_mysqldest = my $icradius_mysqlsource = $conf->config('icradius_mysqlsource') || "/usr/local/var/freeside" if $icradiusmachines; -my $icradius_dbh = dbh; #could eventually get it from a config file if you're - #not running MySQL for your Freeside database +my $icradius_dbh; +if ( $icradiusmachines && $conf->exists('icradius_secrets') ) { + $icradius_dbh = DBI->connect($conf->config('icradius_secrets')) + or die $DBI::errstr;; +} else { + $icradius_dbh = dbh; +} my $textradiusprepend = $conf->config('textradiusprepend'); diff --git a/htdocs/docs/config.html b/htdocs/docs/config.html index bc6da6bf3..ea5172dcf 100644 --- a/htdocs/docs/config.html +++ b/htdocs/docs/config.html @@ -42,6 +42,7 @@ All further configuration files and directories are located in
  • icradiusmachines - Your ICRADIUS machines, one per line. The existance of this file (even if empty) turns on radcheck table creation (in the freeside database - the radcheck table needs to be created manually). Machines listed in this file will have the radcheck table exported to them. Each line of this file should contain four items, separted by whitespace: machine name, MySQL database name, MySQL username, and MySQL password. For example: "radius.isp.tld radius_db radius_user passw0rd". Note that to use ICRADIUS export you need to be using MySQL.
  • icradius_mysqldest - Destination directory for the MySQL databases, on the ICRADIUS machines. Defaults to "/usr/local/var/".
  • icradius_mysqlsource - Source directory for for the MySQL radcheck table files, on the Freeside machine. Defaults to "/usr/local/var/freeside". +
  • icradius_secrets - Optionally specifies a MySQL database for ICRADIUS export, if you're not running MySQL for your Freeside database. The database should be on the Freeside machine and store data in the icradius_mysqlsource directory. Three lines: DBI data source, username and password. This file should not be world readable.
  • invoice_from - Return address on email invoices.
  • invoice_template - Required template file for invoices. See the section on billing for details.
  • lpr - Print command for paper invoices, for example `lpr -h'. -- 2.11.0