preliminary web config editor
authorivan <ivan>
Wed, 24 Oct 2001 15:29:31 +0000 (15:29 +0000)
committerivan <ivan>
Wed, 24 Oct 2001 15:29:31 +0000 (15:29 +0000)
new config files: username-ampersand, passwordmax

fs-setup updates

get rid of old and crufty and unused registries/ config foo

documentation updates

21 files changed:
FS/FS.pm
FS/FS/Conf.pm
FS/FS/ConfItem.pm [new file with mode: 0644]
FS/FS/svc_acct.pm
FS/FS/svc_domain.pm
FS/MANIFEST
FS/t/ConfItem.t [new file with mode: 0644]
bin/fs-setup
bin/svc_acct.export
conf/registries/internic/from [deleted file]
conf/registries/internic/nameservers [deleted file]
conf/registries/internic/tech_contact [deleted file]
conf/registries/internic/template [deleted file]
conf/registries/internic/to [deleted file]
fs_webdemo/registerd.Pg
httemplate/config/config-process.cgi [new file with mode: 0644]
httemplate/config/config-view.cgi [new file with mode: 0644]
httemplate/docs/config.html
httemplate/docs/install.html
httemplate/index.html
httemplate/search/svc_acct.cgi

index d2c07e4..ca33300 100644 (file)
--- a/FS/FS.pm
+++ b/FS/FS.pm
@@ -21,6 +21,8 @@ Freeside ISP billing software.  This includes:
 
 L<FS::Conf> - Freeside configuration values
 
+L<FS::ConfItem> - Freeside configuration option meta-data.
+
 L<FS::UID> - User class (not yet OO)
 
 L<FS::CGI> - Non OO-subroutines for the web interface.  This is
@@ -141,7 +143,7 @@ The main documentation is in htdocs/docs.
 
 =head1 VERSION
 
-$Id: FS.pm,v 1.9 2001-09-26 09:17:06 ivan Exp $
+$Id: FS.pm,v 1.10 2001-10-24 15:29:30 ivan Exp $
 
 =head1 SUPPORT
 
index 7c6105b..615fdcb 100644 (file)
@@ -1,7 +1,10 @@
 package FS::Conf;
 
-use vars qw($default_dir);
+use vars qw($default_dir @config_items $DEBUG );
 use IO::File;
+use FS::ConfItem;
+
+$DEBUG = 0;
 
 =head1 NAME
 
@@ -22,6 +25,8 @@ FS::Conf - Read access to Freeside configuration values
   @list  = $conf->config('key');
   $bool  = $conf->exists('key');
 
+  @config_items = $conf->config_items;
+
 =head1 DESCRIPTION
 
 Read access to Freeside configuration values.  Keys currently map to filenames,
@@ -58,7 +63,8 @@ sub dir {
   -d $dir or die "FATAL: $dir isn't a directory!";
   -r $dir or die "FATAL: Can't read $dir!";
   -x $dir or die "FATAL: $dir not searchable (executable)!";
-  $dir;
+  $dir =~ /^(.*)$/;
+  $1;
 }
 
 =item config 
@@ -97,16 +103,589 @@ sub exists {
   -e "$dir/$file";
 }
 
+=item touch
+
+=cut
+
+sub touch {
+  my($self, $file) = @_;
+  my $dir = $self->dir;
+  unless ( $self->exists($file) ) {
+    warn "[FS::Conf] TOUCH $file\n" if $DEBUG;
+    system('touch', "$dir/$file");
+  }
+}
+
+=item set
+
+=cut
+
+sub set {
+  my($self, $file, $value) = @_;
+  my $dir = $self->dir;
+  $value =~ /^(.*)$/s;
+  $value = $1;
+  unless ( $self->config($file) eq $value ) {
+    warn "[FS::Conf] SET $file\n" if $DEBUG;
+    warn "$dir" if is_tainted($dir);
+    warn "$dir" if is_tainted($file);
+    my $fh = new IO::File ">$dir/$file" or return;
+    print $fh "$value\n";
+  }
+}
+sub is_tainted {
+             return ! eval { join('',@_), kill 0; 1; };
+         }
+
+=item delete
+
+=cut
+
+sub delete {
+  my($self, $file) = @_;
+  my $dir = $self->dir;
+  if ( $self->exists($file) ) {
+    warn "[FS::Conf] DELETE $file\n";
+    unlink "$dir/$file";
+  }
+}
+
+=item config_items
+
+Returns all of the possible configuration items as FS::ConfItem objects.  See
+L<FS::ConfItem>.
+
+=cut
+
+sub config_items {
+#  my $self = shift; 
+  @config_items;
+}
+
 =back
 
 =head1 BUGS
 
-Write access (with locking) should be implemented.
+Write access (touch, set, delete) should be documented.
+
+If this was more than just crud that will never be useful outside Freeside I'd
+worry that config_items is freeside-specific and icky.
 
 =head1 SEE ALSO
 
-config.html from the base documentation contains a list of configuration files.
+"Configuration" in the web interface (config/config.cgi).
+
+httemplate/docs/config.html
 
 =cut
 
+@config_items = map { new FS::ConfItem $_ } (
+
+  {
+    'key'         => 'address',
+    'section'     => 'depreciated',
+    'description' => 'This configuration file is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'apacheroot',
+    'section'     => 'apache',
+    'description' => 'The directory containing Apache virtual hosts',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'apachemachine',
+    'section'     => 'apache',
+    'description' => 'A machine with the apacheroot directory and user home directories.  The existance of this file enables setup of virtual host directories, and, in conjunction with the `home\' configuration file, symlinks into user home directories.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'apachemachines',
+    'section'     => 'apache',
+    'description' => 'Your Apache machines, one per line.  This enables export of `/etc/apache/vhosts.conf\', which can be included in your Apache configuration via the <a href="http://www.apache.org/docs/mod/core.html#include">Include</a> directive.',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'bindprimary',
+    'section'     => 'BIND',
+    'description' => 'Your BIND primary nameserver.  This enables export of /var/named/named.conf and zone files into /var/named',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'bindsecondaries',
+    'section'     => 'BIND',
+    'description' => 'Your BIND secondary nameservers, one per line.  This enables export of /var/named/named.conf',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'business-onlinepayment',
+    'section'     => 'billing',
+    'description' => '<a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> support, at least three lines: processor, login, and password.  An optional fourth line specifies the action or actions (multiple actions are separated with `,\': for example: `Authorization Only, Post Authorization\').    Optional additional lines are passed to Business::OnlinePayment as %processor_options.',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'bsdshellmachines',
+    'section'     => '',
+    'description' => 'Your BSD flavored shell (and mail) machines, one per line.  This enables export of `/etc/passwd\' and `/etc/master.passwd\'.',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'countrydefault',
+    'section'     => 'UI',
+    'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'cybercash3.2',
+    'section'     => 'billing',
+    'description' => '<a href="http://www.cybercash.com/cashregister/">CyberCash Cashregister v3.2</a> support.  Two lines: the full path and name of your merchant_conf file, and the transaction type (`mauthonly\' or `mauthcapture\').',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'cyrus',
+    'section'     => '',
+    'description' => 'Integration with <a href="http://asg.web.cmu.edu/cyrus/imapd/">Cyrus IMAP Server</a>, three lines: IMAP server, admin username, and admin password.  Cyrus::IMAP::Admin should be installed locally and the connection to the server secured.',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'deletecustomers',
+    'section'     => 'UI',
+    'description' => 'The existance of this file will enable customer deletions.  Be very careful!  Deleting a customer will remove all traces that this customer ever existed!  It should probably only be used when auditing a legacy database.  Normally, you cancel all of a customers\' packages if they cancel service.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'dirhash',
+    'section'     => 'shell',
+    'description' => 'Optional numeric value to control directory hashing.  If positive, hashes directories for the specified number of levels from the front of the username.  If negative, hashes directories for the specified number of levels from the end of the username.  Some examples: <ul><li>1: user -> <a href="#home">/home</a>/u/user<li>2: user -> <a href="#home">/home</a>/u/s/user<li>-1: user -> <a href="#home">/home</a>/r/user<li>-2: user -> <a href="#home">home</a>/r/e/user</ul>',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'disable_customer_referrals',
+    'section'     => 'UI',
+    'description' => 'The existance of this file will disable new customer-to-customer referrals in the web interface.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'domain',
+    'section'     => 'depreciated',
+    'description' => 'Your domain name.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'editreferrals',
+    'section'     => 'UI',
+    'description' => 'The existance of this file will allow you to change the referral of existing customers.',
+    'type'       => 'checkbox',
+  },
+
+  {
+    'key'         => 'emailinvoiceonly',
+    'section'     => 'billing',
+    'description' => 'Disables postal mail invoices.',
+    'type'       => 'checkbox',
+  },
+
+  {
+    'key'         => 'emailinvoiceauto',
+    'section'     => 'billing',
+    'description' => 'Automatically adds new accounts to the email invoice list upon customer creation.',
+    'type'       => 'checkbox',
+  },
+
+  {
+    'key'         => 'erpcdmachines',
+    'section'     => '',
+    'description' => 'Your ERPCD authenticaion machines, one per line.  This enables export of `/usr/annex/acp_passwd\' and `/usr/annex/acp_dialup\'.',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'hidecancelledpackages',
+    'section'     => 'UI',
+    'description' => 'The existance of this file will prevent cancelled packages from showing up in listings (though they will still be in the database)',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'hidecancelledcustomers',
+    'section'     => 'UI',
+    'description' => 'The existance of this file will prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'home',
+    'section'     => 'required',
+    'description' => 'For new users, prefixed to username to create a directory name.  Should have a leading but not a trailing slash.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'icradiusmachines',
+    'section'     => '',
+    'description' => '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>".  You do not need to use MySQL for your Freeside database to export to an ICRADIUS mysql database with this option.',
+    'type'        => [qw( checkbox textarea )],
+  },
+
+  {
+    'key'         => 'icradius_mysqldest',
+    'section'     => '',
+    'description' => 'Destination directory for the MySQL databases, on the ICRADIUS machines.  Defaults to "/usr/local/var/".',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'icradius_mysqlsource',
+    'section'     => '',
+    'description' => 'Source directory for for the MySQL radcheck table files, on the Freeside machine.  Defaults to "/usr/local/var/freeside".',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'icradius_secrets',
+    'section'     => '',
+    'description' => '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.',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'invoice_from',
+    'section'     => 'required',
+    'description' => 'Return address on email invoices.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'invoice_template',
+    'section'     => 'required',
+    'description' => 'Required template file for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'lpr',
+    'section'     => 'required',
+    'description' => 'Print command for paper invoices, for example `lpr -h\'.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'maildisablecatchall',
+    'section'     => 'depreciated',
+    'description' => '<b>DEPRECIATED</b>, now the default.  The existance of this file used to disable the requirement that each virtual domain have a catch-all mailbox.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'money_char',
+    'section'     => '',
+    'description' => 'Currency symbol - defaults to `$\'.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'mxmachines',
+    'section'     => 'BIND',
+    'description' => 'MX entries for new domains, weight and machine, one per line, with trailing `.\'',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'nsmachines',
+    'section'     => 'BIND',
+    'description' => 'NS nameservers for new domains, one per line, with trailing `.\'',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'nismachines',
+    'section'     => '',
+    'description' => 'Your NIS master (not slave master) machines, one per line.  This enables export of `/etc/global/passwd\' and `/etc/global/shadow\'.',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'passwordmin',
+    'section'     => 'password',
+    'description' => 'Minimum password length (default 6)',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'passwordmax',
+    'section'     => 'password',
+    'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'qmailmachines',
+    'section'     => '',
+    'description' => 'Your qmail machines, one per line.  This enables export of `/var/qmail/control/virtualdomains\', `/var/qmail/control/recipientmap\', and `/var/qmail/control/rcpthosts\'.  The existance of this file (even if empty) also turns on user `.qmail-extension\' file maintenance in conjunction with `shellmachine\'.',
+    'type'        => [qw( checkbox textarea )],
+  },
+
+  {
+    'key'         => 'radiusmachines',
+    'section'     => '',
+    'description' => 'Your RADIUS authentication machines, one per line.  This enables export of `/etc/raddb/users\'.',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'referraldefault',
+    'section'     => 'UI',
+    'description' => 'Default referral, specified by refnum.',
+    'type'        => 'text',
+  },
+
+#  {
+#    'key'         => 'registries',
+#    'section'     => 'required',
+#    'description' => 'Directory which contains domain registry information.  Each registry is a directory.',
+#  },
+
+  {
+    'key'         => 'sendmailconfigpath',
+    'section'     => '',
+    'description' => 'Sendmail configuration file path - defaults to `/etc\'.  Many newer distributions use `/etc/mail\'.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'sendmailmachines',
+    'section'     => '',
+    'description' => 'Your sendmail machines, one per line.  This enables export of `/etc/virtusertable\' and `/etc/sendmail.cw\'.',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'sendmailrestart',
+    'section'     => '',
+    'description' => 'If defined, the command which is run on sendmail machines after files are copied.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'session-start',
+    'section'     => 'session',
+    'description' => 'If defined, the command which is executed on the Freeside machine when a session begins.  The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'session-stop',
+    'section'     => 'session',
+    'description' => 'If defined, the command which is executed on the Freeside machine when a session ends.  The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'shellmachine',
+    'section'     => 'shell',
+    'description' => 'A single machine with user home directories mounted.  This enables home directory creation, renaming and archiving/deletion.  In conjunction with `qmailmachines\', it also enables `.qmail-extension\' file maintenance.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'shellmachine-useradd',
+    'section'     => 'shell',
+    'description' => 'The command(s) to run on shellmachine when an account is created.  If this file does not exist, <code>useradd -d $dir -m -s $shell -u $uid $username</code> is the default.  If the file exists but is empty, <code>cp -pr /etc/skel $dir; chown -R $uid.$gid $dir</code> is the default instead.  Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$username</code>, <code>$uid</code>, <code>$gid</code>, <code>$dir</code>, and <code>$shell</code>.',
+    'type'        => [qw( checkbox text )],
+  },
+
+  {
+    'key'         => 'shellmachine-userdel',
+    'section'     => 'shell',
+    'description' => 'The command(s) to run on shellmachine when an account is deleted.  If this file does not exist, <code>userdel $username</code> is the default.  If the file exists but is empty, <code>rm -rf $dir</code> is the default instead.  Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$username</code> and <code>$dir</code>.',
+    'type'        => [qw( checkbox text )],
+  },
+
+  {
+    'key'         => 'shellmachine-usermod',
+    'section'     => 'shell',
+    'description' => 'The command(s) to run on shellmachine when an account is modified.  If this file does not exist or is empty, <code>[ -d $old_dir ] &amp;&amp; mv $old_dir $new_dir || ( chmod u+t $old_dir; mkdir $new_dir; cd $old_dir; find . -depth -print | cpio -pdm $new_dir; chmod u-t $new_dir; chown -R $uid.$gid $new_dir; rm -rf $old_dir )</code> is the default.  Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$old_dir</code>, <code>$new_dir</code>, <code>$uid</code> and <code>$gid</code>.',
+    'type'        => [qw( checkbox text )],
+  },
+
+  {
+    'key'         => 'shellmachines',
+    'section'     => 'shell',
+    'description' => 'Your Linux and System V flavored shell (and mail) machines, one per line.  This enables export of `/etc/passwd\' and `/etc/shadow\' files.',
+     'type'        => 'textarea',
+ },
+
+  {
+    'key'         => 'shells',
+    'section'     => 'required',
+    'description' => 'Legal shells (think /etc/shells).  You probably want to `cut -d: -f7 /etc/passwd | sort | uniq\' initially so that importing doesn\'t fail with `Illegal shell\' errors, then remove any special entries afterwords.  A blank line specifies that an empty shell is permitted.',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'showpasswords',
+    'section'     => 'UI',
+    'description' => 'The existance of this file will allow unencrypted user passwords to be displayed.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'signupurl',
+    'section'     => 'UI',
+    'description' => 'if you are using customer-to-customer referrals, and you enter the URL of your <a href="signup.html">signup server CGI</a>, the customer view screen will display a customized link to the signup server with the appropriate customer as referral.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'smtpmachine',
+    'section'     => 'required',
+    'description' => 'SMTP relay for Freeside\'s outgoing mail.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'soadefaultttl',
+    'section'     => 'BIND',
+    'description' => 'SOA default TTL for new domains.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'soaemail',
+    'section'     => 'BIND',
+    'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'soaexpire',
+    'section'     => 'BIND',
+    'description' => 'SOA expire for new domains',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'soamachine',
+    'section'     => 'BIND',
+    'description' => 'SOA machine for new domains, with trailing `.\'',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'soarefresh',
+    'section'     => 'BIND',
+    'description' => 'SOA refresh for new domains',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'soaretry',
+    'section'     => 'BIND',
+    'description' => 'SOA retry for new domains',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'statedefault',
+    'section'     => 'UI',
+    'description' => 'Default state or province (if not supplied, the default is `CA\')',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'textradiusprepend',
+    'section'     => 'depreciated',
+    'description' => '<b>DEPRECIATED</b>, use RADIUS check attributes instead.  This option will be removed soon.  The contents of this file will be prepended to the first line of a user\'s RADIUS entry in text exports.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'unsuspendauto',
+    'section'     => 'billing',
+    'description' => 'The existance of this file will enable the automatic unsuspension of suspended packages when a customer\'s balance due changes from positive to zero or negative as the result of a payment or credit.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'usernamemin',
+    'section'     => 'username',
+    'description' => 'Minimum username length (default 2);',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'usernamemax',
+    'section'     => 'username',
+    'description' => 'Maximum username length (default is the size of the SQL column, probably specified when fs-setup was run)',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'username-ampersand',
+    'section'     => 'username',
+    'description' => 'The existance of this file will allow the ampersand character (&amp;) in usernames.  Be careful when using this option in conjunction with <a href="#shellmachine-useradd">shellmachine-useradd</a> and other configuration options which execute shell commands, as the ampersand will be interpreted by the shell if not quoted.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'username-letter',
+    'section'     => 'username',
+    'description' => 'The existance of this file will turn on the requirement that usernames contain at least one letter.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'username-letterfirst',
+    'section'     => 'username',
+    'description' => 'The existance of this file will turn on the requirement that usernames start with a letter.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'username-noperiod',
+    'section'     => 'username',
+    'description' => 'The existance of this file will disallow periods in usernames.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'username-uppercase',
+    'section'     => 'username',
+    'description' => 'The existance of this file will allow uppercase characters in username.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'username_policy',
+    'section'     => '',
+    'description' => 'This file controls the mechanism for preventing duplicate usernames in passwd/radius files exported from svc_accts.  This should be one of \'prepend domsvc\' \'append domsvc\' or \'append domain\'',
+#    'type'        => 'select',
+    'type'        => '',
+  },
+
+  {
+    'key'         => 'vpopmailmachines',
+    'section'     => '',
+    'description' => 'Your vpopmail pop toasters, one per line.  Each line is of the form "machinename vpopdir vpopuid vpopgid".  For example: <code>poptoaster.domain.tld /home/vpopmail 508 508</code>  Note: vpopuid and vpopgid are values taken from the vpopmail machine\'s /etc/passwd',
+    'type'        => 'textarea',
+  },
+
+);
+
 1;
+
diff --git a/FS/FS/ConfItem.pm b/FS/FS/ConfItem.pm
new file mode 100644 (file)
index 0000000..83295b4
--- /dev/null
@@ -0,0 +1,63 @@
+package FS::ConfItem;
+
+=head1 NAME
+
+FS::ConfItem - Configutaion option meta-data.
+
+=head1 SYNOPSIS
+
+  use FS::Conf;
+  @config_items = $conf->config_items;
+
+  foreach $item ( @config_items ) {
+    $key = $item->key;
+    $section = $item->section;
+    $description = $item->description;
+  }
+
+=head1 DESCRIPTION
+
+=head1 METHODS
+
+=over 4
+
+=item new
+
+=cut
+
+sub new {
+  my $proto = shift;
+  my $class = ref($proto) || $proto;
+  my $self = @_ ? shift : {};
+  bless ($self, $class);
+}
+
+=item key
+
+=item section
+
+=item description
+
+=cut
+
+sub AUTOLOAD {
+  my $self = shift;
+  my $field = $AUTOLOAD;
+  $field =~ s/.*://;
+  $self->{$field};
+}
+
+=back
+
+=head1 BUGS
+
+Terse docs.
+
+=head1 SEE ALSO
+
+L<FS::Conf>
+
+=cut
+
+1;
+
index 8e29cb7..3e7230f 100644 (file)
@@ -2,7 +2,8 @@ package FS::svc_acct;
 
 use strict;
 use vars qw( @ISA $nossh_hack $conf $dir_prefix @shells $usernamemin
-             $usernamemax $passwordmin $username_letter $username_letterfirst
+             $usernamemax $passwordmin $passwordmax
+             $username_ampersand $username_letter $username_letterfirst
              $username_noperiod $username_uppercase
              $shellmachine $useradd $usermod $userdel $mydomain
              $cyrus_server $cyrus_admin_user $cyrus_admin_pass
@@ -33,6 +34,7 @@ $FS::UID::callback{'FS::svc_acct'} = sub {
   $usernamemin = $conf->config('usernamemin') || 2;
   $usernamemax = $conf->config('usernamemax');
   $passwordmin = $conf->config('passwordmin') || 6;
+  $passwordmax = $conf->config('passwordmax') || 8;
   if ( $shellmachine ) {
     if ( $conf->exists('shellmachine-useradd') ) {
       $useradd = join("\n", $conf->config('shellmachine-useradd') )
@@ -58,6 +60,7 @@ $FS::UID::callback{'FS::svc_acct'} = sub {
   $username_letterfirst = $conf->exists('username-letterfirst');
   $username_noperiod = $conf->exists('username-noperiod');
   $username_uppercase = $conf->exists('username-uppercase');
+  $username_ampersand = $conf->exists('username-ampersand');
   $mydomain = $conf->config('domain');
   if ( $conf->exists('cyrus') ) {
     ($cyrus_server, $cyrus_admin_user, $cyrus_admin_pass) =
@@ -676,11 +679,11 @@ sub check {
 
   my $ulen = $usernamemax || $self->dbdef_table->column('username')->length;
   if ( $username_uppercase ) {
-    $recref->{username} =~ /^([a-z0-9_\-\.]{$usernamemin,$ulen})$/i
+    $recref->{username} =~ /^([a-z0-9_\-\.\&]{$usernamemin,$ulen})$/i
       or return "Illegal username: ". $recref->{username};
     $recref->{username} = $1;
   } else {
-    $recref->{username} =~ /^([a-z0-9_\-\.]{$usernamemin,$ulen})$/
+    $recref->{username} =~ /^([a-z0-9_\-\.\&]{$usernamemin,$ulen})$/
       or return "Illegal username: ". $recref->{username};
     $recref->{username} = $1;
   }
@@ -693,6 +696,9 @@ sub check {
   if ( $username_noperiod ) {
     $recref->{username} =~ /\./ and return "Illegal username";
   }
+  unless ( $username_ampersand ) {
+    $recref->{username} =~ /\&/ and return "Illegal username";
+  }
 
   $recref->{popnum} =~ /^(\d*)$/ or return "Illegal popnum: ".$recref->{popnum};
   $recref->{popnum} = $1;
@@ -720,10 +726,13 @@ sub check {
         or return "Illegal finger: ". $self->getfield('finger');
     $self->setfield('finger', $1);
 
-    $recref->{dir} =~ /^([\/\w\-\.]*)$/
+    $recref->{dir} =~ /^([\/\w\-\.\&]*)$/
       or return "Illegal directory";
     $recref->{dir} = $1;
-    return "Illegal directory" if $recref->{dir} =~ /\.\./; #no ..
+    return "Illegal directory"
+      if $recref->{dir} =~ /(^|\/)\.+(\/|$)/; #no .. component
+    return "Illegal directory"
+      if $recref->{dir} =~ /\&/ && ! $username_ampersand;
     unless ( $recref->{dir} ) {
       $recref->{dir} = $dir_prefix . '/';
       if ( $dirhash > 0 ) {
@@ -787,7 +796,7 @@ sub check {
     unless ( $recref->{_password} );
 
   #if ( $recref->{_password} =~ /^((\*SUSPENDED\* )?)([^\t\n]{4,16})$/ ) {
-  if ( $recref->{_password} =~ /^((\*SUSPENDED\* )?)([^\t\n]{$passwordmin,8})$/ ) {
+  if ( $recref->{_password} =~ /^((\*SUSPENDED\* )?)([^\t\n]{$passwordmin,$passwordmax})$/ ) {
     $recref->{_password} = $1.$3;
     #uncomment this to encrypt password immediately upon entry, or run
     #bin/crypt_pw in cron to give new users a window during which their
@@ -803,7 +812,8 @@ sub check {
   } elsif ( $recref->{_password} eq '!!' ) {
     $recref->{_password} = '!!';
   } else {
-    return "Illegal password";
+    #return "Illegal password";
+    return "Illegal password: ". $recref->{_password};
   }
 
   ''; #no error
@@ -921,7 +931,7 @@ sub ssh {
 
 =head1 VERSION
 
-$Id: svc_acct.pm,v 1.51 2001-10-22 14:48:28 ivan Exp $
+$Id: svc_acct.pm,v 1.52 2001-10-24 15:29:30 ivan Exp $
 
 =head1 BUGS
 
index 8b8c359..bc62ea7 100644 (file)
@@ -2,7 +2,6 @@ package FS::svc_domain;
 
 use strict;
 use vars qw( @ISA $whois_hack $conf $smtpmachine
-  $tech_contact $from $to @nameservers @nameserver_ips @template
   @mxmachines @nsmachines $soadefaultttl $soaemail $soaexpire $soamachine
   $soarefresh $soaretry $qshellmachine $nossh_hack
 );
@@ -29,23 +28,6 @@ $FS::UID::callback{'FS::domain'} = sub {
 
   $smtpmachine = $conf->config('smtpmachine');
 
-  my($internic)="/registries/internic";
-  $tech_contact = $conf->config("$internic/tech_contact");
-  $from = $conf->config("$internic/from");
-  $to = $conf->config("$internic/to");
-  my(@ns) = $conf->config("$internic/nameservers");
-  @nameservers=map {
-    /^\s*\d+\.\d+\.\d+\.\d+\s+([^\s]+)\s*$/
-      or die "Illegal line in $internic/nameservers";
-    $1;
-  } @ns;
-  @nameserver_ips=map {
-    /^\s*(\d+\.\d+\.\d+\.\d+)\s+([^\s]+)\s*$/
-      or die "Illegal line in $internic/nameservers!";
-    $1;
-  } @ns;
-  @template = map { $_. "\n" } $conf->config("$internic/template");
-
   @mxmachines    = $conf->config('mxmachines');
   @nsmachines    = $conf->config('nsmachines');
   $soadefaultttl = $conf->config('soadefaultttl');
@@ -426,115 +408,15 @@ Submits a registration email for this domain.
 =cut
 
 sub submit_internic {
-  my $self = shift;
-
-  my $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $self->pkgnum } );
-  return unless $cust_pkg;
-  my $cust_main = qsearchs( 'cust_main', { 'custnum' => $cust_pkg->custnum } );
-  return unless $cust_main;
-
-  my %subs = (
-    'action'       => $self->action,
-    'purpose'      => $self->purpose,
-    'domain'       => $self->domain,
-    'company'      => $cust_main->company 
-                        || $cust_main->getfield('first'). ' '.
-                           $cust_main->getfield('last')
-                      ,
-    'city'         => $cust_main->city,
-    'state'        => $cust_main->state,
-    'zip'          => $cust_main->zip,
-    'country'      => $cust_main->country,
-    'last'         => $cust_main->getfield('last'),
-    'first'        => $cust_main->getfield('first'),
-    'daytime'      => $cust_main->daytime,
-    'fax'          => $cust_main->fax,
-    'email'        => $self->email,
-    'tech_contact' => $tech_contact,
-    'primary'      => shift @nameservers,
-    'primary_ip'   => shift @nameserver_ips,
-  );
-
-  #yuck
-  my @xtemplate = @template;
-  my @body;
-  my $line;
-  OLOOP: while ( defined( $line = shift @xtemplate ) ) {
-
-    if ( $line =~ /^###LOOP###$/ ) {
-      my(@buffer);
-      LOADBUF: while ( defined( $line = shift @xtemplate ) ) {
-        last LOADBUF if ( $line =~ /^###ENDLOOP###$/ );
-        push @buffer, $line;
-      }
-      my %lubs = (
-        'address'      => $cust_main->address2 
-                            ? [ $cust_main->address1, $cust_main->address2 ]
-                            : [ $cust_main->address1 ]
-                          ,
-        'secondary'    => [ @nameservers ],
-        'secondary_ip' => [ @nameserver_ips ],
-      );
-      LOOP: while (1) {
-        my @xbuffer = @buffer;
-        SUBLOOP: while ( defined( $line = shift @xbuffer ) ) {
-          if ( $line =~ /###(\w+)###/ ) {
-            #last LOOP unless my($lub)=shift@{$lubs{$1}};
-            next OLOOP unless my $lub = shift @{$lubs{$1}};
-            $line =~ s/###(\w+)###/$lub/e;
-            redo SUBLOOP;
-          } else {
-            push @body, $line;
-          }
-        } #SUBLOOP
-      } #LOOP
-
-    }
-
-    if ( $line =~ /###(\w+)###/ ) {
-      #$line =~ s/###(\w+)###/$subs{$1}/eg;
-      $line =~ s/###(\w+)###/$subs{$1}/e;
-      redo OLOOP;
-    } else {
-      push @body, $line;
-    }
-
-  } #OLOOP
-
-  my $subject;
-  if ( $self->action eq "M" ) {
-    $subject = "MODIFY DOMAIN ". $self->domain;
-  } elsif ( $self->action eq "N" ) { 
-    $subject = "NEW DOMAIN ". $self->domain;
-  } else {
-    croak "submit_internic called with action ". $self->action;
-  }
-
-  $ENV{SMTPHOSTS} = $smtpmachine;
-  $ENV{MAILADDRESS} = $from;
-  my $header = Mail::Header->new( [
-    "From: $from",
-    "To: $to",
-    "Sender: $from",
-    "Reply-To: $from",
-    "Date: ". time2str("%a, %d %b %Y %X %z", time),
-    "Subject: $subject",
-  ] );
-
-  my($msg)=Mail::Internet->new(
-    'Header' => $header,
-    'Body' => \@body,
-  );
-
-  $msg->smtpsend or die "Can't send registration email"; #die? warn?
-
+  #my $self = shift;
+  carp "submit_internic depreciated";
 }
 
 =back
 
 =head1 VERSION
 
-$Id: svc_domain.pm,v 1.21 2001-10-22 12:22:03 ivan Exp $
+$Id: svc_domain.pm,v 1.22 2001-10-24 15:29:30 ivan Exp $
 
 =head1 BUGS
 
index 5af893a..5de6977 100644 (file)
@@ -11,6 +11,7 @@ fin/freeside-apply-credits
 FS.pm
 FS/CGI.pm
 FS/Conf.pm
+FS/ConfItem.pm
 FS/Record.pm
 FS/UI/Base.pm
 FS/UI/CGI.pm
@@ -61,6 +62,7 @@ t/agent_type.t
 t/CGI.t
 t/CGIwrapper.t
 t/Conf.t
+t/ConfItem.t
 t/cust_bill.t
 t/cust_bill_pay.t
 t/cust_bill_pkg.t
diff --git a/FS/t/ConfItem.t b/FS/t/ConfItem.t
new file mode 100644 (file)
index 0000000..c7932d7
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::ConfItem;
+$loaded=1;
+print "ok 1\n";
index 3d76bf8..f3889f0 100755 (executable)
@@ -1,13 +1,13 @@
 #!/usr/bin/perl -Tw
 #
-# $Id: fs-setup,v 1.64 2001-10-23 18:15:06 ivan Exp $
+# $Id: fs-setup,v 1.65 2001-10-24 15:29:30 ivan Exp $
 
 #to delay loading dbdef until we're ready
 BEGIN { $FS::Record::setup_hack = 1; }
 
 use strict;
 use DBI;
-use DBIx::DBSchema 0.18;
+use DBIx::DBSchema 0.19;
 use DBIx::DBSchema::Table;
 use DBIx::DBSchema::Column;
 use DBIx::DBSchema::ColGroup::Unique;
@@ -30,14 +30,18 @@ my($dbdef_file) = "/usr/local/etc/freeside/dbdef.". datasrc;
 
 ###
 
-print "\nEnter the maximum username length: ";
-my($username_len)=&getvalue;
+#print "\nEnter the maximum username length: ";
+#my($username_len)=&getvalue;
+my $username_len = 32; #usernamemax config file
 
 print "\n\n", <<END, ":";
-Freeside tracks the RADIUS attributes User-Name, check attribute Password and
+Freeside tracks the RADIUS User-Name, check attribute Password and
 reply attribute Framed-IP-Address for each user.  You can specify additional
-check and reply attributes.  First enter any additional RADIUS check attributes
-you need to track for each user, separated by whitespace.
+check and reply attributes (or you can add them later with the
+fs-radius-add-check and fs-radius-add-reply programs).
+
+First enter any additional RADIUS check attributes you need to track for each 
+user, separated by whitespace.
 END
 my @check_attributes = map { $attrib2db{lc($_)} or die "unknown attribute $_"; }
                          split(" ",&getvalue);
index bc27f7f..7271860 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 #
-# $Id: svc_acct.export,v 1.25 2001-10-16 20:33:02 jeff Exp $
+# $Id: svc_acct.export,v 1.26 2001-10-24 15:29:30 ivan Exp $
 #
 # Create and export password, radius and vpopmail password files:
 # passwd, passwd.adjunct, shadow, acp_passwd, acp_userinfo, acp_dialup
@@ -254,7 +254,8 @@ foreach $svc_domain (sort {$a->domain cmp $b->domain} @svc_domain) {
   foreach $svc_acct (qsearch('svc_acct', {'domsvc' => $svc_domain->svcnum})) {
     my($password)=$svc_acct->getfield('_password');
     my($cpassword,$rpassword);
-    if ( ( length($password) <= 8 )
+    #if ( ( length($password) <= 8 )
+    if ( ( length($password) <= 12 )
          && ( $password ne '*' )
          && ( $password ne '!!' )
          && ( $password ne '' )
diff --git a/conf/registries/internic/from b/conf/registries/internic/from
deleted file mode 100644 (file)
index dc36ae7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-domreg@domain.tld
diff --git a/conf/registries/internic/nameservers b/conf/registries/internic/nameservers
deleted file mode 100644 (file)
index e1aa999..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-192.168.1.1     ns1.domain.tld
-192.168.1.2     ns2.domain.tld
-192.168.1.3     ns3.domain.tld
diff --git a/conf/registries/internic/tech_contact b/conf/registries/internic/tech_contact
deleted file mode 100644 (file)
index 1e6fea0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-A1
diff --git a/conf/registries/internic/template b/conf/registries/internic/template
deleted file mode 100644 (file)
index 8e4983c..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-[ URL ftp://rs.internic.net/templates/domain-template.txt ] [ 03/98 ] 
-
-******* Please DO NOT REMOVE Version Number or Sections A-Q ********
-
-Domain Version Number: 4.0
-
-******* Email completed agreement to hostmaster@internic.net *******
-
-       NETWORK SOLUTIONS, INC.
-
-       DOMAIN NAME REGISTRATION AGREEMENT
-
-
-A.     Introduction. This domain name registration agreement
-("Registration Agreement") is submitted to NETWORK SOLUTIONS, INC.
-("NSI") for the purpose of applying for and registering a domain name
-on the Internet. If this Registration Agreement is accepted by NSI,
-and a domain name is registered in NSI's domain name database and
-assigned to the Registrant, Registrant ("Registrant") agrees to be
-bound by the terms of this Registration Agreement and the terms of
-NSI's Domain Name Dispute Policy ("Dispute Policy") which is
-incorporated herein by reference and made a part of this Registration
-Agreement. This Registration Agreement shall be accepted at the
-offices of NSI. 
-
-B. Fees and Payments.
-
-1) Registration or renewal (re-registration) date through March 31, 1998:
-Registrant agrees to pay a registration fee of One Hundred United States
-Dollars (US$100) as consideration for the registration of each new domain
-name or Fifty United States Dollars (US$50) to renew (re-register) an
-existing registration.
-2) Registration or renewal date on and after April 1, 1998:  Registrant
-agrees to pay a registration fee of Seventy United States Dollars (US$70) 
-as consideration for the registration of each new domain name or the 
-applicable renewal (re-registration) fee (currently Thirty-Five United 
-States Dollars (US$35)) at the time of renewal (re-registration).
-3) Period of Service:  The non-refundable fee covers a period of two (2)
-years for each new registration, and one (1) year for each renewal, 
-and includes any permitted modification(s) to the domain name record
-during the covered period.
-4) Payment:  Payment is due to Network Solutions within thirty (30) 
-days from the date of the invoice.
-
-C.     Dispute Policy. Registrant agrees, as a condition to
-submitting this Registration Agreement, and if the Registration
-Agreement is accepted by NSI, that the Registrant shall be bound by
-NSI's current Dispute Policy. The current version of the Dispute
-Policy may be found at the InterNIC Registration Services web site:
-"http://www.netsol.com/rs/dispute-policy.html". 
-
-D.     Dispute Policy Changes or Modifications. Registrant agrees
-that NSI, in its sole discretion, may change or modify the Dispute
-Policy, incorporated by reference herein, at any time. Registrant
-agrees that Registrant's maintaining the registration of a domain name
-after changes or modifications to the Dispute Policy become effective
-constitutes Registrant's continued acceptance of these changes or
-modifications. Registrant agrees that if Registrant considers any such
-changes or modifications to be unacceptable, Registrant may request
-that the domain name be deleted from the domain name database. 
-
-E.     Disputes. Registrant agrees that, if the registration of its
-domain name is challenged by any third party, the Registrant will be
-subject to the provisions specified in the Dispute Policy. 
-
-F.     Agents. Registrant agrees that if this Registration Agreement
-is completed by an agent for the Registrant, such as an ISP or
-Administrative Contact/Agent, the Registrant is nonetheless bound as a
-principal by all terms and conditions herein, including the Dispute
-Policy. 
-
-G.     Limitation of Liability. Registrant agrees that NSI shall have
-no liability to the Registrant for any loss Registrant may incur in
-connection with NSI's processing of this Registration Agreement, in
-connection with NSI's processing of any authorized modification to the
-domain name's record during the covered period, as a result of the
-Registrant's ISP's failure to pay either the initial registration fee
-or renewal fee, or as a result of the application of the provisions of
-the Dispute Policy. Registrant agrees that in no event shall the
-maximum liability of NSI under this Agreement for any matter exceed
-Five Hundred United States Dollars (US$500). 
-
-H.     Indemnity. Registrant agrees, in the event the Registration
-Agreement is accepted by NSI and a subsequent dispute arises with any
-third party, to indemnify and hold NSI harmless pursuant to the terms
-and conditions contained in the Dispute Policy. 
-
-I.     Breach. Registrant agrees that failure to abide by any
-provision of this Registration Agreement or the Dispute Policy may be
-considered by NSI to be a material breach and that NSI may provide a
-written notice, describing the breach, to the Registrant. If, within
-thirty (30) days of the date of mailing such notice, the Registrant
-fails to provide evidence, which is reasonably satisfactory to NSI,
-that it has not breached its obligations, then NSI may delete
-Registrant's registration of the domain name. Any such breach by a
-Registrant shall not be deemed to be excused simply because NSI did
-not act earlier in response to that, or any other, breach by the
-Registrant. 
-
-J.     No Guaranty. Registrant agrees that, by registration of a
-domain name, such registration does not confer immunity from objection
-to either the registration or use of the domain name. 
-
-K.     Warranty. Registrant warrants by submitting this Registration
-Agreement that, to the best of Registrant's knowledge and belief, the
-information submitted herein is true and correct, and that any future
-changes to this information will be provided to NSI in a timely manner
-according to the domain name modification procedures in place at that
-time. Breach of this warranty will constitute a material breach. 
-
-L.     Revocation. Registrant agrees that NSI may delete a
-Registrant's domain name if this Registration Agreement, or subsequent
-modification(s) thereto, contains false or misleading information, or
-conceals or omits any information NSI would likely consider material
-to its decision to approve this Registration Agreement. 
-
-M.     Right of Refusal. NSI, in its sole discretion, reserves the
-right to refuse to approve the Registration Agreement for any
-Registrant. Registrant agrees that the submission of this Registration
-Agreement does not obligate NSI to accept this Registration Agreement.
-Registrant agrees that NSI shall not be liable for loss or damages
-that may result from NSI's refusal to accept this Registration
-Agreement. 
-
-N.     Severability. Registrant agrees that the terms of this
-Registration Agreement are severable. If any term or provision is
-declared invalid, it shall not affect the remaining terms or
-provisions which shall continue to be binding. 
-
-O.     Entirety. Registrant agrees that this Registration Agreement
-and the Dispute Policy is the complete and exclusive agreement between
-Registrant and NSI regarding the registration of Registrant's domain
-name. This Registration Agreement and the Dispute Policy supersede all
-prior agreements and understandings, whether established by custom,
-practice, policy, or precedent. 
-
-P.     Governing Law. Registrant agrees that this Registration
-Agreement shall be governed in all respects by and construed in
-accordance with the laws of the Commonwealth of Virginia, United
-States of America. By submitting this Registration Agreement,
-Registrant consents to the exclusive jurisdiction and venue of the
-United States District Court for the Eastern District of Virginia,
-Alexandria Division. If there is no jurisdiction in the United States
-District Court for the Eastern District of Virginia, Alexandria
-Division, then jurisdiction shall be in the Circuit Court of Fairfax
-County, Fairfax, Virginia. 
-
-Q.     This is Domain Name Registration Agreement Version
-Number 4.0. This Registration Agreement is only for registrations
-under top-level domains: COM, ORG, NET, and EDU. By completing
-and submitting this Registration Agreement for consideration and
-acceptance by NSI, the Registrant agrees that he/she has read and
-agrees to be bound by A through P above. 
-
-
-Authorization
-0a.  (N)ew (M)odify (D)elete....:###action###
-0b.  Auth Scheme................: 
-0c.  Auth Info..................: 
-
-1.   Comments...................:###purpose###
-
-2.   Complete Domain Name.......:###domain###
-
-Organization Using Domain Name
-
-3a.  Organization Name..........:###company###
-###LOOP###
-3b.  Street Address.............:###address###
-###ENDLOOP###
-3c.  City.......................:###city###
-3d.  State......................:###state###
-3e.  Postal Code................:###zip###
-3f.  Country....................:###country###
-
-Administrative Contact
-4a.  NIC Handle (if known)......: 
-4b.  (I)ndividual (R)ole........:I
-4c.  Name (Last, First).........:###last###, ###first###
-4d.  Organization Name..........:###company###
-###LOOP###
-4e.  Street Address.............:###address###
-###ENDLOOP###
-4f.  City.......................:###city###
-4g.  State......................:###state###
-4h.  Postal Code................:###zip### 
-4i.  Country....................:###country###
-4j.  Phone Number...............:###daytime###
-4k.  Fax Number.................:###fax###
-4l.  E-Mailbox..................:###email###
-
-Technical Contact
-5a.  NIC Handle (if known)......:###tech_contact###
-5b.  (I)ndividual (R)ole........: 
-5c.  Name (Last, First).........: 
-5d.  Organization Name..........: 
-5e.  Street Address.............: 
-5f.  City.......................: 
-5g.  State......................: 
-5h.  Postal Code................: 
-5i.  Country....................: 
-5j.  Phone Number...............: 
-5k.  Fax Number.................: 
-5l.  E-Mailbox..................: 
-
-Billing Contact
-6a.  NIC Handle (if known)......: 
-6b.  (I)ndividual (R)ole........: 
-6c.  Name (Last, First).........: 
-6d.  Organization Name..........: 
-6e.  Street Address.............: 
-6f.  City.......................: 
-6g.  State......................:
-6h.  Postal Code................:
-6i.  Country....................:
-6j.  Phone Number...............:
-6k.  Fax Number.................: 
-6l.  E-Mailbox..................: 
-
-Prime Name Server
-7a.  Primary Server Hostname....:###primary###
-7b.  Primary Server Netaddress..:###primary_ip###
-
-Secondary Name Server(s)
-###LOOP###
-8a.  Secondary Server Hostname..:###secondary###
-8b.  Secondary Server Netaddress:###secondary_ip###
-###ENDLOOP###
-
-END OF AGREEMENT
-
diff --git a/conf/registries/internic/to b/conf/registries/internic/to
deleted file mode 100644 (file)
index c80f93c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-hostmaster@internic.net
index 8c8b945..f166846 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 #
-# $Id: registerd.Pg,v 1.10 2001-09-30 07:55:52 ivan Exp $
+# $Id: registerd.Pg,v 1.11 2001-10-24 15:29:30 ivan Exp $
 
 use strict;
 use vars qw(
@@ -131,15 +131,15 @@ while ( 1 ) {
     print LPR "mail $email";
     close LPR;
 
-    open(FROM, ">${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/from")
-      or die "Can\'t open ${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/from: $!";
-    print FROM "$email\n";
-    close FROM;
-
-    open(TO, ">${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/to")
-      or die "Can\'t open ${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/to: $!";
-    print TO "$email\n";
-    close TO;
+#    open(FROM, ">${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/from")
+#      or die "Can\'t open ${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/from: $!";
+#    print FROM "$email\n";
+#    close FROM;
+#
+#    open(TO, ">${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/to")
+#      or die "Can\'t open ${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/to: $!";
+#    print TO "$email\n";
+#    close TO;
 
     open(SECRETS, ">${freeside_conf}secrets.demo_$username")
       or die "Can\'t open ${freeside_conf}secrets.demo_$username: $!";
diff --git a/httemplate/config/config-process.cgi b/httemplate/config/config-process.cgi
new file mode 100644 (file)
index 0000000..2dc4647
--- /dev/null
@@ -0,0 +1,44 @@
+<%
+  my $conf = new FS::Conf;
+  $FS::Conf::DEBUG = 1;
+  my @config_items = $conf->config_items;
+
+  foreach my $i ( @config_items ) {
+    my @touch = ();
+    my @delete = ();
+    my $n = 0;
+    foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) {
+      if ( $type eq '' ) {
+      } elsif ( $type eq 'textarea' ) {
+        if ( $cgi->param($i->key. $n) ) {
+          $conf->set($i->key, $cgi->param($i->key. $n));
+        } else {
+          $conf->delete($i->key);
+        }
+      } elsif ( $type eq 'checkbox' ) {
+#        if ( defined($cgi->param($i->key. $n)) && $cgi->param($i->key. $n) ) {
+        if ( defined $cgi->param($i->key. $n) ) {
+          #$conf->touch($i->key);
+          push @touch, $i->key;
+        } else {
+          #$conf->delete($i->key);
+          push @delete, $i->key;
+        }
+      } elsif ( $type eq 'text' )  {
+        if ( $cgi->param($i->key. $n) ) {
+          $conf->set($i->key, $cgi->param($i->key. $n));
+        } else {
+          $conf->delete($i->key);
+        }
+      } else {
+      }
+      $n++;
+    }
+   # warn @touch;
+    $conf->touch($_) foreach @touch;
+    $conf->delete($_) foreach @delete;
+  }
+
+%>
+<%= $cgi->redirect("config-view.cgi") %>
+
diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi
new file mode 100644 (file)
index 0000000..09e535b
--- /dev/null
@@ -0,0 +1,46 @@
+<%= header('View Configuration', menubar( 'Main Menu' => $p,
+                                     'Edit Configuration' => 'config.cgi' ) ) %>
+
+<% my $conf = new FS::Conf; my @config_items = $conf->config_items; %>
+
+<% foreach my $section ( qw(required billing username password UI session
+                            apache BIND shell
+                           ),
+                         '', 'depreciated') { %>
+  <%= table("#cccccc", 2) %>
+  <tr>
+    <th colspan="2" bgcolor="#dcdcdc">
+      <%= ucfirst($section || 'unclassified') %> configuration options
+    </th>
+  </tr>
+  <% foreach my $i (grep $_->section eq $section, @config_items) { %>
+    <tr>
+      <td><a name="<%= $i->key %>">
+        <b><%= $i->key %></b>&nbsp;-&nbsp;<%= $i->description %>
+      </a></td>
+      <td><table border=0>
+        <% foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) {
+             my $n = 0; %>
+          <% if ( $type eq '' ) { %>
+            <tr><td><font color="#ff0000">no type</font></td></tr>
+          <% } elsif ( $type eq 'textarea' ) { %>
+            <tr><td bgcolor="#ffffff">
+              <pre><%= join("\n", $conf->config($i->key) ) %></pre>
+            </td></tr>
+          <% } elsif ( $type eq 'checkbox' ) { %>
+            <tr><td bgcolor="#<%= $conf->exists($i->key) ? '00ff00">YES' : 'ff0000">NO' %></td></tr>
+          <% } elsif ( $type eq 'text' )  { %>
+            <tr><td bgcolor="#ffffff"><%=  $conf->exists($i->key) ? $conf->config($i->key) : '' %></td></tr>
+          <% } else { %>
+            <tr><td>
+              <font color="#ff0000">unknown type <%= $type %></font>
+            </td></tr>
+          <% } %>
+        <% $n++; } %>
+      </table></td>
+    </tr>
+  <% } %>
+  </table><br><br>
+<% } %>
+
+</body></html>
index 75d3070..6567237 100644 (file)
@@ -26,100 +26,10 @@ DBI:Pg:host=localhost;dbname=freeside
 dbusername
 dbpassword
 </pre>
-</ul>
-All further configuration files and directories are located in
-<tt>/usr/local/etc/freeside/conf.<i>datasource</i></tt>, for example, 
-<tt>/usr/local/etc/freeside/conf.DBI:Pg:host=localhost;dbname=freeside</tt> (remember to backslash-escape the ; character when creating directories in the shell: <tt>mkdir&nbsp;/usr/local/etc/freeside/conf.DBI:Pg:host=localhost\;dbname=freeside</tt>).  Files listed in <font color="#ff0000">red</font> are requried.
-<ul>
-  <li><a name="address">address</a> - This configuration file is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.
-  <li><a name="apacheroot">apacheroot</a> - The directory containing Apache virtual hosts
-  <li><a name="apachemachine">apachemachine</a> - A machine with the apacheroot directory and user home directories.  The existance of this file enables setup of virtual host directories, and, in conjunction with the `home' configuration file, symlinks into user home directories.
-  <li><a name="apachemachines">apachemachines</a> - Your Apache machines, one per line.  This enables export of `/etc/apache/vhosts.conf', which can be included in your Apache configuration via the <a href="http://www.apache.org/docs/mod/core.html#include">Include</a> directive.
-  <li><a name="bindprimary">bindprimary</a> - Your BIND primary nameserver.  This enables export of /var/named/named.conf and zone files into /var/named
-  <li><a name="bindsecondaries">bindsecondaries</a> - Your BIND secondary nameservers, one per line.  This enables export of /var/named/named.conf
-  <li><a name="business-onlinepayment">business-onlinepayment</a> - <a href="http://search.cpan.org/search?dist=Business-OnlinePayment">Business::OnlinePayment</a> support, at least three lines: processor, login, and password.  An optional fourth line specifies the action or actions (multiple actions are separated with `,': for example: `Authorization Only, Post Authorization').    Optional additional lines are passed to Business::OnlinePayment as %processor_options.
-  <li><a name="bsdshellmachines">bsdshellmachines</a> - Your BSD flavored shell (and mail) machines, one per line.  This enables export of `/etc/passwd' and `/etc/master.passwd'.
-  <li><a name="countrydefault">countrydefault</a> - Default two-letter country code (if not supplied, the default is `US')
-  <li>cybercash3.2 - <a href="http://www.cybercash.com/cybercash/services/technology.html">CyberCash v3.2</a> support.  Two lines: the full path and name of your merchant_conf file, and the transaction type (`mauthonly' or `mauthcapture').  CCMckLib3_2.pm, CCMckDirectLib3_2.pm and CCMckErrno3_2 are required.
-  <li>cyrus</li> - Integration with <a href="http://asg.web.cmu.edu/cyrus/imapd/">Cyrus IMAP Server</a>, three lines: IMAP server, admin username, and admin password.  Cyrus::IMAP::Admin should be installed locally and the connection to the server secured.
-  <li><a name="deletecustomers">deletecustomers</a> - The existance of this file will enable customer deletions.  Be very careful!  Deleting a customer will remove all traces that this customer ever existed!  It should probably only be used when auditing a legacy database.  Normally, you cancel all of a customers' packages if they cancel service.
-  <li><a name="dirhash">dirhash</a> - Optional numeric value to control director hashing.  If positive, hashes directories for the specified number of levels from the front of the username.  If negative, hashes directories for the specified number of levels from the end of the username.  Some examples:
-    <ul>
-      <li>1: user -> <a href="#home">/home</a>/u/user
-      <li>2: user -> <a href="#home">/home</a>/u/s/user
-      <li>-1: user -> <a href="#home">/home</a>/r/user
-      <li>-2: user -> <a href="#home">home</a>/r/e/user
-    </ul>
-  <li><a name="disable_customer_referrals">disable_customer_referrals</a> - The existance of this file will disable new customer-to-customer referrals in the web interface.
-  <li><a name="domain"><font color="#ff0000">domain</font></a> - Your domain name.
-  <li><a name="editreferrals">editreferrals</a> - The existance of this file will allow you to change the referral of existing customers.
-  <li><a name="emailinvoiceonly">emailinvoiceonly</a> - Disables postal mail invoices.
-  <li><a name="emailinvoiceauto">emailinvoiceauto</a> - Automatically adds new accounts to the email invoice list upon customer creation.
-  <li><a name="erpcdmachines">erpcdmachines</a> - Your ERPCD authenticaion machines, one per line.  This enables export of `/usr/annex/acp_passwd' and `/usr/annex/acp_dialup'.
-  <li><a name="hidecancelledpackages">hidecancelledpackages</a> - The existance of this file will prevent cancelled packages from showing up in listings (though they will still be in the database)
-  <li><a name="hidecancelledcustomers">hidecancelledcustomers</a> - The existance of this file will prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)
-  <li><a name="home"><font color="#ff0000">home</font></a> - For new users, prefixed to usrename to create a directory name.  Should have a leading but not a trailing slash.
-  <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"><font color="#ff0000">invoice_from</font></a> - Return address on email invoices.
-  <li><a name="invoice_template"><font color="#ff0000">invoice_template</font></a> - Required template file for invoices.  See the <a href="billing.html">section on billing</a> for details.
-  <li><a name="lpr"><font color="#ff0000">lpr</font></a> - Print command for paper invoices, for example `lpr -h'.
-  <li><a name="maildisablecatchall">maildisablecatchall</a> - <b>DEPRECIATED</b>, now the default.  The existance of this file used to disable the requirement that each virtual domain have a catch-all mailbox.
-  <li><a name="money_char">money_char</a> - Currency symbol - defaults to `$'.
-  <li><a name="mxmachines">mxmachines</a> - MX entries for new domains, weight and machine, one per line, with trailing `.'
-  <li><a name="nsmachines">nsmachines</a> - NS nameservers for new domains, one per line, with trailing `.'
-  <li><a name="nismachines">nismachines</a> - Your NIS master (not slave master) machines, one per line.  This enables export of `/etc/global/passwd' and `/etc/global/shadow'.
-  <li><a name="passwordmin">passwordmin</a> - Minimum password length (default 6)
-  <li><a name="passwordmax">passwordmax</a> - Maximum password length (default 8) (don't set this over 12 if you need to import or export crypt() passwords)
-  <li><a name="qmailmachines">qmailmachines</a> - Your qmail machines, one per line.  This enables export of `/var/qmail/control/virtualdomains', `/var/qmail/control/recipientmap', and `/var/qmail/control/rcpthosts'.  The existance of this file (even if empty) also turns on user `.qmail-extension' file maintenance in conjunction with `shellmachine'.
-  <li><a name="radiusmachines">radiusmachines</a> - Your RADIUS authentication machines, one per line.  This enables export of `/etc/raddb/users'.
-  <li><a name="referraldefault">referraldefault</a> - Default referral, specified by refnum.
-  <li><a name="registries"><font color="#ff0000">registries</font></a> - Directory which contains domain registry information.  Each registry is a directory.
-    <ul>
-      <li>registries/internic - Currently the only supported registry
-        <ul>
-          <li>registries/internic/from - Email address from which InterNIC domain registrations are sent.
-          <li>regestries/internic/nameservers - The nameservers for InterNIC domain registrations, one per line.  Each line contains an IP address and hostname, separated by whitespace.
-          <li>registries/internic/tech_contact - Technical contact NIC handle for domain registrations.
-          <li>registries/internic/template - Template for InterNIC domain registrations with special markup.  A suitable copy of the InterNIC domain template v4.0 is in `fs-x.y.z/etc/domain-template.txt'.
-          <li>registries/internic/to - Email address to which InterNIC domain registrations are sent.
-        </ul>
-    </ul>
-  <li><a name="sendmailconfigpath">sendmailconfigpath</a> - Sendmail configuration file path - defaults to `/etc'.  Many newer distributions use `/etc/mail'.
-  <li><a name="sendmailmachines">sendmailmachines</a> - Your sendmail machines, one per line.  This enables export of `/etc/virtusertable' and `/etc/sendmail.cw'.
-  <li><a name="sendmailrestart">sendmailrestart</a> - If defined, the command which is run on sendmail machines after files are copied.
-  <li><a name="session-start">session-start</a> - If defined, the command which is executed on the Freeside machine when a session begins.  The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on.
-  <li><a name="session-stop">session-stop</a> - If defined, the command which is executed on the Freeside machine when a session ends.  The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on.
-  <li><a name="shellmachine">shellmachine</a> - A single machine with user home directories mounted.  This enables home directory creation, renaming and archiving/deletion.  In conjunction with `qmailmachines', it also enables `.qmail-extension' file maintenance.
-  <li><a name="shellmachine-useradd">shellmachine-useradd</a> - The command(s) to run on shellmachine when an account is created.  If this file does not exist, <code>useradd -d $dir -m -s $shell -u $uid $username</code> is the default.  If the file exists but is empty, <code>cp -pr /etc/skel $dir; chown -R $uid.$gid $dir</code> is the default instead.  Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$username</code>, <code>$uid</code>, <code>$gid</code>, <code>$dir</code>, and <code>$shell</code>.
-  <li><a name="shellmachine-userdel">shellmachine-userdel</a> - The command(s) to run on shellmachine when an account is deleted.  If this file does not exist, <code>userdel $username</code> is the default.  If the file exists but is empty, <code>rm -rf $dir</code> is the default instead.  Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$username</code> and <code>$dir</code>.
-  <li><a name="shellmachine-usermod">shellmachine-usermod</a> - The command(s) to run on shellmachine when an account is modified.  If this file does not exist or is empty, <code>[ -d $old_dir ] &amp;&amp; mv $old_dir $new_dir || ( chmod u+t $old_dir; mkdir $new_dir; cd $old_dir; find . -depth -print | cpio -pdm $new_dir; chmod u-t $new_dir; chown -R $uid.$gid $new_dir; rm -rf $old_dir )</code> is the default.  Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$old_dir</code>, <code>$new_dir</code>, <code>$uid</code> and <code>$gid</code>.
-  <li><a name="shellmachines">shellmachines</a> - Your Linux and System V flavored shell (and mail) machines, one per line.  This enables export of `/etc/passwd' and `/etc/shadow' files.
-  <li><a name="shells"><font color="#ff0000">shells</font></a> - Legal shells (think /etc/shells).  You probably want to `cut -d: -f7 /etc/passwd | sort | uniq' initially so that importing doesn't fail with `Illegal shell' errors, then remove any special entries afterwords.  A blank line specifies that an empty shell is permitted.
-  <li><a name="showpasswords">showpasswords</a> - The existance of this file will allow unencrypted user passwords to be displayed.
-  <li><a name="signupurl">signupurl</a> - if you are using customer-to-customer referrals, and you enter the URL of your <a href="signup.html">signup server CGI</a>, the customer view screen will display a customized link to the signup server with the appropriate customer as referral.
-  <li><a name="smtpmachine"><font color="#ff0000">smtpmachine</font></a> - SMTP relay for Freeside's outgoing mail.
-  <li><a name="soadefaultttl">soadefaultttl</a> - SOA default TTL for new domains.
-  <li><a name="soaemail">soaemail</a> - SOA email for new domains, in BIND form (`.' instead of `@'), with trailing `.'
-  <li><a name="soaexpire">soaexpire</a> - SOA expire for new domains
-  <li><a name="soamachine">soamachine</a> - SOA machine for new domains, with trailing `.'
-  <li><a name="soarefresh">soarefresh</a> - SOA refresh for new domains
-  <li><a name="soaretry">soaretry</a> - SOA retry for new domains
-  <li><a name="statedefault">statedefault</a> - Default state or province (if not supplied, the default is `CA')
-  <li><a name="textradiusprepend">textradiusprepend</a> - <b>DEPRECIATED</b>, use RADIUS check attributes instead.  This option will be removed soon.  The contents of this file will be prepended to the first line of a user's RADIUS entry in text exports.
-  <li><a name="unsuspendauto">unsuspendauto</a> _ The existance of this file will enable the automatic unsuspension of suspended packages when a customer's balance due changes from positive to zero or negative as the result of a payment or credit.
-  <li><a name="usernamemin">usernamemin</a> - Minimum username length (default 2);
-  <li><a name="usernamemax">usernamemax</a> - Maximum username length (default is the size of the SQL column, probably specified when fs-setup was run)
-  <li><a name="username-ampersand">username-ampersand</a> - The existance of this file will allow the ampersand character (&amp;) in usernames.  Be careful when using this option in conjunction with <a href="#shellmachine-useradd">shellmachine-useradd</a> and other configuration options which execute shell commands, as the ampersand will be interpreted by the shell if not quoted.
-  <li><a name="username-letter">username-letter</a> - The existance of this file will turn on the requirement that usernames contain at least one letter.
-  <li><a name="username-letterfirst">username-letterfirst</a> - The existance of this file will turn on the requirement that usernames start with a letter.
-  <li><a name="username-noperiod">username-noperiod</a> - The existance of this file will disallow periods in usernames.
-  <li><a name="username-uppercase">username-uppercase</a> - The existance of this file will allow uppercase characters in username.
-   <li><a name="username_policy">username_policy</a> - This file controls the mechanism for preventing duplicate usernames in passwd/radius files exported from svc_accts.  This should be one of 'prepend domsvc' 'append domsvc' or 'append domain'
-   <li><a name="vpopmailmachines">vpopmailmachines</a> - Your vpopmail pop toasters, one per line.  Each line is of the form "machinename vpopdir vpopuid vpopgid".  For example: <code>poptoaster.domain.tld /home/vpopmail 508 508</code>  Note: vpopuid and vpopgid are values taken from the vpopmail machine's /etc/passwd
-
+<li>Create the <b>/usr/local/etc/freeside/conf.<i>datasource</i></b> directory, for example, <b>/usr/local/etc/freeside/conf.DBI:Pg:host=localhost;dbname=freeside</b> (remember to backslash-escape the ; character when creating directories in the shell:
+<pre>mkdir&nbsp;/usr/local/etc/freeside/conf.DBI:Pg:host=localhost\;dbname=freeside
+</pre>
+<li>The rest of the configuration can be done with the web interface.  Select <u>Configuration</u> from the main menu and update your configuration values.
 </ul>
 </body>
-
+</html>
index 6861a17..c26c9a7 100644 (file)
@@ -9,7 +9,11 @@ Before installing, you need:
   <li><a href="http://perl.apache.org/">mod_perl</a>
   <li><a href="http://www.openssh.com//">SSH</a> (<a href="http://www.openssh.com//">OpenSSH</a> is recommended.  SSH Communications Security <a href="http://www.ssh.com/products/ssh/download.cfm">commercial SSH version 3</a> has been reported incompatible with Freeside.)
   <li><a href="http://www.perl.com/">Perl</a>  Don't enable experimental features like threads or the PerlIO abstraction layer.
-  <li>A <b>transactional</b> database engine supported by Perl's <a href="http://www.hermetica.com/technologia/DBI/">DBI</a>.  <a href="http://www.postgresql.org/">PostgreSQL</a> is recommended.  <b>MySQL's default <a href="http://www.mysql.com/doc/M/y/MyISAM.html">MyISAM</a> and <a href="http://www.mysql.com/doc/I/S/ISAM.html">ISAM</a> table types are not supported</b>.  If you really want to use MySQL, you need to use one of the new <a href="http://www.mysql.com/doc/T/a/Table_types.html">transaction-safe table types</a> such as <a href="http://www.mysql.com/doc/B/D/BDB.html">BDB</a>, and set it as the default table type using the <code>--default-table-type=BDB</code> <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Command-line_options">mysqld command-line option</a> or by setting <code>default-table-type=DBD</code> in the <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Option_files">my.cnf option file</a>.
+  <li>A <b>transactional</b> database engine supported by Perl's <a href="http://www.hermetica.com/technologia/DBI/">DBI</a>.
+    <ul>
+      <li><a href="http://www.postgresql.org/">PostgreSQL</a> is recommended.
+      <li>MySQL has been reported to work.  <b>MySQL's default <a href="http://www.mysql.com/doc/M/y/MyISAM.html">MyISAM</a> and <a href="http://www.mysql.com/doc/I/S/ISAM.html">ISAM</a> table types are not supported</b>.  If you really want to use MySQL, you need to use one of the new <a href="http://www.mysql.com/doc/T/a/Table_types.html">transaction-safe table types</a> such as <a href="http://www.mysql.com/doc/B/D/BDB.html">BDB</a>, and set it as the default table type using the <code>--default-table-type=BDB</code> <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Command-line_options">mysqld command-line option</a> or by setting <code>default-table-type=DBD</code> in the <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Option_files">my.cnf option file</a>.
+    </ul>
   <li>Perl modules (<a href="http://theoryx5.uwinnipeg.ca/CPAN/perl/CPAN.html">CPAN</a> will query, download and build perl modules automatically)
     <ul>
       <li><a href="http://search.cpan.org/search?dist=Array-PrintCols">Array-PrintCols</a>
index c459976..236b72b 100644 (file)
@@ -5,22 +5,18 @@
     </TITLE>
   </HEAD>
   <BODY BGCOLOR="#FFFFFF">
-  <table>
+  <table width="100%">
     <tr><td>
-    <P ALIGN=CENTER>
         <IMG BORDER=0 ALT="Silicon Interactive Software Design" SRC="images/small-logo.png">
     </td><td>
-      <center><font color="#ff0000" size=7>freeside main menu</font></center>
+      <font color="#ff0000" size=7>freeside main menu</font>
+    </td><td align=right valign=bottom>
+      version 1.4.0
+      <BR><A HREF="http://www.sisd.com/freeside">Freeside home page</A>
+      <BR><A HREF="docs/">Documentation</A>
     </td></tr>
   </table>
-      <A HREF="http://www.sisd.com/freeside">
-        Freeside home page
-      </A>
-      <BR><A HREF="docs/">
-        Documentation
-      </A>
-    </P>
-    <HR>
+    <hr noshade>
     <ul>
       <li><A HREF="edit/cust_main.cgi">New Customer</A>
       <li><A NAME="search">Search</A>
@@ -29,7 +25,8 @@
         <LI><A HREF="search/cust_main-payinfo.html">customers (by credit card number)</A>
         <LI><A HREF="search/svc_acct.html">accounts (by username)</A>
         <LI><A HREF="search/svc_domain.html">domains (by domain)</A>
-        <LI><A HREF="search/svc_acct_sm.html">mail aliases (by domain, and optionally username)</A>
+<!--        <LI><A HREF="search/svc_acct_sm.html">mail aliases (by domain, and optionally username)</A>-->
+        <LI><A HREF="search/svc_forward.html">mail forwards (by ?)</A>
         <LI><A HREF="search/cust_bill.html">invoices (by invoice number)</A>
         </ul>
       <li><A NAME="browse">Browse</A>
           <LI>services
             <UL>
               <LI>accounts (<A HREF="search/svc_acct.cgi?svcnum">by service number</A>) (<A HREF="search/svc_acct.cgi?username">by username</A>) (<A HREF="search/svc_acct.cgi?uid">by uid</A>)
+              <LI>mail forwards (<A HREF="search/svc_forward.cgi?svcnum">by service number</A>) (by ?))
               <LI>domains (<A HREF="search/svc_domain.cgi?svcnum">by service number</A>) (<A HREF="search/svc_domain.cgi?domain">by domain</A>)
             </UL>
           <LI>unlinked services
             <UL>
               <LI>unlinked accounts (<A HREF="search/svc_acct.cgi?UN_svcnum">by service number</A>) (<A HREF="search/svc_acct.cgi?UN_username">by username</A>) (<A HREF="search/svc_acct.cgi?UN_uid">by uid</A>)
+              <LI>unlinked mail forwards (<A HREF="search/svc_forward.cgi?UN_svcnum">by service number</A>) (by ?))
               <LI>unlinked domains (<A HREF="search/svc_domain.cgi?UN_svcnum">by service number</A>) (<A HREF="search/svc_domain.cgi?UN_domain">by domain</A>)
             </UL>
           <LI><A HREF="browse/nas.cgi">NAS ports</A>
           <LI><A HREF="browse/queue.cgi">Joe queue</A>
         </ul>
+    </ul>
+    <hr noshade>
+    <ul>
+      <li><A NAME="config" HREF="config/config-view.cgi">Configuration</a><!-- - <font size="+2" color="#ff0000">start here</font> -->
       <li><A NAME="admin">Administration</a>
         <ul>
           <LI><A HREF="browse/part_svc.cgi">View/Edit service definitions</A>
index 37aed61..64085ea 100755 (executable)
@@ -1,5 +1,5 @@
 <%
-# <!-- $Id: svc_acct.cgi,v 1.5 2001-09-11 20:44:08 ivan Exp $ -->
+# <!-- $Id: svc_acct.cgi,v 1.6 2001-10-24 15:29:31 ivan Exp $ -->
 
 use strict;
 use vars qw( $cgi @svc_acct $sortby $query $mydomain );
@@ -7,7 +7,7 @@ use CGI;
 use CGI::Carp qw(fatalsToBrowser);
 use FS::UID qw(cgisuidsetup);
 use FS::Record qw(qsearch qsearchs dbdef);
-use FS::CGI qw(header eidiot popurl table);
+use FS::CGI qw(header idiot popurl table);
 use FS::svc_acct;
 use FS::cust_main;
 
@@ -54,9 +54,9 @@ if ( $query eq 'svcnum' ) {
 if ( scalar(@svc_acct) == 1 ) {
   my($svcnum)=$svc_acct[0]->svcnum;
   print $cgi->redirect(popurl(2). "view/svc_acct.cgi?$svcnum");  #redirect
-  exit;
+  #exit;
 } elsif ( scalar(@svc_acct) == 0 ) { #error
-  eidiot("Account not found");
+  idiot("Account not found");
 } else {
   my($total)=scalar(@svc_acct);
   print $cgi->header( '-expires' => 'now' ),