This commit was generated by cvs2svn to compensate for changes in r4407,
[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 config_binary KEY
99
100 Returns the exact scalar value for key.
101
102 =cut
103
104 sub config_binary {
105   my($self,$file)=@_;
106   my($dir)=$self->dir;
107   my $fh = new IO::File "<$dir/$file" or return;
108   local $/;
109   my $content = <$fh>;
110   $content;
111 }
112
113 =item exists KEY
114
115 Returns true if the specified key exists, even if the corresponding value
116 is undefined.
117
118 =cut
119
120 sub exists {
121   my($self,$file)=@_;
122   my($dir) = $self->dir;
123   -e "$dir/$file";
124 }
125
126 =item config_orbase KEY SUFFIX
127
128 Returns the configuration value or values (depending on context) for 
129 KEY_SUFFIX, if it exists, otherwise for KEY
130
131 =cut
132
133 sub config_orbase {
134   my( $self, $file, $suffix ) = @_;
135   if ( $self->exists("${file}_$suffix") ) {
136     $self->config("${file}_$suffix");
137   } else {
138     $self->config($file);
139   }
140 }
141
142 =item touch KEY
143
144 Creates the specified configuration key if it does not exist.
145
146 =cut
147
148 sub touch {
149   my($self, $file) = @_;
150   my $dir = $self->dir;
151   unless ( $self->exists($file) ) {
152     warn "[FS::Conf] TOUCH $file\n" if $DEBUG;
153     system('touch', "$dir/$file");
154   }
155 }
156
157 =item set KEY VALUE
158
159 Sets the specified configuration key to the given value.
160
161 =cut
162
163 sub set {
164   my($self, $file, $value) = @_;
165   my $dir = $self->dir;
166   $value =~ /^(.*)$/s;
167   $value = $1;
168   unless ( join("\n", @{[ $self->config($file) ]}) eq $value ) {
169     warn "[FS::Conf] SET $file\n" if $DEBUG;
170 #    warn "$dir" if is_tainted($dir);
171 #    warn "$dir" if is_tainted($file);
172     chmod 0644, "$dir/$file";
173     my $fh = new IO::File ">$dir/$file" or return;
174     chmod 0644, "$dir/$file";
175     print $fh "$value\n";
176   }
177 }
178 #sub is_tainted {
179 #             return ! eval { join('',@_), kill 0; 1; };
180 #         }
181
182 =item delete KEY
183
184 Deletes the specified configuration key.
185
186 =cut
187
188 sub delete {
189   my($self, $file) = @_;
190   my $dir = $self->dir;
191   if ( $self->exists($file) ) {
192     warn "[FS::Conf] DELETE $file\n";
193     unlink "$dir/$file";
194   }
195 }
196
197 =item config_items
198
199 Returns all of the possible configuration items as FS::ConfItem objects.  See
200 L<FS::ConfItem>.
201
202 =cut
203
204 sub config_items {
205   my $self = shift; 
206   #quelle kludge
207   @config_items,
208   ( map { 
209         my $basename = basename($_);
210         $basename =~ /^(.*)$/;
211         $basename = $1;
212         new FS::ConfItem {
213                            'key'         => $basename,
214                            'section'     => 'billing',
215                            'description' => 'Alternate template file for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
216                            'type'        => 'textarea',
217                          }
218       } glob($self->dir. '/invoice_template_*')
219   ),
220   ( map { 
221         my $basename = basename($_);
222         $basename =~ /^(.*)$/;
223         $basename = $1;
224         new FS::ConfItem {
225                            'key'         => $basename,
226                            'section'     => 'billing',
227                            'description' => 'Alternate HTML template for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
228                            'type'        => 'textarea',
229                          }
230       } glob($self->dir. '/invoice_html_*')
231   ),
232   ( map { 
233         my $basename = basename($_);
234         $basename =~ /^(.*)$/;
235         $basename = $1;
236         ($latexname = $basename ) =~ s/latex/html/;
237         new FS::ConfItem {
238                            'key'         => $basename,
239                            'section'     => 'billing',
240                            'description' => "Alternate Notes section for HTML invoices.  Defaults to the same data in $latexname if not specified.",
241                            'type'        => 'textarea',
242                          }
243       } glob($self->dir. '/invoice_htmlnotes_*')
244   ),
245   ( map { 
246         my $basename = basename($_);
247         $basename =~ /^(.*)$/;
248         $basename = $1;
249         new FS::ConfItem {
250                            'key'         => $basename,
251                            'section'     => 'billing',
252                            'description' => 'Alternate LaTeX template for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
253                            'type'        => 'textarea',
254                          }
255       } glob($self->dir. '/invoice_latex_*')
256   ),
257   ( map { 
258         my $basename = basename($_);
259         $basename =~ /^(.*)$/;
260         $basename = $1;
261         new FS::ConfItem {
262                            'key'         => $basename,
263                            'section'     => 'billing',
264                            'description' => 'Alternate Notes section for LaTeX typeset PostScript invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
265                            'type'        => 'textarea',
266                          }
267       } glob($self->dir. '/invoice_latexnotes_*')
268   );
269 }
270
271 =back
272
273 =head1 BUGS
274
275 If this was more than just crud that will never be useful outside Freeside I'd
276 worry that config_items is freeside-specific and icky.
277
278 =head1 SEE ALSO
279
280 "Configuration" in the web interface (config/config.cgi).
281
282 httemplate/docs/config.html
283
284 =cut
285
286 @config_items = map { new FS::ConfItem $_ } (
287
288   {
289     'key'         => 'address',
290     'section'     => 'deprecated',
291     'description' => 'This configuration option is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.',
292     'type'        => 'text',
293   },
294
295   {
296     'key'         => 'alerter_template',
297     'section'     => 'billing',
298     'description' => 'Template file for billing method expiration alerts.  See the <a href="../docs/billing.html#invoice_template">billing documentation</a> for details.',
299     'type'        => 'textarea',
300   },
301
302   {
303     'key'         => 'apacheroot',
304     'section'     => 'deprecated',
305     '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',
306     'type'        => 'text',
307   },
308
309   {
310     'key'         => 'apacheip',
311     'section'     => 'deprecated',
312     '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',
313     'type'        => 'text',
314   },
315
316   {
317     'key'         => 'apachemachine',
318     'section'     => 'deprecated',
319     '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.',
320     'type'        => 'text',
321   },
322
323   {
324     'key'         => 'apachemachines',
325     'section'     => 'deprecated',
326     '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.',
327     'type'        => 'textarea',
328   },
329
330   {
331     'key'         => 'bindprimary',
332     'section'     => 'deprecated',
333     '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',
334     'type'        => 'text',
335   },
336
337   {
338     'key'         => 'bindsecondaries',
339     'section'     => 'deprecated',
340     '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',
341     'type'        => 'textarea',
342   },
343
344   {
345     'key'         => 'encryption',
346     'section'     => 'billing',
347     'description' => 'Enable encryption of credit cards.',
348     'type'        => 'checkbox',
349   },
350
351   {
352     'key'         => 'encryptionmodule',
353     'section'     => 'billing',
354     'description' => 'Use which module for encryption?',
355     'type'        => 'text',
356   },
357
358   {
359     'key'         => 'encryptionpublickey',
360     'section'     => 'billing',
361     'description' => 'Your RSA Public Key - Required if Encryption is turned on.',
362     'type'        => 'textarea',
363   },
364
365   {
366     'key'         => 'encryptionprivatekey',
367     'section'     => 'billing',
368     '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.',
369     'type'        => 'textarea',
370   },
371
372   {
373     'key'         => 'business-onlinepayment',
374     'section'     => 'billing',
375     '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.',
376     'type'        => 'textarea',
377   },
378
379   {
380     'key'         => 'business-onlinepayment-ach',
381     'section'     => 'billing',
382     '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.',
383     'type'        => 'textarea',
384   },
385
386   {
387     'key'         => 'business-onlinepayment-description',
388     'section'     => 'billing',
389     '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)',
390     'type'        => 'text',
391   },
392
393   {
394     'key'         => 'business-onlinepayment-email-override',
395     'section'     => 'billing',
396     'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
397     'type'        => 'text',
398   },
399
400   {
401     'key'         => 'bsdshellmachines',
402     'section'     => 'deprecated',
403     '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\'.',
404     'type'        => 'textarea',
405   },
406
407   {
408     'key'         => 'countrydefault',
409     'section'     => 'UI',
410     'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
411     'type'        => 'text',
412   },
413
414   {
415     'key'         => 'cyrus',
416     'section'     => 'deprecated',
417     '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.',
418     'type'        => 'textarea',
419   },
420
421   {
422     'key'         => 'cp_app',
423     'section'     => 'deprecated',
424     '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).',
425     'type'        => 'textarea',
426   },
427
428   {
429     'key'         => 'deletecustomers',
430     'section'     => 'UI',
431     '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.',
432     'type'        => 'checkbox',
433   },
434
435   {
436     'key'         => 'deletepayments',
437     'section'     => 'UI',
438     '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.',
439     'type'        => [qw( checkbox text )],
440   },
441
442   {
443     'key'         => 'deletecredits',
444     'section'     => 'UI',
445     '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.',
446     'type'        => [qw( checkbox text )],
447   },
448
449   {
450     'key'         => 'unapplypayments',
451     'section'     => 'UI',
452     'description' => 'Enable "unapplication" of unclosed payments.',
453     'type'        => 'checkbox',
454   },
455
456   {
457     'key'         => 'unapplycredits',
458     'section'     => 'UI',
459     'description' => 'Enable "unapplication" of unclosed credits.',
460     'type'        => 'checkbox',
461   },
462
463   {
464     'key'         => 'dirhash',
465     'section'     => 'shell',
466     '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>',
467     'type'        => 'text',
468   },
469
470   {
471     'key'         => 'disable_customer_referrals',
472     'section'     => 'UI',
473     'description' => 'Disable new customer-to-customer referrals in the web interface',
474     'type'        => 'checkbox',
475   },
476
477   {
478     'key'         => 'editreferrals',
479     'section'     => 'UI',
480     'description' => 'Enable advertising source modification for existing customers',
481     'type'       => 'checkbox',
482   },
483
484   {
485     'key'         => 'emailinvoiceonly',
486     'section'     => 'billing',
487     'description' => 'Disables postal mail invoices',
488     'type'       => 'checkbox',
489   },
490
491   {
492     'key'         => 'disablepostalinvoicedefault',
493     'section'     => 'billing',
494     '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>.',
495     'type'       => 'checkbox',
496   },
497
498   {
499     'key'         => 'emailinvoiceauto',
500     'section'     => 'billing',
501     'description' => 'Automatically adds new accounts to the email invoice list',
502     'type'       => 'checkbox',
503   },
504
505   {
506     'key'         => 'exclude_ip_addr',
507     'section'     => '',
508     'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
509     'type'        => 'textarea',
510   },
511   
512   {
513     'key'         => 'erpcdmachines',
514     'section'     => 'deprecated',
515     '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\'',
516     'type'        => 'textarea',
517   },
518
519   {
520     'key'         => 'hidecancelledpackages',
521     'section'     => 'UI',
522     'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
523     'type'        => 'checkbox',
524   },
525
526   {
527     'key'         => 'hidecancelledcustomers',
528     'section'     => 'UI',
529     'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
530     'type'        => 'checkbox',
531   },
532
533   {
534     'key'         => 'home',
535     'section'     => 'required',
536     'description' => 'For new users, prefixed to username to create a directory name.  Should have a leading but not a trailing slash.',
537     'type'        => 'text',
538   },
539
540   {
541     'key'         => 'icradiusmachines',
542     'section'     => 'deprecated',
543     '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>',
544     'type'        => [qw( checkbox textarea )],
545   },
546
547   {
548     'key'         => 'icradius_mysqldest',
549     'section'     => 'deprecated',
550     '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/".',
551     'type'        => 'text',
552   },
553
554   {
555     'key'         => 'icradius_mysqlsource',
556     'section'     => 'deprecated',
557     '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".',
558     'type'        => 'text',
559   },
560
561   {
562     'key'         => 'icradius_secrets',
563     'section'     => 'deprecated',
564     '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.',
565     'type'        => 'textarea',
566   },
567
568   {
569     'key'         => 'invoice_from',
570     'section'     => 'required',
571     'description' => 'Return address on email invoices',
572     'type'        => 'text',
573   },
574
575   {
576     'key'         => 'invoice_template',
577     'section'     => 'required',
578     'description' => 'Required template file for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
579     'type'        => 'textarea',
580   },
581
582   {
583     'key'         => 'invoice_html',
584     'section'     => 'billing',
585     'description' => 'Optional HTML template for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
586
587     'type'        => 'textarea',
588   },
589
590   {
591     'key'         => 'invoice_htmlnotes',
592     'section'     => 'billing',
593     'description' => 'Notes section for HTML invoices.  Defaults to the same data in invoice_latexnotes if not specified.',
594     'type'        => 'textarea',
595   },
596
597   {
598     'key'         => 'invoice_htmlfooter',
599     'section'     => 'billing',
600     'description' => 'Footer for HTML invoices.  Defaults to the same data in invoice_latexfooter if not specified.',
601     'type'        => 'textarea',
602   },
603
604   {
605     'key'         => 'invoice_htmlreturnaddress',
606     'section'     => 'billing',
607     'description' => 'Return address for HTML invoices.  Defaults to the same data in invoice_latexreturnaddress if not specified.',
608     'type'        => 'textarea',
609   },
610
611   {
612     'key'         => 'invoice_latex',
613     'section'     => 'billing',
614     'description' => 'Optional LaTeX template for typeset PostScript invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
615     'type'        => 'textarea',
616   },
617
618   {
619     'key'         => 'invoice_latexnotes',
620     'section'     => 'billing',
621     'description' => 'Notes section for LaTeX typeset PostScript invoices.',
622     'type'        => 'textarea',
623   },
624
625   {
626     'key'         => 'invoice_latexfooter',
627     'section'     => 'billing',
628     'description' => 'Footer for LaTeX typeset PostScript invoices.',
629     'type'        => 'textarea',
630   },
631
632   {
633     'key'         => 'invoice_latexreturnaddress',
634     'section'     => 'billing',
635     'description' => 'Return address for LaTeX typeset PostScript invoices.',
636     'type'        => 'textarea',
637   },
638
639   {
640     'key'         => 'invoice_latexsmallfooter',
641     'section'     => 'billing',
642     'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
643     'type'        => 'textarea',
644   },
645
646   {
647     'key'         => 'invoice_email_pdf',
648     'section'     => 'billing',
649     '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.',
650     'type'        => 'checkbox'
651   },
652
653   {
654     'key'         => 'invoice_email_pdf_note',
655     'section'     => 'billing',
656     'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.',
657     'type'        => 'textarea'
658   },
659
660
661   { 
662     'key'         => 'invoice_default_terms',
663     'section'     => 'billing',
664     'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
665     'type'        => 'select',
666     'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 30', 'Net 45', 'Net 60' ],
667   },
668
669   {
670     'key'         => 'invoice_send_receipts',
671     'section'     => 'deprecated',
672     'description' => '<b>DEPRECATED</b>, this used to send an invoice copy on payments and credits.  See the payment_receipt_email and XXXX instead.',
673     'type'        => 'checkbox',
674   },
675
676   {
677     'key'         => 'payment_receipt_email',
678     'section'     => 'billing',
679     'description' => 'Template file for payment receipts.  Payment receipts are sent to the customer email invoice destination(s) when a payment is received.  See the <a href="http://search.cpan.org/~mjd/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitution language.  The following variables are available: <ul><li><code>$date</code> <li><code>$name</code> <li><code>$paynum</code> - Freeside payment number <li><code>$paid</code> - Amount of payment <li><code>$payby</code> - Payment type (Card, Check, Electronic check, etc.) <li><code>$payinfo</code> - Masked credit card number or check number <li><code>$balance</code> - New balance</ul>',
680     'type'        => 'textarea',
681   },
682
683   {
684     'key'         => 'lpr',
685     'section'     => 'required',
686     'description' => 'Print command for paper invoices, for example `lpr -h\'',
687     'type'        => 'text',
688   },
689
690   {
691     'key'         => 'maildisablecatchall',
692     'section'     => 'deprecated',
693     '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.',
694     'type'        => 'checkbox',
695   },
696
697   {
698     'key'         => 'money_char',
699     'section'     => '',
700     'description' => 'Currency symbol - defaults to `$\'',
701     'type'        => 'text',
702   },
703
704   {
705     'key'         => 'mxmachines',
706     'section'     => 'deprecated',
707     'description' => 'MX entries for new domains, weight and machine, one per line, with trailing `.\'',
708     'type'        => 'textarea',
709   },
710
711   {
712     'key'         => 'nsmachines',
713     'section'     => 'deprecated',
714     'description' => 'NS nameservers for new domains, one per line, with trailing `.\'',
715     'type'        => 'textarea',
716   },
717
718   {
719     'key'         => 'defaultrecords',
720     'section'     => 'BIND',
721     'description' => 'DNS entries to add automatically when creating a domain',
722     'type'        => 'editlist',
723     'editlist_parts' => [ { type=>'text' },
724                           { type=>'immutable', value=>'IN' },
725                           { type=>'select',
726                             select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS TXT)} },
727                           { type=> 'text' }, ],
728   },
729
730   {
731     'key'         => 'arecords',
732     'section'     => 'deprecated',
733     'description' => 'A list of tab seperated CNAME records to add automatically when creating a domain',
734     'type'        => 'textarea',
735   },
736
737   {
738     'key'         => 'cnamerecords',
739     'section'     => 'deprecated',
740     'description' => 'A list of tab seperated CNAME records to add automatically when creating a domain',
741     'type'        => 'textarea',
742   },
743
744   {
745     'key'         => 'nismachines',
746     'section'     => 'deprecated',
747     '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\'.',
748     'type'        => 'textarea',
749   },
750
751   {
752     'key'         => 'passwordmin',
753     'section'     => 'password',
754     'description' => 'Minimum password length (default 6)',
755     'type'        => 'text',
756   },
757
758   {
759     'key'         => 'passwordmax',
760     'section'     => 'password',
761     'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
762     'type'        => 'text',
763   },
764
765   {
766     'key' => 'password-noampersand',
767     'section' => 'password',
768     'description' => 'Disallow ampersands in passwords',
769     'type' => 'checkbox',
770   },
771
772   {
773     'key' => 'password-noexclamation',
774     'section' => 'password',
775     'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
776     'type' => 'checkbox',
777   },
778
779   {
780     'key'         => 'qmailmachines',
781     'section'     => 'deprecated',
782     '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.',
783     'type'        => [qw( checkbox textarea )],
784   },
785
786   {
787     'key'         => 'radiusmachines',
788     'section'     => 'deprecated',
789     '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\'.',
790     'type'        => 'textarea',
791   },
792
793   {
794     'key'         => 'referraldefault',
795     'section'     => 'UI',
796     'description' => 'Default referral, specified by refnum',
797     'type'        => 'text',
798   },
799
800 #  {
801 #    'key'         => 'registries',
802 #    'section'     => 'required',
803 #    'description' => 'Directory which contains domain registry information.  Each registry is a directory.',
804 #  },
805
806   {
807     'key'         => 'report_template',
808     'section'     => 'deprecated',
809     'description' => 'Deprecated template file for reports.',
810     'type'        => 'textarea',
811   },
812
813
814   {
815     'key'         => 'maxsearchrecordsperpage',
816     'section'     => 'UI',
817     'description' => 'If set, number of search records to return per page.',
818     'type'        => 'text',
819   },
820
821   {
822     'key'         => 'sendmailconfigpath',
823     'section'     => 'deprecated',
824     '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\'.',
825     'type'        => 'text',
826   },
827
828   {
829     'key'         => 'sendmailmachines',
830     'section'     => 'deprecated',
831     '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\'.',
832     'type'        => 'textarea',
833   },
834
835   {
836     'key'         => 'sendmailrestart',
837     'section'     => 'deprecated',
838     '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.',
839     'type'        => 'text',
840   },
841
842   {
843     'key'         => 'session-start',
844     'section'     => 'session',
845     '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.',
846     'type'        => 'text',
847   },
848
849   {
850     'key'         => 'session-stop',
851     'section'     => 'session',
852     '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.',
853     'type'        => 'text',
854   },
855
856   {
857     'key'         => 'shellmachine',
858     'section'     => 'deprecated',
859     '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.',
860     'type'        => 'text',
861   },
862
863   {
864     'key'         => 'shellmachine-useradd',
865     'section'     => 'deprecated',
866     '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>.',
867     'type'        => [qw( checkbox text )],
868   },
869
870   {
871     'key'         => 'shellmachine-userdel',
872     'section'     => 'deprecated',
873     '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>.',
874     'type'        => [qw( checkbox text )],
875   },
876
877   {
878     'key'         => 'shellmachine-usermod',
879     'section'     => 'deprecated',
880     '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>.',
881     #'type'        => [qw( checkbox text )],
882     'type'        => 'text',
883   },
884
885   {
886     'key'         => 'shellmachines',
887     'section'     => 'deprecated',
888     '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.',
889      'type'        => 'textarea',
890  },
891
892   {
893     'key'         => 'shells',
894     'section'     => 'required',
895     '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.',
896     'type'        => 'textarea',
897   },
898
899   {
900     'key'         => 'showpasswords',
901     'section'     => 'UI',
902     'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
903     'type'        => 'checkbox',
904   },
905
906   {
907     'key'         => 'signupurl',
908     'section'     => 'UI',
909     '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',
910     'type'        => 'text',
911   },
912
913   {
914     'key'         => 'smtpmachine',
915     'section'     => 'required',
916     'description' => 'SMTP relay for Freeside\'s outgoing mail',
917     'type'        => 'text',
918   },
919
920   {
921     'key'         => 'soadefaultttl',
922     'section'     => 'BIND',
923     'description' => 'SOA default TTL for new domains.',
924     'type'        => 'text',
925   },
926
927   {
928     'key'         => 'soaemail',
929     'section'     => 'BIND',
930     'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
931     'type'        => 'text',
932   },
933
934   {
935     'key'         => 'soaexpire',
936     'section'     => 'BIND',
937     'description' => 'SOA expire for new domains',
938     'type'        => 'text',
939   },
940
941   {
942     'key'         => 'soamachine',
943     'section'     => 'BIND',
944     'description' => 'SOA machine for new domains, with trailing `.\'',
945     'type'        => 'text',
946   },
947
948   {
949     'key'         => 'soarefresh',
950     'section'     => 'BIND',
951     'description' => 'SOA refresh for new domains',
952     'type'        => 'text',
953   },
954
955   {
956     'key'         => 'soaretry',
957     'section'     => 'BIND',
958     'description' => 'SOA retry for new domains',
959     'type'        => 'text',
960   },
961
962   {
963     'key'         => 'statedefault',
964     'section'     => 'UI',
965     'description' => 'Default state or province (if not supplied, the default is `CA\')',
966     'type'        => 'text',
967   },
968
969   {
970     'key'         => 'radiusprepend',
971     'section'     => 'deprecated',
972     '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).',
973     'type'        => 'textarea',
974   },
975
976   {
977     'key'         => 'textradiusprepend',
978     'section'     => 'deprecated',
979     '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.',
980     'type'        => 'text',
981   },
982
983   {
984     'key'         => 'unsuspendauto',
985     'section'     => 'billing',
986     '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',
987     'type'        => 'checkbox',
988   },
989
990   {
991     'key'         => 'usernamemin',
992     'section'     => 'username',
993     'description' => 'Minimum username length (default 2)',
994     'type'        => 'text',
995   },
996
997   {
998     'key'         => 'usernamemax',
999     'section'     => 'username',
1000     'description' => 'Maximum username length',
1001     'type'        => 'text',
1002   },
1003
1004   {
1005     'key'         => 'username-ampersand',
1006     'section'     => 'username',
1007     '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.',
1008     'type'        => 'checkbox',
1009   },
1010
1011   {
1012     'key'         => 'username-letter',
1013     'section'     => 'username',
1014     'description' => 'Usernames must contain at least one letter',
1015     'type'        => 'checkbox',
1016   },
1017
1018   {
1019     'key'         => 'username-letterfirst',
1020     'section'     => 'username',
1021     'description' => 'Usernames must start with a letter',
1022     'type'        => 'checkbox',
1023   },
1024
1025   {
1026     'key'         => 'username-noperiod',
1027     'section'     => 'username',
1028     'description' => 'Disallow periods in usernames',
1029     'type'        => 'checkbox',
1030   },
1031
1032   {
1033     'key'         => 'username-nounderscore',
1034     'section'     => 'username',
1035     'description' => 'Disallow underscores in usernames',
1036     'type'        => 'checkbox',
1037   },
1038
1039   {
1040     'key'         => 'username-nodash',
1041     'section'     => 'username',
1042     'description' => 'Disallow dashes in usernames',
1043     'type'        => 'checkbox',
1044   },
1045
1046   {
1047     'key'         => 'username-uppercase',
1048     'section'     => 'username',
1049     'description' => 'Allow uppercase characters in usernames',
1050     'type'        => 'checkbox',
1051   },
1052
1053   { 
1054     'key'         => 'username-percent',
1055     'section'     => 'username',
1056     'description' => 'Allow the percent character (%) in usernames.',
1057     'type'        => 'checkbox',
1058   },
1059
1060   {
1061     'key'         => 'username_policy',
1062     'section'     => 'deprecated',
1063     '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\'',
1064     'type'        => 'select',
1065     'select_enum' => [ 'prepend domsvc', 'append domsvc', 'append domain', 'append @domain' ],
1066     #'type'        => 'text',
1067   },
1068
1069   {
1070     'key'         => 'vpopmailmachines',
1071     'section'     => 'deprecated',
1072     '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',
1073     'type'        => 'textarea',
1074   },
1075
1076   {
1077     'key'         => 'vpopmailrestart',
1078     'section'     => 'deprecated',
1079     '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.',
1080     'type'        => 'textarea',
1081   },
1082
1083   {
1084     'key'         => 'safe-part_pkg',
1085     'section'     => 'deprecated',
1086     'description' => '<b>DEPRECATED</b>, obsolete.  Used to validate package definition setup and recur expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
1087     'type'        => 'checkbox',
1088   },
1089
1090   {
1091     'key'         => 'safe-part_bill_event',
1092     'section'     => 'UI',
1093     'description' => 'Validates invoice event expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
1094     'type'        => 'checkbox',
1095   },
1096
1097   {
1098     'key'         => 'show_ss',
1099     'section'     => 'UI',
1100     'description' => 'Turns on display/collection of SS# in the web interface.',
1101     'type'        => 'checkbox',
1102   },
1103
1104   { 
1105     'key'         => 'agent_defaultpkg',
1106     'section'     => 'UI',
1107     'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
1108     'type'        => 'checkbox',
1109   },
1110
1111   {
1112     'key'         => 'legacy_link',
1113     'section'     => 'UI',
1114     'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
1115     'type'        => 'checkbox',
1116   },
1117
1118   {
1119     'key'         => 'legacy_link-steal',
1120     'section'     => 'UI',
1121     'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
1122     'type'        => 'checkbox',
1123   },
1124
1125   {
1126     'key'         => 'queue_dangerous_controls',
1127     'section'     => 'UI',
1128     '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.',
1129     'type'        => 'checkbox',
1130   },
1131
1132   {
1133     'key'         => 'security_phrase',
1134     'section'     => 'password',
1135     'description' => 'Enable the tracking of a "security phrase" with each account.  Not recommended, as it is vulnerable to social engineering.',
1136     'type'        => 'checkbox',
1137   },
1138
1139   {
1140     'key'         => 'locale',
1141     'section'     => 'UI',
1142     'description' => 'Message locale',
1143     'type'        => 'select',
1144     'select_enum' => [ qw(en_US) ],
1145   },
1146
1147   {
1148     'key'         => 'selfservice_server-quiet',
1149     'section'     => 'deprecated',
1150     '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.',
1151     'type'        => 'checkbox',
1152   },
1153
1154   {
1155     'key'         => 'signup_server-quiet',
1156     'section'     => 'deprecated',
1157     '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.',
1158     'type'        => 'checkbox',
1159   },
1160
1161   {
1162     'key'         => 'signup_server-payby',
1163     'section'     => '',
1164     'description' => 'Acceptable payment types for the signup server',
1165     'type'        => 'selectmultiple',
1166     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
1167   },
1168
1169   {
1170     'key'         => 'signup_server-email',
1171     'section'     => 'deprecated',
1172     '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.',
1173     'type'        => 'text',
1174   },
1175
1176   {
1177     'key'         => 'signup_server-default_agentnum',
1178     'section'     => '',
1179     'description' => 'Default agentnum for the signup server',
1180     'type'        => 'text',
1181   },
1182
1183   {
1184     'key'         => 'signup_server-default_refnum',
1185     'section'     => '',
1186     'description' => 'Default advertising source number for the signup server',
1187     'type'        => 'text',
1188   },
1189
1190   {
1191     'key'         => 'show-msgcat-codes',
1192     'section'     => 'UI',
1193     'description' => 'Show msgcat codes in error messages.  Turn this option on before reporting errors to the mailing list.',
1194     'type'        => 'checkbox',
1195   },
1196
1197   {
1198     'key'         => 'signup_server-realtime',
1199     'section'     => '',
1200     'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
1201     'type'        => 'checkbox',
1202   },
1203
1204   {
1205     'key'         => 'declinetemplate',
1206     'section'     => 'billing',
1207     'description' => 'Template file for credit card decline emails.',
1208     'type'        => 'textarea',
1209   },
1210
1211   {
1212     'key'         => 'emaildecline',
1213     'section'     => 'billing',
1214     'description' => 'Enable emailing of credit card decline notices.',
1215     'type'        => 'checkbox',
1216   },
1217
1218   {
1219     'key'         => 'emaildecline-exclude',
1220     'section'     => 'billing',
1221     'description' => 'List of error messages that should not trigger email decline notices, one per line.',
1222     'type'        => 'textarea',
1223   },
1224
1225   {
1226     'key'         => 'cancelmessage',
1227     'section'     => 'billing',
1228     'description' => 'Template file for cancellation emails.',
1229     'type'        => 'textarea',
1230   },
1231
1232   {
1233     'key'         => 'cancelsubject',
1234     'section'     => 'billing',
1235     'description' => 'Subject line for cancellation emails.',
1236     'type'        => 'text',
1237   },
1238
1239   {
1240     'key'         => 'emailcancel',
1241     'section'     => 'billing',
1242     'description' => 'Enable emailing of cancellation notices.',
1243     'type'        => 'checkbox',
1244   },
1245
1246   {
1247     'key'         => 'require_cardname',
1248     'section'     => 'billing',
1249     'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
1250     'type'        => 'checkbox',
1251   },
1252
1253   {
1254     'key'         => 'enable_taxclasses',
1255     'section'     => 'billing',
1256     'description' => 'Enable per-package tax classes',
1257     'type'        => 'checkbox',
1258   },
1259
1260   {
1261     'key'         => 'require_taxclasses',
1262     'section'     => 'billing',
1263     'description' => 'Require a taxclass to be entered for every package',
1264     'type'        => 'checkbox',
1265   },
1266
1267   {
1268     'key'         => 'welcome_email',
1269     'section'     => '',
1270     '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/~mjd/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitution language.  The following variables are available<ul><li><code>$username</code> <li><code>$password</code> <li><code>$first</code> <li><code>$last</code> <li><code>$pkg</code></ul>',
1271     'type'        => 'textarea',
1272   },
1273
1274   {
1275     'key'         => 'welcome_email-from',
1276     'section'     => '',
1277     'description' => 'From: address header for welcome email',
1278     'type'        => 'text',
1279   },
1280
1281   {
1282     'key'         => 'welcome_email-subject',
1283     'section'     => '',
1284     'description' => 'Subject: header for welcome email',
1285     'type'        => 'text',
1286   },
1287   
1288   {
1289     'key'         => 'welcome_email-mimetype',
1290     'section'     => '',
1291     'description' => 'MIME type for welcome email',
1292     'type'        => 'select',
1293     'select_enum' => [ 'text/plain', 'text/html' ],
1294   },
1295
1296   {
1297     'key'         => 'payby-default',
1298     'section'     => 'UI',
1299     'description' => 'Default payment type.  HIDE disables display of billing information and sets customers to BILL.',
1300     'type'        => 'select',
1301     'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL COMP HIDE) ],
1302   },
1303
1304   {
1305     'key'         => 'svc_acct-notes',
1306     'section'     => 'UI',
1307     'description' => 'Extra HTML to be displayed on the Account View screen.',
1308     'type'        => 'textarea',
1309   },
1310
1311   {
1312     'key'         => 'radius-password',
1313     'section'     => '',
1314     'description' => 'RADIUS attribute for plain-text passwords.',
1315     'type'        => 'select',
1316     'select_enum' => [ 'Password', 'User-Password' ],
1317   },
1318
1319   {
1320     'key'         => 'radius-ip',
1321     'section'     => '',
1322     'description' => 'RADIUS attribute for IP addresses.',
1323     'type'        => 'select',
1324     'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
1325   },
1326
1327   {
1328     'key'         => 'svc_acct-alldomains',
1329     'section'     => '',
1330     '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.',
1331     'type'        => 'checkbox',
1332   },
1333
1334   {
1335     'key'         => 'dump-scpdest',
1336     'section'     => '',
1337     'description' => 'destination for scp database dumps: user@host:/path',
1338     'type'        => 'text',
1339   },
1340
1341   {
1342     'key'         => 'dump-pgpid',
1343     'section'     => '',
1344     '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.",
1345     'type'        => 'text',
1346   },
1347
1348   {
1349     'key'         => 'users-allow_comp',
1350     'section'     => '',
1351     '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.',
1352     'type'        => 'textarea',
1353   },
1354
1355   {
1356     'key'         => 'cvv-save',
1357     'section'     => 'billing',
1358     '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.',
1359     'type'        => 'selectmultiple',
1360     'select_enum' => [ "VISA card",
1361                        "MasterCard",
1362                        "Discover card",
1363                        "American Express card",
1364                        "Diner's Club/Carte Blanche",
1365                        "enRoute",
1366                        "JCB",
1367                        "BankCard",
1368                      ],
1369   },
1370
1371   {
1372     'key'         => 'allow_negative_charges',
1373     'section'     => 'billing',
1374     'description' => 'Allow negative charges.  Normally not used unless importing data from a legacy system that requires this.',
1375     'type'        => 'checkbox',
1376   },
1377   {
1378       'key'         => 'auto_unset_catchall',
1379       'section'     => '',
1380       '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.',
1381       'type'        => 'checkbox',
1382   },
1383
1384   {
1385     'key'         => 'system_usernames',
1386     'section'     => 'username',
1387     '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.',
1388     'type'        => 'textarea',
1389   },
1390
1391   {
1392     'key'         => 'cust_pkg-change_svcpart',
1393     'section'     => '',
1394     'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
1395     'type'        => 'checkbox',
1396   },
1397
1398   {
1399     'key'         => 'disable_autoreverse',
1400     'section'     => 'BIND',
1401     'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
1402     'type'        => 'checkbox',
1403   },
1404
1405   {
1406     'key'         => 'svc_www-enable_subdomains',
1407     'section'     => '',
1408     'description' => 'Enable selection of specific subdomains for virtual host creation.',
1409     'type'        => 'checkbox',
1410   },
1411
1412   {
1413     'key'         => 'svc_www-usersvc_svcpart',
1414     'section'     => '',
1415     'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
1416     'type'        => 'textarea',
1417   },
1418
1419   {
1420     'key'         => 'selfservice_server-primary_only',
1421     'section'     => '',
1422     'description' => 'Only allow primary accounts to access self-service functionality.',
1423     'type'        => 'checkbox',
1424   },
1425
1426   {
1427     'key'         => 'card_refund-days',
1428     'section'     => 'billing',
1429     'description' => 'After a payment, the number of days a refund link will be available for that payment.  Defaults to 120.',
1430     'type'        => 'text',
1431   },
1432
1433   {
1434     'key'         => 'agent-showpasswords',
1435     'section'     => '',
1436     'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
1437     'type'        => 'checkbox',
1438   },
1439
1440   {
1441     'key'         => 'global_unique-username',
1442     'section'     => 'username',
1443     '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)',
1444     'type'        => 'select',
1445     'select_enum' => [ 'none', 'username', 'username@domain' ],
1446   },
1447
1448   {
1449     'key'         => 'svc_external-skip_manual',
1450     'section'     => 'UI',
1451     '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).',
1452     'type'        => 'checkbox',
1453   },
1454
1455   {
1456     'key'         => 'svc_external-display_type',
1457     'section'     => 'UI',
1458     'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
1459     'type'        => 'select',
1460     'select_enum' => [ 'generic', 'artera_turbo', ],
1461   },
1462
1463   {
1464     'key'         => 'ticket_system',
1465     'section'     => '',
1466     '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).',
1467     'type'        => 'select',
1468     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
1469     'select_enum' => [ '', qw(RT_Internal RT_External) ],
1470   },
1471
1472   {
1473     'key'         => 'ticket_system-default_queueid',
1474     'section'     => '',
1475     'description' => 'Default queue number used when creating new customer tickets.',
1476     'type'        => 'text',
1477   },
1478
1479   {
1480     'key'         => 'ticket_system-custom_priority_field',
1481     'section'     => '',
1482     'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
1483     'type'        => 'text',
1484   },
1485
1486   {
1487     'key'         => 'ticket_system-custom_priority_field-values',
1488     'section'     => '',
1489     'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
1490     'type'        => 'textarea',
1491   },
1492
1493   {
1494     'key'         => 'ticket_system-custom_priority_field_queue',
1495     'section'     => '',
1496     'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
1497     'type'        => 'text',
1498   },
1499
1500   {
1501     'key'         => 'company_name',
1502     'section'     => 'required',
1503     'description' => 'Your company name',
1504     'type'        => 'text',
1505   },
1506
1507   {
1508     'key'         => 'echeck-void',
1509     'section'     => 'billing',
1510     'description' => 'Enable local-only voiding of echeck payments in addition to refunds against the payment gateway',
1511     'type'        => 'checkbox',
1512   },
1513
1514   {
1515     'key'         => 'cc-void',
1516     'section'     => 'billing',
1517     'description' => 'Enable local-only voiding of credit card payments in addition to refunds against the payment gateway',
1518     'type'        => 'checkbox',
1519   },
1520
1521   {
1522     'key'         => 'address2-search',
1523     'section'     => 'UI',
1524     'description' => 'Enable a "Unit" search box which searches the second address field',
1525     'type'        => 'checkbox',
1526   },
1527
1528   { 'key'         => 'referral_credit',
1529     'section'     => 'billing',
1530     'description' => "Enables one-time referral credits in the amount of one month <i>referred</i> customer's recurring fee (irregardless of frequency).",
1531     'type'        => 'checkbox',
1532   },
1533
1534   { 'key'         => 'selfservice_server-cache_module',
1535     'section'     => '',
1536     '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.',
1537     'type'        => 'select',
1538     'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
1539   },
1540
1541   {
1542     'key'         => 'hylafax',
1543     'section'     => '',
1544     '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).',
1545     'type'        => [qw( checkbox textarea )],
1546   },
1547
1548   {
1549     'key'         => 'svc_acct-usage_suspend',
1550     'section'     => 'billing',
1551     '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.',
1552     'type'        => 'checkbox',
1553   },
1554
1555   {
1556     'key'         => 'svc_acct-usage_unsuspend',
1557     'section'     => 'billing',
1558     'description' => 'Unuspends the package an account belongs to when svc_acct.seconds is incremented from 0 or below to a positive value (accounts with an empty seconds value are ignored).  Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd.',
1559     'type'        => 'checkbox',
1560   },
1561
1562   {
1563     'key'         => 'cust-fields',
1564     'section'     => 'UI',
1565     'description' => 'Which customer fields to display on reports',
1566     'type'        => 'select',
1567     'select_enum' => [
1568       'Customer: Last, First</b> or</i> Company (Last, First)</b>',
1569       'Cust# | Customer: custnum | Last, First or Company (Last, First)',
1570       'Name | Company: Last, First | Company',
1571       'Cust# | Name | Company: custnum | Last, First | Company',
1572       '(bill) Customer | (service) Customer: Last, First or Company (Last, First) | (same for service address if present)',
1573       'Cust# | (bill) Customer | (service) Customer:  custnum | Last, First or Company (Last, First) | (same for service address if present)',
1574       '(bill) Name | (bill) Company | (service) Name | (service) Company: Last, First | Company | (same for service address if present)',
1575       'Cust# | (bill) Name | (bill) Company | (service) Name | (service) Company: custnum | Last, First | Company | (same for service address if present)',
1576     ],
1577   },
1578
1579   {
1580     'key'         => 'cust_pkg-display_times',
1581     'section'     => 'UI',
1582     'description' => 'Display full timestamps (not just dates) for customer packages.  Useful if you are doing real-time things like hourly prepaid.',
1583     'type'        => 'checkbox',
1584   },
1585
1586   {
1587     'key'         => 'svc_acct-edit_uid',
1588     'section'     => 'shell',
1589     'description' => 'Allow UID editing.',
1590     'type'        => 'checkbox',
1591   },
1592
1593   {
1594     'key'         => 'svc_acct-edit_gid',
1595     'section'     => 'shell',
1596     'description' => 'Allow GID editing.',
1597     'type'        => 'checkbox',
1598   },
1599
1600
1601 );
1602
1603 1;
1604