diff options
-rw-r--r-- | FS/bin/freeside-adduser | 15 | ||||
-rw-r--r-- | Makefile | 20 | ||||
-rw-r--r-- | conf/address | 4 | ||||
-rw-r--r-- | conf/domain | 1 | ||||
-rw-r--r-- | conf/secrets | 3 | ||||
-rw-r--r-- | conf/shells | 5 | ||||
-rw-r--r-- | conf/smtpmachine | 2 | ||||
-rw-r--r-- | httemplate/docs/install.html | 6 |
8 files changed, 26 insertions, 30 deletions
diff --git a/FS/bin/freeside-adduser b/FS/bin/freeside-adduser index e66b0d012..7fc5830db 100644 --- a/FS/bin/freeside-adduser +++ b/FS/bin/freeside-adduser @@ -1,16 +1,15 @@ #!/usr/bin/perl -w # -# $Id: freeside-adduser,v 1.2 2001-10-30 11:47:54 ivan Exp $ +# $Id: freeside-adduser,v 1.3 2001-10-30 13:47:07 ivan Exp $ use strict; -use vars qw($opt_h $opt_c); +use vars qw($opt_h $opt_c $opt_s); use Getopt::Std; my $FREESIDE_CONF = "/usr/local/etc/freeside"; -getopts("ch:"); +getopts("ch:s:"); die &usage if $opt_c && ! $opt_h; -my $secretfile = shift or die &usage; my $user = shift or die &usage; my @args = ( 'htpasswd' ); @@ -18,13 +17,15 @@ push @args, '-c' if $opt_c; push @args, $opt_h, $user; system(@args) == 0 or die "htpasswd failed: $?"; +my $secretfile = $opt_s || 'secrets'; + open(MAPSECRETS,">>$FREESIDE_CONF/mapsecrets") or die "can't open $FREESIDE_CONF/mapsecrets: $!"; print MAPSECRETS "$user $secretfile\n"; close MAPSECRETS or die "can't close $FREESIDE_CONF/mapsecrets: $!"; sub usage { - die "Usage:\n\n freeside-adduser [ -h htpasswd_file [ -c ] ] secretfile username" + die "Usage:\n\n freeside-adduser [ -h htpasswd_file [ -c ] ] [ -s secretfile ] username" } =head1 NAME @@ -33,7 +34,7 @@ freeside-adduser - Command line interface to add (freeside) users. =head1 SYNOPSIS - freeside-adduser [ -h htpasswd_file [ -c ] ] secretfile username + freeside-adduser [ -h htpasswd_file [ -c ] ] [ -s secretfile ] username =head1 DESCRIPTION @@ -44,6 +45,8 @@ sales/tech folks) to the web interface, not for adding customer accounts. -c: Passed to htpasswd + -s: Specify an alternate secret file + =head1 SEE ALSO L<htpasswd>, base Freeside documentation @@ -43,7 +43,7 @@ docs: make ${TEMPLATE}docs install-docs: docs - mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` + [ -e ${FREESIDE_DOCUMENT_ROOT} ] && mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` cp -r ${TEMPLATE}docs ${FREESIDE_DOCUMENT_ROOT} perl-modules: @@ -64,7 +64,8 @@ create-database: perl -e 'use DBIx::DataSource qw( create_database ); create_database( \'${DATASOURCE}\', \'${DB_USER}\', \'${DB_PASSWORD}\' ) or die $DBIx::DataSource::errstr;' create-config: install-perl-modules - [ -d ${FREESIDE_CONF} ] || mkdir ${FREESIDE_CONF} + [ -e ${FREESIDE_CONF} ] || mv ${FREESIDE_CONF} ${FREESIDE_CONF}.`date +%Y%m%d%H%M%S` + mkdir ${FREESIDE_CONF} chown freeside ${FREESIDE_CONF} touch ${FREESIDE_CONF}/secrets @@ -75,20 +76,17 @@ create-config: install-perl-modules chmod 600 ${FREESIDE_CONF}/secrets chown freeside ${FREESIDE_CONF}/secrets - [ -d "${FREESIDE_CONF}/conf.${DATASOURCE}" ] \ - || mkdir "${FREESIDE_CONF}/conf.${DATASOURCE}" - chown freeside "${FREESIDE_CONF}/conf.${DATASOURCE}" + mkdir "${FREESIDE_CONF}/conf.${DATASOURCE}" + cp conf/* "${FREESIDE_CONF}/conf.${DATASOURCE}" + chown -R freeside "${FREESIDE_CONF}/conf.${DATASOURCE}" - [ -d "${FREESIDE_CONF}/counters.${DATASOURCE}" ] \ - || mkdir "${FREESIDE_CONF}/counters.${DATASOURCE}" + mkdir "${FREESIDE_CONF}/counters.${DATASOURCE}" chown freeside "${FREESIDE_CONF}/counters.${DATASOURCE}" - [ -d "${FREESIDE_CONF}/cache.${DATASOURCE}" ] \ - || mkdir "${FREESIDE_CONF}/cache.${DATASOURCE}" + mkdir "${FREESIDE_CONF}/cache.${DATASOURCE}" chown freeside "${FREESIDE_CONF}/cache.${DATASOURCE}" - [ -d "${FREESIDE_CONF}/export.${DATASOURCE}" ] \ - || mkdir "${FREESIDE_CONF}/export.${DATASOURCE}" + mkdir "${FREESIDE_CONF}/export.${DATASOURCE}" chown freeside "${FREESIDE_CONF}/export.${DATASOURCE}" clean: diff --git a/conf/address b/conf/address deleted file mode 100644 index 62ec516ea..000000000 --- a/conf/address +++ /dev/null @@ -1,4 +0,0 @@ -Silicon Interactive Software Design -15 Skyview Way -Newtown, PA 18940 - diff --git a/conf/domain b/conf/domain deleted file mode 100644 index b3cefaf74..000000000 --- a/conf/domain +++ /dev/null @@ -1 +0,0 @@ -domain.tld diff --git a/conf/secrets b/conf/secrets deleted file mode 100644 index 5843943ac..000000000 --- a/conf/secrets +++ /dev/null @@ -1,3 +0,0 @@ -DBI:mysql:freeside -freeside -put_your_password_here diff --git a/conf/shells b/conf/shells index 02d74f7fc..a41fc6209 100644 --- a/conf/shells +++ b/conf/shells @@ -1,2 +1,5 @@ -/bin/csh + /bin/sh +/bin/csh +/bin/bash +/bin/false diff --git a/conf/smtpmachine b/conf/smtpmachine index fa7963cc9..2fbb50c4a 100644 --- a/conf/smtpmachine +++ b/conf/smtpmachine @@ -1 +1 @@ -mail +localhost diff --git a/httemplate/docs/install.html b/httemplate/docs/install.html index 1d6022ba3..b5df9b1cc 100644 --- a/httemplate/docs/install.html +++ b/httemplate/docs/install.html @@ -142,12 +142,12 @@ require valid-user <ul> <li>First user:<font size="-1"> <pre>$ su -$ freeside-adduser -h /usr/local/etc/freeside/htpasswd -c /usr/local/etc/freeside/secrets <i>username</i></pre></font> +$ freeside-adduser -c -h /usr/local/etc/freeside/htpasswd <i>username</i></pre></font> <li>Additional users:<font size="-1"> <pre>$ su -$ freeside-adduser -h /usr/local/etc/freeside/htpasswd /usr/local/etc/freeside/secrets <i>username</i></pre></font> +$ freeside-adduser -h /usr/local/etc/freeside/htpasswd <i>username</i></pre></font> </ul> - <i>(using other auth types, add each user to your <a href="http://httpd.apache.org/docs/misc/FAQ.html#user-authentication">Apache authentication</a> yand then run: <tt>freeside-adduser /usr/local/etc/freeside/secrets <b>username</b></tt></i> + <i>(using other auth types, add each user to your <a href="http://httpd.apache.org/docs/misc/FAQ.html#user-authentication">Apache authentication</a> and then run: <tt>freeside-adduser <b>username</b></tt></i> <li>As the freeside UNIX user, run <tt>bin/fs-setup <b>username</b></tt> to create the database tables, passing the username of a Freeside user you created above: <pre> $ su freeside |