summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2001-02-21 23:48:19 +0000
committerivan <ivan>2001-02-21 23:48:19 +0000
commit4930644974239211b217a6241781db91808a3778 (patch)
treea74726e5474cc45d6c3ca438df23ebb42c2e14c0
parent57f343771fff31b1a5e98c2c220bb43fd7eeca2c (diff)
add icradius_secrets config file to export to a non-Freeside MySQL database for
ICRADIUS
-rwxr-xr-xbin/svc_acct.export18
-rw-r--r--htdocs/docs/config.html1
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
<li><a name="icradiusmachines">icradiusmachines</a> - Your <a href="ftp://ftp.cheapnet.net/pub/icradius">ICRADIUS</a> 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: "<CODE>radius.isp.tld&nbsp;radius_db&nbsp;radius_user&nbsp;passw0rd</CODE>". Note that to use ICRADIUS export you need to be using MySQL.
<li><a name="icradius_mysqldest">icradius_mysqldest</a> - Destination directory for the MySQL databases, on the ICRADIUS machines. Defaults to "/usr/local/var/".
<li><a name="icradius_mysqlsource">icradius_mysqlsource</a> - Source directory for for the MySQL radcheck table files, on the Freeside machine. Defaults to "/usr/local/var/freeside".
+ <li><a name="icradius_secrets">icradius_secrets</a> - 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 <a href="#icradius_mysqlsource">icradius_mysqlsource</a> directory. Three lines: DBI data source, username and password. This file should not be world readable.
<li><a name="invoice_from">invoice_from</a> - Return address on email invoices.
<li><a name="invoice_template">invoice_template</a> - Required template file for invoices. See the <a href="billing.html">section on billing</a> for details.
<li><a name="lpr">lpr</a> - Print command for paper invoices, for example `lpr -h'.