15ac23d532d7f839f0117c8e10d09e5f52319e3d
[freeside.git] / FS / FS / Conf.pm
1 package FS::Conf;
2
3 use vars qw($default_dir @config_items $DEBUG );
4 use IO::File;
5 use File::Basename;
6 use FS::ConfItem;
7
8 $DEBUG = 0;
9
10 =head1 NAME
11
12 FS::Conf - Freeside configuration values
13
14 =head1 SYNOPSIS
15
16   use FS::Conf;
17
18   $conf = new FS::Conf "/config/directory";
19
20   $FS::Conf::default_dir = "/config/directory";
21   $conf = new FS::Conf;
22
23   $dir = $conf->dir;
24
25   $value = $conf->config('key');
26   @list  = $conf->config('key');
27   $bool  = $conf->exists('key');
28
29   $conf->touch('key');
30   $conf->set('key' => 'value');
31   $conf->delete('key');
32
33   @config_items = $conf->config_items;
34
35 =head1 DESCRIPTION
36
37 Read and write Freeside configuration values.  Keys currently map to filenames,
38 but this may change in the future.
39
40 =head1 METHODS
41
42 =over 4
43
44 =item new [ DIRECTORY ]
45
46 Create a new configuration object.  A directory arguement is required if
47 $FS::Conf::default_dir has not been set.
48
49 =cut
50
51 sub new {
52   my($proto,$dir) = @_;
53   my($class) = ref($proto) || $proto;
54   my($self) = { 'dir' => $dir || $default_dir } ;
55   bless ($self, $class);
56 }
57
58 =item dir
59
60 Returns the directory.
61
62 =cut
63
64 sub dir {
65   my($self) = @_;
66   my $dir = $self->{dir};
67   -e $dir or die "FATAL: $dir doesn't exist!";
68   -d $dir or die "FATAL: $dir isn't a directory!";
69   -r $dir or die "FATAL: Can't read $dir!";
70   -x $dir or die "FATAL: $dir not searchable (executable)!";
71   $dir =~ /^(.*)$/;
72   $1;
73 }
74
75 =item config KEY
76
77 Returns the configuration value or values (depending on context) for key.
78
79 =cut
80
81 sub config {
82   my($self,$file)=@_;
83   my($dir)=$self->dir;
84   my $fh = new IO::File "<$dir/$file" or return;
85   if ( wantarray ) {
86     map {
87       /^(.*)$/
88         or die "Illegal line (array context) in $dir/$file:\n$_\n";
89       $1;
90     } <$fh>;
91   } else {
92     <$fh> =~ /^(.*)$/
93       or die "Illegal line (scalar context) in $dir/$file:\n$_\n";
94     $1;
95   }
96 }
97
98 =item exists KEY
99
100 Returns true if the specified key exists, even if the corresponding value
101 is undefined.
102
103 =cut
104
105 sub exists {
106   my($self,$file)=@_;
107   my($dir) = $self->dir;
108   -e "$dir/$file";
109 }
110
111 =item config_orbase KEY SUFFIX
112
113 Returns the configuration value or values (depending on context) for 
114 KEY_SUFFIX, if it exists, otherwise for KEY
115
116 =cut
117
118 sub config_orbase {
119   my( $self, $file, $suffix ) = @_;
120   if ( $self->exists("${file}_$suffix") ) {
121     $self->config("${file}_$suffix");
122   } else {
123     $self->config($file);
124   }
125 }
126
127 =item touch KEY
128
129 Creates the specified configuration key if it does not exist.
130
131 =cut
132
133 sub touch {
134   my($self, $file) = @_;
135   my $dir = $self->dir;
136   unless ( $self->exists($file) ) {
137     warn "[FS::Conf] TOUCH $file\n" if $DEBUG;
138     system('touch', "$dir/$file");
139   }
140 }
141
142 =item set KEY VALUE
143
144 Sets the specified configuration key to the given value.
145
146 =cut
147
148 sub set {
149   my($self, $file, $value) = @_;
150   my $dir = $self->dir;
151   $value =~ /^(.*)$/s;
152   $value = $1;
153   unless ( join("\n", @{[ $self->config($file) ]}) eq $value ) {
154     warn "[FS::Conf] SET $file\n" if $DEBUG;
155 #    warn "$dir" if is_tainted($dir);
156 #    warn "$dir" if is_tainted($file);
157     chmod 0644, "$dir/$file";
158     my $fh = new IO::File ">$dir/$file" or return;
159     chmod 0644, "$dir/$file";
160     print $fh "$value\n";
161   }
162 }
163 #sub is_tainted {
164 #             return ! eval { join('',@_), kill 0; 1; };
165 #         }
166
167 =item delete KEY
168
169 Deletes the specified configuration key.
170
171 =cut
172
173 sub delete {
174   my($self, $file) = @_;
175   my $dir = $self->dir;
176   if ( $self->exists($file) ) {
177     warn "[FS::Conf] DELETE $file\n";
178     unlink "$dir/$file";
179   }
180 }
181
182 =item config_items
183
184 Returns all of the possible configuration items as FS::ConfItem objects.  See
185 L<FS::ConfItem>.
186
187 =cut
188
189 sub config_items {
190   my $self = shift; 
191   #quelle kludge
192   @config_items,
193   ( map { 
194         my $basename = basename($_);
195         $basename =~ /^(.*)$/;
196         $basename = $1;
197         new FS::ConfItem {
198                            'key'         => $basename,
199                            'section'     => 'billing',
200                            'description' => 'Alternate template file for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
201                            'type'        => 'textarea',
202                          }
203       } glob($self->dir. '/invoice_template_*')
204   ),
205   ( map { 
206         my $basename = basename($_);
207         $basename =~ /^(.*)$/;
208         $basename = $1;
209         new FS::ConfItem {
210                            'key'         => $basename,
211                            'section'     => 'billing',
212                            'description' => 'Alternate HTML template for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
213                            'type'        => 'textarea',
214                          }
215       } glob($self->dir. '/invoice_html_*')
216   ),
217   ( map { 
218         my $basename = basename($_);
219         $basename =~ /^(.*)$/;
220         $basename = $1;
221         ($latexname = $basename ) =~ s/latex/html/;
222         new FS::ConfItem {
223                            'key'         => $basename,
224                            'section'     => 'billing',
225                            'description' => "Alternate Notes section for HTML invoices.  Defaults to the same data in $latexname if not specified.",
226                            'type'        => 'textarea',
227                          }
228       } glob($self->dir. '/invoice_htmlnotes_*')
229   ),
230   ( map { 
231         my $basename = basename($_);
232         $basename =~ /^(.*)$/;
233         $basename = $1;
234         new FS::ConfItem {
235                            'key'         => $basename,
236                            'section'     => 'billing',
237                            'description' => 'Alternate LaTeX template for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
238                            'type'        => 'textarea',
239                          }
240       } glob($self->dir. '/invoice_latex_*')
241   ),
242   ( map { 
243         my $basename = basename($_);
244         $basename =~ /^(.*)$/;
245         $basename = $1;
246         new FS::ConfItem {
247                            'key'         => $basename,
248                            'section'     => 'billing',
249                            'description' => 'Alternate Notes section for LaTeX typeset PostScript invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
250                            'type'        => 'textarea',
251                          }
252       } glob($self->dir. '/invoice_latexnotes_*')
253   );
254 }
255
256 =back
257
258 =head1 BUGS
259
260 If this was more than just crud that will never be useful outside Freeside I'd
261 worry that config_items is freeside-specific and icky.
262
263 =head1 SEE ALSO
264
265 "Configuration" in the web interface (config/config.cgi).
266
267 httemplate/docs/config.html
268
269 =cut
270
271 @config_items = map { new FS::ConfItem $_ } (
272
273   {
274     'key'         => 'address',
275     'section'     => 'deprecated',
276     'description' => 'This configuration option is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.',
277     'type'        => 'text',
278   },
279
280   {
281     'key'         => 'alerter_template',
282     'section'     => 'billing',
283     'description' => 'Template file for billing method expiration alerts.  See the <a href="../docs/billing.html#invoice_template">billing documentation</a> for details.',
284     'type'        => 'textarea',
285   },
286
287   {
288     'key'         => 'apacheroot',
289     'section'     => 'deprecated',
290     'description' => '<b>DEPRECATED</b>, add a <i>www_shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead.  The directory containing Apache virtual hosts',
291     'type'        => 'text',
292   },
293
294   {
295     'key'         => 'apacheip',
296     'section'     => 'deprecated',
297     'description' => '<b>DEPRECATED</b>, add an <i>apache</i> <a href="../browse/part_export.cgi">export</a> instead.  Used to be the current IP address to assign to new virtual hosts',
298     'type'        => 'text',
299   },
300
301   {
302     'key'         => 'apachemachine',
303     'section'     => 'deprecated',
304     'description' => '<b>DEPRECATED</b>, add a <i>www_shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead.  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.',
305     'type'        => 'text',
306   },
307
308   {
309     'key'         => 'apachemachines',
310     'section'     => 'deprecated',
311     'description' => '<b>DEPRECATED</b>, add an <i>apache</i> <a href="../browse/part_export.cgi">export</a> instead.  Used to be 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.',
312     'type'        => 'textarea',
313   },
314
315   {
316     'key'         => 'bindprimary',
317     'section'     => 'deprecated',
318     'description' => '<b>DEPRECATED</b>, add a <i>bind</i> <a href="../browse/part_export.cgi">export</a> instead.  Your BIND primary nameserver.  This enables export of /var/named/named.conf and zone files into /var/named',
319     'type'        => 'text',
320   },
321
322   {
323     'key'         => 'bindsecondaries',
324     'section'     => 'deprecated',
325     'description' => '<b>DEPRECATED</b>, add a <i>bind_slave</i> <a href="../browse/part_export.cgi">export</a> instead.  Your BIND secondary nameservers, one per line.  This enables export of /var/named/named.conf',
326     'type'        => 'textarea',
327   },
328
329   {
330     'key'         => 'encryption',
331     'section'     => 'billing',
332     'description' => 'Enable encryption of credit cards.',
333     'type'        => 'checkbox',
334   },
335
336   {
337     'key'         => 'encryptionmodule',
338     'section'     => 'billing',
339     'description' => 'Use which module for encryption?',
340     'type'        => 'text',
341   },
342
343   {
344     'key'         => 'encryptionpublickey',
345     'section'     => 'billing',
346     'description' => 'Your RSA Public Key - Required if Encryption is turned on.',
347     'type'        => 'textarea',
348   },
349
350   {
351     'key'         => 'encryptionprivatekey',
352     'section'     => 'billing',
353     'description' => 'Your RSA Private Key - Including this will enable the "Bill Now" feature.  However if the system is compromised, a hacker can use this key to decode the stored credit card information.  This is generally not a good idea.',
354     'type'        => 'textarea',
355   },
356
357   {
358     'key'         => 'business-onlinepayment',
359     'section'     => 'billing',
360     '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.',
361     'type'        => 'textarea',
362   },
363
364   {
365     'key'         => 'business-onlinepayment-ach',
366     'section'     => 'billing',
367     'description' => 'Alternate <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> support for ACH transactions (defaults to regular <b>business-onlinepayment</b>).  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.',
368     'type'        => 'textarea',
369   },
370
371   {
372     'key'         => 'business-onlinepayment-description',
373     'section'     => 'billing',
374     'description' => 'String passed as the description field to <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a>.  Evaluated as a double-quoted perl string, with the following variables available: <code>$agent</code> (the agent name), and <code>$pkgs</code> (a comma-separated list of packages for which these charges apply)',
375     'type'        => 'text',
376   },
377
378   {
379     'key'         => 'business-onlinepayment-email-override',
380     'section'     => 'billing',
381     'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
382     'type'        => 'text',
383   },
384
385   {
386     'key'         => 'bsdshellmachines',
387     'section'     => 'deprecated',
388     'description' => '<b>DEPRECATED</b>, add a <i>bsdshell</i> <a href="../browse/part_export.cgi">export</a> instead.  Your BSD flavored shell (and mail) machines, one per line.  This enables export of `/etc/passwd\' and `/etc/master.passwd\'.',
389     'type'        => 'textarea',
390   },
391
392   {
393     'key'         => 'countrydefault',
394     'section'     => 'UI',
395     'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
396     'type'        => 'text',
397   },
398
399   {
400     'key'         => 'cyrus',
401     'section'     => 'deprecated',
402     'description' => '<b>DEPRECATED</b>, add a <i>cyrus</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to integrate 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.',
403     'type'        => 'textarea',
404   },
405
406   {
407     'key'         => 'cp_app',
408     'section'     => 'deprecated',
409     'description' => '<b>DEPRECATED</b>, add a <i>cp</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to integrate with <a href="http://www.cp.net/">Critial Path Account Provisioning Protocol</a>, four lines: "host:port", username, password, and workgroup (for new users).',
410     'type'        => 'textarea',
411   },
412
413   {
414     'key'         => 'deletecustomers',
415     'section'     => 'UI',
416     'description' => '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.',
417     'type'        => 'checkbox',
418   },
419
420   {
421     'key'         => 'deletepayments',
422     'section'     => 'UI',
423     'description' => 'Enable deletion of unclosed payments.  Be very careful!  Only delete payments that were data-entry errors, not adjustments.  Optionally specify one or more comma-separated email addresses to be notified when a payment is deleted.',
424     'type'        => [qw( checkbox text )],
425   },
426
427   {
428     'key'         => 'deletecredits',
429     'section'     => 'UI',
430     'description' => 'Enable deletion of unclosed credits.  Be very careful!  Only delete credits that were data-entry errors, not adjustments.  Optionally specify one or more comma-separated email addresses to be notified when a credit is deleted.',
431     'type'        => [qw( checkbox text )],
432   },
433
434   {
435     'key'         => 'unapplypayments',
436     'section'     => 'UI',
437     'description' => 'Enable "unapplication" of unclosed payments.',
438     'type'        => 'checkbox',
439   },
440
441   {
442     'key'         => 'unapplycredits',
443     'section'     => 'UI',
444     'description' => 'Enable "unapplication" of unclosed credits.',
445     'type'        => 'checkbox',
446   },
447
448   {
449     'key'         => 'dirhash',
450     'section'     => 'shell',
451     '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>',
452     'type'        => 'text',
453   },
454
455   {
456     'key'         => 'disable_customer_referrals',
457     'section'     => 'UI',
458     'description' => 'Disable new customer-to-customer referrals in the web interface',
459     'type'        => 'checkbox',
460   },
461
462   {
463     'key'         => 'editreferrals',
464     'section'     => 'UI',
465     'description' => 'Enable advertising source modification for existing customers',
466     'type'       => 'checkbox',
467   },
468
469   {
470     'key'         => 'emailinvoiceonly',
471     'section'     => 'billing',
472     'description' => 'Disables postal mail invoices',
473     'type'       => 'checkbox',
474   },
475
476   {
477     'key'         => 'disablepostalinvoicedefault',
478     'section'     => 'billing',
479     'description' => 'Disables postal mail invoices as the default option in the UI.  Be careful not to setup customers which are not sent invoices.  See <a href ="#emailinvoiceauto">emailinvoiceauto</a>.',
480     'type'       => 'checkbox',
481   },
482
483   {
484     'key'         => 'emailinvoiceauto',
485     'section'     => 'billing',
486     'description' => 'Automatically adds new accounts to the email invoice list',
487     'type'       => 'checkbox',
488   },
489
490   {
491     'key'         => 'exclude_ip_addr',
492     'section'     => '',
493     'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
494     'type'        => 'textarea',
495   },
496   
497   {
498     'key'         => 'erpcdmachines',
499     'section'     => 'deprecated',
500     'description' => '<b>DEPRECATED</b>, ERPCD is no longer supported.  Used to be ERPCD authenticaion machines, one per line.  This enables export of `/usr/annex/acp_passwd\' and `/usr/annex/acp_dialup\'',
501     'type'        => 'textarea',
502   },
503
504   {
505     'key'         => 'hidecancelledpackages',
506     'section'     => 'UI',
507     'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
508     'type'        => 'checkbox',
509   },
510
511   {
512     'key'         => 'hidecancelledcustomers',
513     'section'     => 'UI',
514     'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
515     'type'        => 'checkbox',
516   },
517
518   {
519     'key'         => 'home',
520     'section'     => 'required',
521     'description' => 'For new users, prefixed to username to create a directory name.  Should have a leading but not a trailing slash.',
522     'type'        => 'text',
523   },
524
525   {
526     'key'         => 'icradiusmachines',
527     'section'     => 'deprecated',
528     'description' => '<b>DEPRECATED</b>, add an <i>sqlradius</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to enable radcheck and radreply table population - by default in the Freeside database, or in the database specified by the <a href="http://rootwood.haze.st/aspside/config/config-view.cgi#icradius_secrets">icradius_secrets</a> config option (the radcheck and radreply tables needs to be created manually).  You do not need to use MySQL for your Freeside database to export to an ICRADIUS/FreeRADIUS MySQL database with this option.  <blockquote><b>ADDITIONAL DEPRECATED FUNCTIONALITY</b> (instead use <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Replication">MySQL replication</a> or point icradius_secrets to the external database) - your <a href="ftp://ftp.cheapnet.net/pub/icradius">ICRADIUS</a> machines or <a href="http://www.freeradius.org/">FreeRADIUS</a> (with MySQL authentication) machines, one per line.  Machines listed in this file will have the radcheck table exported to them.  Each line 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></blockquote>',
529     'type'        => [qw( checkbox textarea )],
530   },
531
532   {
533     'key'         => 'icradius_mysqldest',
534     'section'     => 'deprecated',
535     'description' => '<b>DEPRECATED</b>, add an <i>sqlradius</i> <a href="../browse/part_export.cgi">export</a> instead.  Used to be the destination directory for the MySQL databases, on the ICRADIUS/FreeRADIUS machines.  Defaults to "/usr/local/var/".',
536     'type'        => 'text',
537   },
538
539   {
540     'key'         => 'icradius_mysqlsource',
541     'section'     => 'deprecated',
542     'description' => '<b>DEPRECATED</b>, add an <i>sqlradius</i> <a href="../browse/part_export.cgi">export</a> instead.  Used to be the source directory for for the MySQL radcheck table files, on the Freeside machine.  Defaults to "/usr/local/var/freeside".',
543     'type'        => 'text',
544   },
545
546   {
547     'key'         => 'icradius_secrets',
548     'section'     => 'deprecated',
549     'description' => '<b>DEPRECATED</b>, add an <i>sqlradius</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to specify a database for ICRADIUS/FreeRADIUS export.  Three lines: DBI data source, username and password.',
550     'type'        => 'textarea',
551   },
552
553   {
554     'key'         => 'invoice_from',
555     'section'     => 'required',
556     'description' => 'Return address on email invoices',
557     'type'        => 'text',
558   },
559
560   {
561     'key'         => 'invoice_template',
562     'section'     => 'required',
563     'description' => 'Required template file for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
564     'type'        => 'textarea',
565   },
566
567   {
568     'key'         => 'invoice_html',
569     'section'     => 'billing',
570     'description' => 'Optional HTML template for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
571
572     'type'        => 'textarea',
573   },
574
575   {
576     'key'         => 'invoice_htmlnotes',
577     'section'     => 'billing',
578     'description' => 'Notes section for HTML invoices.  Defaults to the same data in invoice_latexnotes if not specified.',
579     'type'        => 'textarea',
580   },
581
582   {
583     'key'         => 'invoice_htmlfooter',
584     'section'     => 'billing',
585     'description' => 'Footer for HTML invoices.  Defaults to the same data in invoice_latexfooter if not specified.',
586     'type'        => 'textarea',
587   },
588
589   {
590     'key'         => 'invoice_htmlreturnaddress',
591     'section'     => 'billing',
592     'description' => 'Return address for HTML invoices.  Defaults to the same data in invoice_latexreturnaddress if not specified.',
593     'type'        => 'textarea',
594   },
595
596   {
597     'key'         => 'invoice_latex',
598     'section'     => 'billing',
599     'description' => 'Optional LaTeX template for typeset PostScript invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
600     'type'        => 'textarea',
601   },
602
603   {
604     'key'         => 'invoice_latexnotes',
605     'section'     => 'billing',
606     'description' => 'Notes section for LaTeX typeset PostScript invoices.',
607     'type'        => 'textarea',
608   },
609
610   {
611     'key'         => 'invoice_latexfooter',
612     'section'     => 'billing',
613     'description' => 'Footer for LaTeX typeset PostScript invoices.',
614     'type'        => 'textarea',
615   },
616
617   {
618     'key'         => 'invoice_latexreturnaddress',
619     'section'     => 'billing',
620     'description' => 'Return address for LaTeX typeset PostScript invoices.',
621     'type'        => 'textarea',
622   },
623
624   {
625     'key'         => 'invoice_latexsmallfooter',
626     'section'     => 'billing',
627     'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
628     'type'        => 'textarea',
629   },
630
631   {
632     'key'         => 'invoice_email_pdf',
633     'section'     => 'billing',
634     'description' => 'Send PDF invoice as an attachment to emailed invoices.  By default, includes the plain text invoice as the email body, unless invoice_email_pdf_note is set.',
635     'type'        => 'checkbox'
636   },
637
638   {
639     'key'         => 'invoice_email_pdf_note',
640     'section'     => 'billing',
641     'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.',
642     'type'        => 'textarea'
643   },
644
645
646   { 
647     'key'         => 'invoice_default_terms',
648     'section'     => 'billing',
649     'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
650     'type'        => 'select',
651     'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 30', 'Net 45', 'Net 60' ],
652   },
653
654   {
655     'key'         => 'invoice_send_receipts',
656     'section'     => 'deprecated',q
657     'description' => '<b>DEPRECATED</b>, this used to send an invoice copy on payments and credits.  See the payment_receipt_email and XXXX instead.',
658     'type'        => 'checkbox',
659   },
660
661   {
662     'key'         => 'payment_receipt_email',
663     'section'     => 'billing',
664     'description' => 'Template file for payment receipts.',
665     'type'        => 'textarea',
666   },
667
668   {
669     'key'         => 'lpr',
670     'section'     => 'required',
671     'description' => 'Print command for paper invoices, for example `lpr -h\'',
672     'type'        => 'text',
673   },
674
675   {
676     'key'         => 'maildisablecatchall',
677     'section'     => 'deprecated',
678     'description' => '<b>DEPRECATED</b>, now the default.  Turning this option on used to disable the requirement that each virtual domain have a catch-all mailbox.',
679     'type'        => 'checkbox',
680   },
681
682   {
683     'key'         => 'money_char',
684     'section'     => '',
685     'description' => 'Currency symbol - defaults to `$\'',
686     'type'        => 'text',
687   },
688
689   {
690     'key'         => 'mxmachines',
691     'section'     => 'deprecated',
692     'description' => 'MX entries for new domains, weight and machine, one per line, with trailing `.\'',
693     'type'        => 'textarea',
694   },
695
696   {
697     'key'         => 'nsmachines',
698     'section'     => 'deprecated',
699     'description' => 'NS nameservers for new domains, one per line, with trailing `.\'',
700     'type'        => 'textarea',
701   },
702
703   {
704     'key'         => 'defaultrecords',
705     'section'     => 'BIND',
706     'description' => 'DNS entries to add automatically when creating a domain',
707     'type'        => 'editlist',
708     'editlist_parts' => [ { type=>'text' },
709                           { type=>'immutable', value=>'IN' },
710                           { type=>'select',
711                             select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS TXT)} },
712                           { type=> 'text' }, ],
713   },
714
715   {
716     'key'         => 'arecords',
717     'section'     => 'deprecated',
718     'description' => 'A list of tab seperated CNAME records to add automatically when creating a domain',
719     'type'        => 'textarea',
720   },
721
722   {
723     'key'         => 'cnamerecords',
724     'section'     => 'deprecated',
725     'description' => 'A list of tab seperated CNAME records to add automatically when creating a domain',
726     'type'        => 'textarea',
727   },
728
729   {
730     'key'         => 'nismachines',
731     'section'     => 'deprecated',
732     'description' => '<b>DEPRECATED</b>.  Your NIS master (not slave master) machines, one per line.  This enables export of `/etc/global/passwd\' and `/etc/global/shadow\'.',
733     'type'        => 'textarea',
734   },
735
736   {
737     'key'         => 'passwordmin',
738     'section'     => 'password',
739     'description' => 'Minimum password length (default 6)',
740     'type'        => 'text',
741   },
742
743   {
744     'key'         => 'passwordmax',
745     'section'     => 'password',
746     'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
747     'type'        => 'text',
748   },
749
750   {
751     'key' => 'password-noampersand',
752     'section' => 'password',
753     'description' => 'Disallow ampersands in passwords',
754     'type' => 'checkbox',
755   },
756
757   {
758     'key' => 'password-noexclamation',
759     'section' => 'password',
760     'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
761     'type' => 'checkbox',
762   },
763
764   {
765     'key'         => 'qmailmachines',
766     'section'     => 'deprecated',
767     'description' => '<b>DEPRECATED</b>, add <i>qmail</i> and <i>shellcommands</i> <a href="../browse/part_export.cgi">exports</a> instead.  This option used to export `/var/qmail/control/virtualdomains\', `/var/qmail/control/recipientmap\', and `/var/qmail/control/rcpthosts\'.  Setting this option (even if empty) also turns on user `.qmail-extension\' file maintenance in conjunction with the <b>shellmachine</b> option.',
768     'type'        => [qw( checkbox textarea )],
769   },
770
771   {
772     'key'         => 'radiusmachines',
773     'section'     => 'deprecated',
774     'description' => '<b>DEPRECATED</b>, add an <i>sqlradius</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to export to be: your RADIUS authentication machines, one per line.  This enables export of `/etc/raddb/users\'.',
775     'type'        => 'textarea',
776   },
777
778   {
779     'key'         => 'referraldefault',
780     'section'     => 'UI',
781     'description' => 'Default referral, specified by refnum',
782     'type'        => 'text',
783   },
784
785 #  {
786 #    'key'         => 'registries',
787 #    'section'     => 'required',
788 #    'description' => 'Directory which contains domain registry information.  Each registry is a directory.',
789 #  },
790
791   {
792     'key'         => 'report_template',
793     'section'     => 'deprecated',
794     'description' => 'Deprecated template file for reports.',
795     'type'        => 'textarea',
796   },
797
798
799   {
800     'key'         => 'maxsearchrecordsperpage',
801     'section'     => 'UI',
802     'description' => 'If set, number of search records to return per page.',
803     'type'        => 'text',
804   },
805
806   {
807     'key'         => 'sendmailconfigpath',
808     'section'     => 'deprecated',
809     'description' => '<b>DEPRECATED</b>, add a <i>sendmail</i> <a href="../browse/part_export.cgi">export</a> instead.  Used to be sendmail configuration file path.  Defaults to `/etc\'.  Many newer distributions use `/etc/mail\'.',
810     'type'        => 'text',
811   },
812
813   {
814     'key'         => 'sendmailmachines',
815     'section'     => 'deprecated',
816     'description' => '<b>DEPRECATED</b>, add a <i>sendmail</i> <a href="../browse/part_export.cgi">export</a> instead.  Used to be sendmail machines, one per line.  This enables export of `/etc/virtusertable\' and `/etc/sendmail.cw\'.',
817     'type'        => 'textarea',
818   },
819
820   {
821     'key'         => 'sendmailrestart',
822     'section'     => 'deprecated',
823     'description' => '<b>DEPRECATED</b>, add a <i>sendmail</i> <a href="../browse/part_export.cgi">export</a> instead.  Used to define the command which is run on sendmail machines after files are copied.',
824     'type'        => 'text',
825   },
826
827   {
828     'key'         => 'session-start',
829     'section'     => 'session',
830     '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.',
831     'type'        => 'text',
832   },
833
834   {
835     'key'         => 'session-stop',
836     'section'     => 'session',
837     '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.',
838     'type'        => 'text',
839   },
840
841   {
842     'key'         => 'shellmachine',
843     'section'     => 'deprecated',
844     'description' => '<b>DEPRECATED</b>, add a <i>shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to contain 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.',
845     'type'        => 'text',
846   },
847
848   {
849     'key'         => 'shellmachine-useradd',
850     'section'     => 'deprecated',
851     'description' => '<b>DEPRECATED</b>, add a <i>shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to contain command(s) to run on shellmachine when an account is created.  If the <b>shellmachine</b> option is set but this option is not, <code>useradd -d $dir -m -s $shell -u $uid $username</code> is the default.  If this option is set but empty, <code>cp -pr /etc/skel $dir; chown -R $uid.$gid $dir</code> is the default instead.  Otherwise the value is evaluated 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>.',
852     'type'        => [qw( checkbox text )],
853   },
854
855   {
856     'key'         => 'shellmachine-userdel',
857     'section'     => 'deprecated',
858     'description' => '<b>DEPRECATED</b>, add a <i>shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to contain command(s) to run on shellmachine when an account is deleted.  If the <b>shellmachine</b> option is set but this option is not, <code>userdel $username</code> is the default.  If this option is set but empty, <code>rm -rf $dir</code> is the default instead.  Otherwise the value is evaluated as a double-quoted perl string, with the following variables available: <code>$username</code> and <code>$dir</code>.',
859     'type'        => [qw( checkbox text )],
860   },
861
862   {
863     'key'         => 'shellmachine-usermod',
864     'section'     => 'deprecated',
865     'description' => '<b>DEPRECATED</b>, add a <i>shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to contain command(s) to run on shellmachine when an account is modified.  If the <b>shellmachine</b> option is set but this option 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>.',
866     #'type'        => [qw( checkbox text )],
867     'type'        => 'text',
868   },
869
870   {
871     'key'         => 'shellmachines',
872     'section'     => 'deprecated',
873     'description' => '<b>DEPRECATED</b>, add a <i>sysvshell</i> <a href="../browse/part_export.cgi">export</a> instead.  Your Linux and System V flavored shell (and mail) machines, one per line.  This enables export of `/etc/passwd\' and `/etc/shadow\' files.',
874      'type'        => 'textarea',
875  },
876
877   {
878     'key'         => 'shells',
879     'section'     => 'required',
880     '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.',
881     'type'        => 'textarea',
882   },
883
884   {
885     'key'         => 'showpasswords',
886     'section'     => 'UI',
887     'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
888     'type'        => 'checkbox',
889   },
890
891   {
892     'key'         => 'signupurl',
893     'section'     => 'UI',
894     'description' => 'if you are using customer-to-customer referrals, and you enter the URL of your <a href="../docs/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',
895     'type'        => 'text',
896   },
897
898   {
899     'key'         => 'smtpmachine',
900     'section'     => 'required',
901     'description' => 'SMTP relay for Freeside\'s outgoing mail',
902     'type'        => 'text',
903   },
904
905   {
906     'key'         => 'soadefaultttl',
907     'section'     => 'BIND',
908     'description' => 'SOA default TTL for new domains.',
909     'type'        => 'text',
910   },
911
912   {
913     'key'         => 'soaemail',
914     'section'     => 'BIND',
915     'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
916     'type'        => 'text',
917   },
918
919   {
920     'key'         => 'soaexpire',
921     'section'     => 'BIND',
922     'description' => 'SOA expire for new domains',
923     'type'        => 'text',
924   },
925
926   {
927     'key'         => 'soamachine',
928     'section'     => 'BIND',
929     'description' => 'SOA machine for new domains, with trailing `.\'',
930     'type'        => 'text',
931   },
932
933   {
934     'key'         => 'soarefresh',
935     'section'     => 'BIND',
936     'description' => 'SOA refresh for new domains',
937     'type'        => 'text',
938   },
939
940   {
941     'key'         => 'soaretry',
942     'section'     => 'BIND',
943     'description' => 'SOA retry for new domains',
944     'type'        => 'text',
945   },
946
947   {
948     'key'         => 'statedefault',
949     'section'     => 'UI',
950     'description' => 'Default state or province (if not supplied, the default is `CA\')',
951     'type'        => 'text',
952   },
953
954   {
955     'key'         => 'radiusprepend',
956     'section'     => 'deprecated',
957     'description' => '<b>DEPRECATED</b>, real-time text radius now edits an existing file in place - just (turn off freeside-queued and) edit your RADIUS users file directly.  The contents used to be be prepended to the top of the RADIUS users file (text exports only).',
958     'type'        => 'textarea',
959   },
960
961   {
962     'key'         => 'textradiusprepend',
963     'section'     => 'deprecated',
964     'description' => '<b>DEPRECATED</b>, use RADIUS check attributes instead.  The contents used to be prepended to the first line of a user\'s RADIUS entry in text exports.',
965     'type'        => 'text',
966   },
967
968   {
969     'key'         => 'unsuspendauto',
970     'section'     => 'billing',
971     'description' => 'Enables 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',
972     'type'        => 'checkbox',
973   },
974
975   {
976     'key'         => 'usernamemin',
977     'section'     => 'username',
978     'description' => 'Minimum username length (default 2)',
979     'type'        => 'text',
980   },
981
982   {
983     'key'         => 'usernamemax',
984     'section'     => 'username',
985     'description' => 'Maximum username length',
986     'type'        => 'text',
987   },
988
989   {
990     'key'         => 'username-ampersand',
991     'section'     => 'username',
992     'description' => 'Allow the ampersand character (&amp;) in usernames.  Be careful when using this option in conjunction with <a href="../browse/part_export.cgi">exports</a> which execute shell commands, as the ampersand will be interpreted by the shell if not quoted.',
993     'type'        => 'checkbox',
994   },
995
996   {
997     'key'         => 'username-letter',
998     'section'     => 'username',
999     'description' => 'Usernames must contain at least one letter',
1000     'type'        => 'checkbox',
1001   },
1002
1003   {
1004     'key'         => 'username-letterfirst',
1005     'section'     => 'username',
1006     'description' => 'Usernames must start with a letter',
1007     'type'        => 'checkbox',
1008   },
1009
1010   {
1011     'key'         => 'username-noperiod',
1012     'section'     => 'username',
1013     'description' => 'Disallow periods in usernames',
1014     'type'        => 'checkbox',
1015   },
1016
1017   {
1018     'key'         => 'username-nounderscore',
1019     'section'     => 'username',
1020     'description' => 'Disallow underscores in usernames',
1021     'type'        => 'checkbox',
1022   },
1023
1024   {
1025     'key'         => 'username-nodash',
1026     'section'     => 'username',
1027     'description' => 'Disallow dashes in usernames',
1028     'type'        => 'checkbox',
1029   },
1030
1031   {
1032     'key'         => 'username-uppercase',
1033     'section'     => 'username',
1034     'description' => 'Allow uppercase characters in usernames',
1035     'type'        => 'checkbox',
1036   },
1037
1038   {
1039     'key'         => 'username_policy',
1040     'section'     => 'deprecated',
1041     '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\' \'append domain\' or \'append @domain\'',
1042     'type'        => 'select',
1043     'select_enum' => [ 'prepend domsvc', 'append domsvc', 'append domain', 'append @domain' ],
1044     #'type'        => 'text',
1045   },
1046
1047   {
1048     'key'         => 'vpopmailmachines',
1049     'section'     => 'deprecated',
1050     'description' => '<b>DEPRECATED</b>, add a <i>vpopmail</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to contain 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',
1051     'type'        => 'textarea',
1052   },
1053
1054   {
1055     'key'         => 'vpopmailrestart',
1056     'section'     => 'deprecated',
1057     'description' => '<b>DEPRECATED</b>, add a <i>vpopmail</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to define the shell commands to run on vpopmail machines after files are copied.  An example can be found in eg/vpopmailrestart of the source distribution.',
1058     'type'        => 'textarea',
1059   },
1060
1061   {
1062     'key'         => 'safe-part_pkg',
1063     'section'     => 'deprecated',
1064     'description' => '<b>DEPRECATED</b>, obsolete.  Used to validate package definition setup and recur expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
1065     'type'        => 'checkbox',
1066   },
1067
1068   {
1069     'key'         => 'safe-part_bill_event',
1070     'section'     => 'UI',
1071     'description' => 'Validates invoice event expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
1072     'type'        => 'checkbox',
1073   },
1074
1075   {
1076     'key'         => 'show_ss',
1077     'section'     => 'UI',
1078     'description' => 'Turns on display/collection of SS# in the web interface.',
1079     'type'        => 'checkbox',
1080   },
1081
1082   { 
1083     'key'         => 'agent_defaultpkg',
1084     'section'     => 'UI',
1085     'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
1086     'type'        => 'checkbox',
1087   },
1088
1089   {
1090     'key'         => 'legacy_link',
1091     'section'     => 'UI',
1092     'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
1093     'type'        => 'checkbox',
1094   },
1095
1096   {
1097     'key'         => 'legacy_link-steal',
1098     'section'     => 'UI',
1099     'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
1100     'type'        => 'checkbox',
1101   },
1102
1103   {
1104     'key'         => 'queue_dangerous_controls',
1105     'section'     => 'UI',
1106     'description' => 'Enable queue modification controls on account pages and for new jobs.  Unless you are a developer working on new export code, you should probably leave this off to avoid causing provisioning problems.',
1107     'type'        => 'checkbox',
1108   },
1109
1110   {
1111     'key'         => 'security_phrase',
1112     'section'     => 'password',
1113     'description' => 'Enable the tracking of a "security phrase" with each account.  Not recommended, as it is vulnerable to social engineering.',
1114     'type'        => 'checkbox',
1115   },
1116
1117   {
1118     'key'         => 'locale',
1119     'section'     => 'UI',
1120     'description' => 'Message locale',
1121     'type'        => 'select',
1122     'select_enum' => [ qw(en_US) ],
1123   },
1124
1125   {
1126     'key'         => 'selfservice_server-quiet',
1127     'section'     => 'deprecated',
1128     'description' => '<b>DEPRECATED</b>, the self-service server no longer sends superfluous decline and cancel emails.  Used to disable decline and cancel emails generated by transactions initiated by the selfservice server.',
1129     'type'        => 'checkbox',
1130   },
1131
1132   {
1133     'key'         => 'signup_server-quiet',
1134     'section'     => 'deprecated',
1135     'description' => '<b>DEPRECATED</b>, the signup server is now part of the self-service server and no longer sends superfluous decline and cancel emails.  Used to disable decline and cancel emails generated by transactions initiated by the signup server.  Does not disable welcome emails.',
1136     'type'        => 'checkbox',
1137   },
1138
1139   {
1140     'key'         => 'signup_server-payby',
1141     'section'     => '',
1142     'description' => 'Acceptable payment types for the signup server',
1143     'type'        => 'selectmultiple',
1144     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
1145   },
1146
1147   {
1148     'key'         => 'signup_server-email',
1149     'section'     => 'deprecated',
1150     'description' => '<b>DEPRECATED</b>, this feature is no longer available.  See the ***fill me in*** report instead.  Used to contain a comma-separated list of email addresses to receive notification of signups via the signup server.',
1151     'type'        => 'text',
1152   },
1153
1154   {
1155     'key'         => 'signup_server-default_agentnum',
1156     'section'     => '',
1157     'description' => 'Default agentnum for the signup server',
1158     'type'        => 'text',
1159   },
1160
1161   {
1162     'key'         => 'signup_server-default_refnum',
1163     'section'     => '',
1164     'description' => 'Default advertising source number for the signup server',
1165     'type'        => 'text',
1166   },
1167
1168   {
1169     'key'         => 'show-msgcat-codes',
1170     'section'     => 'UI',
1171     'description' => 'Show msgcat codes in error messages.  Turn this option on before reporting errors to the mailing list.',
1172     'type'        => 'checkbox',
1173   },
1174
1175   {
1176     'key'         => 'signup_server-realtime',
1177     'section'     => '',
1178     'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
1179     'type'        => 'checkbox',
1180   },
1181
1182   {
1183     'key'         => 'declinetemplate',
1184     'section'     => 'billing',
1185     'description' => 'Template file for credit card decline emails.',
1186     'type'        => 'textarea',
1187   },
1188
1189   {
1190     'key'         => 'emaildecline',
1191     'section'     => 'billing',
1192     'description' => 'Enable emailing of credit card decline notices.',
1193     'type'        => 'checkbox',
1194   },
1195
1196   {
1197     'key'         => 'emaildecline-exclude',
1198     'section'     => 'billing',
1199     'description' => 'List of error messages that should not trigger email decline notices, one per line.',
1200     'type'        => 'textarea',
1201   },
1202
1203   {
1204     'key'         => 'cancelmessage',
1205     'section'     => 'billing',
1206     'description' => 'Template file for cancellation emails.',
1207     'type'        => 'textarea',
1208   },
1209
1210   {
1211     'key'         => 'cancelsubject',
1212     'section'     => 'billing',
1213     'description' => 'Subject line for cancellation emails.',
1214     'type'        => 'text',
1215   },
1216
1217   {
1218     'key'         => 'emailcancel',
1219     'section'     => 'billing',
1220     'description' => 'Enable emailing of cancellation notices.',
1221     'type'        => 'checkbox',
1222   },
1223
1224   {
1225     'key'         => 'require_cardname',
1226     'section'     => 'billing',
1227     'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
1228     'type'        => 'checkbox',
1229   },
1230
1231   {
1232     'key'         => 'enable_taxclasses',
1233     'section'     => 'billing',
1234     'description' => 'Enable per-package tax classes',
1235     'type'        => 'checkbox',
1236   },
1237
1238   {
1239     'key'         => 'welcome_email',
1240     'section'     => '',
1241     'description' => 'Template file for welcome email.  Welcome emails are sent to the customer email invoice destination(s) each time a svc_acct record is created.  See the <a href="http://search.cpan.org/doc/MJD/Text-Template-1.42/Template.pm">Text::Template</a> documentation for details on the template substitution language.  The following variables are available: <code>$username</code>, <code>$password</code>, <code>$first</code>, <code>$last</code> and <code>$pkg</code>.',
1242     'type'        => 'textarea',
1243   },
1244
1245   {
1246     'key'         => 'welcome_email-from',
1247     'section'     => '',
1248     'description' => 'From: address header for welcome email',
1249     'type'        => 'text',
1250   },
1251
1252   {
1253     'key'         => 'welcome_email-subject',
1254     'section'     => '',
1255     'description' => 'Subject: header for welcome email',
1256     'type'        => 'text',
1257   },
1258   
1259   {
1260     'key'         => 'welcome_email-mimetype',
1261     'section'     => '',
1262     'description' => 'MIME type for welcome email',
1263     'type'        => 'select',
1264     'select_enum' => [ 'text/plain', 'text/html' ],
1265   },
1266
1267   {
1268     'key'         => 'payby-default',
1269     'section'     => 'UI',
1270     'description' => 'Default payment type.  HIDE disables display of billing information and sets customers to BILL.',
1271     'type'        => 'select',
1272     'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL COMP HIDE) ],
1273   },
1274
1275   {
1276     'key'         => 'svc_acct-notes',
1277     'section'     => 'UI',
1278     'description' => 'Extra HTML to be displayed on the Account View screen.',
1279     'type'        => 'textarea',
1280   },
1281
1282   {
1283     'key'         => 'radius-password',
1284     'section'     => '',
1285     'description' => 'RADIUS attribute for plain-text passwords.',
1286     'type'        => 'select',
1287     'select_enum' => [ 'Password', 'User-Password' ],
1288   },
1289
1290   {
1291     'key'         => 'radius-ip',
1292     'section'     => '',
1293     'description' => 'RADIUS attribute for IP addresses.',
1294     'type'        => 'select',
1295     'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
1296   },
1297
1298   {
1299     'key'         => 'svc_acct-alldomains',
1300     'section'     => '',
1301     'description' => 'Allow accounts to select any domain in the database.  Normally accounts can only select from the domain set in the service definition and those purchased by the customer.',
1302     'type'        => 'checkbox',
1303   },
1304
1305   {
1306     'key'         => 'dump-scpdest',
1307     'section'     => '',
1308     'description' => 'destination for scp database dumps: user@host:/path',
1309     'type'        => 'text',
1310   },
1311
1312   {
1313     'key'         => 'dump-pgpid',
1314     'section'     => '',
1315     'description' => "Optional PGP public key user or key id for database dumps.  The public key should exist on the freeside user's public keyring, and the gpg binary and GnuPG perl module should be installed.",
1316     'type'        => 'text',
1317   },
1318
1319   {
1320     'key'         => 'users-allow_comp',
1321     'section'     => '',
1322     'description' => 'Usernames (Freeside users, created with <a href="../docs/man/bin/freeside-adduser.html">freeside-adduser</a>) which can create complimentary customers, one per line.  If no usernames are entered, all users can create complimentary accounts.',
1323     'type'        => 'textarea',
1324   },
1325
1326   {
1327     'key'         => 'cvv-save',
1328     'section'     => 'billing',
1329     'description' => 'Save CVV2 information after the initial transaction for the selected credit card types.  Enabling this option may be in violation of your merchant agreement(s), so please check them carefully before enabling this option for any credit card types.',
1330     'type'        => 'selectmultiple',
1331     'select_enum' => [ "VISA card",
1332                        "MasterCard",
1333                        "Discover card",
1334                        "American Express card",
1335                        "Diner's Club/Carte Blanche",
1336                        "enRoute",
1337                        "JCB",
1338                        "BankCard",
1339                      ],
1340   },
1341
1342   {
1343     'key'         => 'allow_negative_charges',
1344     'section'     => 'billing',
1345     'description' => 'Allow negative charges.  Normally not used unless importing data from a legacy system that requires this.',
1346     'type'        => 'checkbox',
1347   },
1348   {
1349       'key'         => 'auto_unset_catchall',
1350       'section'     => '',
1351       'description' => 'When canceling a svc_acct that is the email catchall for one or more svc_domains, automatically set their catchall fields to null.  If this option is not set, the attempt will simply fail.',
1352       'type'        => 'checkbox',
1353   },
1354
1355   {
1356     'key'         => 'system_usernames',
1357     'section'     => 'username',
1358     'description' => 'A list of system usernames that cannot be edited or removed, one per line.  Use a bare username to prohibit modification/deletion of the username in any domain, or username@domain to prohibit modification/deletetion of a specific username and domain.',
1359     'type'        => 'textarea',
1360   },
1361
1362   {
1363     'key'         => 'cust_pkg-change_svcpart',
1364     'section'     => '',
1365     'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
1366     'type'        => 'checkbox',
1367   },
1368
1369   {
1370     'key'         => 'disable_autoreverse',
1371     'section'     => 'BIND',
1372     'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
1373     'type'        => 'checkbox',
1374   },
1375
1376   {
1377     'key'         => 'svc_www-enable_subdomains',
1378     'section'     => '',
1379     'description' => 'Enable selection of specific subdomains for virtual host creation.',
1380     'type'        => 'checkbox',
1381   },
1382
1383   {
1384     'key'         => 'svc_www-usersvc_svcpart',
1385     'section'     => '',
1386     'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
1387     'type'        => 'textarea',
1388   },
1389
1390   {
1391     'key'         => 'selfservice_server-primary_only',
1392     'section'     => '',
1393     'description' => 'Only allow primary accounts to access self-service functionality.',
1394     'type'        => 'checkbox',
1395   },
1396
1397   {
1398     'key'         => 'card_refund-days',
1399     'section'     => 'billing',
1400     'description' => 'After a payment, the number of days a refund link will be available for that payment.  Defaults to 120.',
1401     'type'        => 'text',
1402   },
1403
1404   {
1405     'key'         => 'agent-showpasswords',
1406     'section'     => '',
1407     'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
1408     'type'        => 'checkbox',
1409   },
1410
1411   {
1412     'key'         => 'global_unique-username',
1413     'section'     => 'username',
1414     'description' => 'Global username uniqueness control: none (usual setting - check uniqueness per exports), username (all usernames are globally unique, regardless of domain or exports), or username@domain (all username@domain pairs are globally unique, regardless of exports)',
1415     'type'        => 'select',
1416     'select_enum' => [ 'none', 'username', 'username@domain' ],
1417   },
1418
1419   {
1420     'key'         => 'svc_external-skip_manual',
1421     'section'     => 'UI',
1422     'description' => 'When provisioning svc_external services, skip manual entry of id and title fields in the UI.  Usually used in conjunction with an export that populates these fields (i.e. artera_turbo).',
1423     'type'        => 'checkbox',
1424   },
1425
1426   {
1427     'key'         => 'svc_external-display_type',
1428     'section'     => 'UI',
1429     'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
1430     'type'        => 'select',
1431     'select_enum' => [ 'generic', 'artera_turbo', ],
1432   },
1433
1434   {
1435     'key'         => 'ticket_system',
1436     'section'     => '',
1437     'description' => 'Ticketing system integraiton.  <b>RT_Internal</b> uses the built-in RT ticketing system (see the <a href="../docs/install-rt">integrated ticketing installation instructions</a>).   <b>RT_External</b> accesses an external RT installation in a separate database (local or remote).',
1438     'type'        => 'select',
1439     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
1440     'select_enum' => [ '', qw(RT_Internal RT_External) ],
1441   },
1442
1443   {
1444     'key'         => 'ticket_system-default_queueid',
1445     'section'     => '',
1446     'description' => 'Default queue number used when creating new customer tickets.',
1447     'type'        => 'text',
1448   },
1449
1450   {
1451     'key'         => 'ticket_system-custom_priority_field',
1452     'section'     => '',
1453     'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
1454     'type'        => 'text',
1455   },
1456
1457   {
1458     'key'         => 'ticket_system-custom_priority_field-values',
1459     'section'     => '',
1460     'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
1461     'type'        => 'textarea',
1462   },
1463
1464   {
1465     'key'         => 'ticket_system-custom_priority_field_queue',
1466     'section'     => '',
1467     'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
1468     'type'        => 'text',
1469   },
1470
1471   {
1472     'key'         => 'company_name',
1473     'section'     => 'required',
1474     'description' => 'Your company name',
1475     'type'        => 'text',
1476   },
1477
1478   {
1479     'key'         => 'echeck-void',
1480     'section'     => 'billing',
1481     'description' => 'Enable local-only voiding of echeck payments in addition to refunds against the payment gateway',
1482     'type'        => 'checkbox',
1483   },
1484
1485   {
1486     'key'         => 'address2-search',
1487     'section'     => 'UI',
1488     'description' => 'Enable a "Unit" search box which searches the second address field',
1489     'type'        => 'checkbox',
1490   },
1491
1492   { 'key'         => 'referral_credit',
1493     'section'     => 'billing',
1494     'description' => "Enables one-time referral credits in the amount of one month <i>referred</i> customer's recurring fee (irregardless of frequency).",
1495     'type'        => 'checkbox',
1496   },
1497
1498   { 'key'         => 'selfservice_server-cache_module',
1499     'section'     => '',
1500     'description' => 'Module used to store self-service session information.  All modules handle any number of self-service servers.  Cache::SharedMemoryCache is appropriate for a single database / single Freeside server.  Cache::FileCache is useful for multiple databases on a single server, or when IPC::ShareLite is not available (i.e. FreeBSD).', #  _Database stores session information in the database and is appropriate for multiple Freeside servers, but may be slower.',
1501     'type'        => 'select',
1502     'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
1503   },
1504
1505   {
1506     'key'         => 'hylafax',
1507     'section'     => '',
1508     'description' => 'Options for a HylaFAX server to enable the FAX invoice destination.  They should be in the form of a space separated list of arguments to the Fax::Hylafax::Client::sendfax subroutine.  You probably shouldn\'t override things like \'docfile\'.  *Note* Only supported when using typeset invoices (see the invoice_latex configuration option).',
1509     'type'        => [qw( checkbox textarea )],
1510   },
1511
1512   {
1513     'key'         => 'svc_acct-usage_suspend',
1514     'section'     => 'billing',
1515     'description' => 'Suspends the package an account belongs to when svc_acct.seconds is decremented to 0 or below (accounts with an empty seconds value are ignored).  Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd.',
1516     'type'        => 'checkbox',
1517   },
1518
1519 );
1520
1521 1;
1522