fix documenation links to point into wiki where they belong
[freeside.git] / FS / FS / Conf.pm
1 package FS::Conf;
2
3 use vars qw($default_dir $base_dir @config_items @card_types $DEBUG );
4 use IO::File;
5 use File::Basename;
6 use FS::ConfItem;
7 use FS::ConfDefaults;
8
9 $base_dir = '%%%FREESIDE_CONF%%%';
10 $default_dir = '%%%FREESIDE_CONF%%%';
11
12
13 $DEBUG = 0;
14
15 =head1 NAME
16
17 FS::Conf - Freeside configuration values
18
19 =head1 SYNOPSIS
20
21   use FS::Conf;
22
23   $conf = new FS::Conf "/config/directory";
24
25   $FS::Conf::default_dir = "/config/directory";
26   $conf = new FS::Conf;
27
28   $dir = $conf->dir;
29
30   $value = $conf->config('key');
31   @list  = $conf->config('key');
32   $bool  = $conf->exists('key');
33
34   $conf->touch('key');
35   $conf->set('key' => 'value');
36   $conf->delete('key');
37
38   @config_items = $conf->config_items;
39
40 =head1 DESCRIPTION
41
42 Read and write Freeside configuration values.  Keys currently map to filenames,
43 but this may change in the future.
44
45 =head1 METHODS
46
47 =over 4
48
49 =item new [ DIRECTORY ]
50
51 Create a new configuration object.  A directory arguement is required if
52 $FS::Conf::default_dir has not been set.
53
54 =cut
55
56 sub new {
57   my($proto,$dir) = @_;
58   my($class) = ref($proto) || $proto;
59   my($self) = { 'dir'      => $dir || $default_dir,
60                 'base_dir' => $base_dir,
61               };
62   bless ($self, $class);
63 }
64
65 =item dir
66
67 Returns the conf directory.
68
69 =cut
70
71 sub dir {
72   my($self) = @_;
73   my $dir = $self->{dir};
74   -e $dir or die "FATAL: $dir doesn't exist!";
75   -d $dir or die "FATAL: $dir isn't a directory!";
76   -r $dir or die "FATAL: Can't read $dir!";
77   -x $dir or die "FATAL: $dir not searchable (executable)!";
78   $dir =~ /^(.*)$/;
79   $1;
80 }
81
82 =item base_dir
83
84 Returns the base directory.  By default this is /usr/local/etc/freeside.
85
86 =cut
87
88 sub base_dir {
89   my($self) = @_;
90   my $base_dir = $self->{base_dir};
91   -e $base_dir or die "FATAL: $base_dir doesn't exist!";
92   -d $base_dir or die "FATAL: $base_dir isn't a directory!";
93   -r $base_dir or die "FATAL: Can't read $base_dir!";
94   -x $base_dir or die "FATAL: $base_dir not searchable (executable)!";
95   $base_dir =~ /^(.*)$/;
96   $1;
97 }
98
99 =item config KEY
100
101 Returns the configuration value or values (depending on context) for key.
102
103 =cut
104
105 sub config {
106   my($self,$file)=@_;
107   my($dir)=$self->dir;
108   my $fh = new IO::File "<$dir/$file" or return;
109   if ( wantarray ) {
110     map {
111       /^(.*)$/
112         or die "Illegal line (array context) in $dir/$file:\n$_\n";
113       $1;
114     } <$fh>;
115   } else {
116     <$fh> =~ /^(.*)$/
117       or die "Illegal line (scalar context) in $dir/$file:\n$_\n";
118     $1;
119   }
120 }
121
122 =item config_binary KEY
123
124 Returns the exact scalar value for key.
125
126 =cut
127
128 sub config_binary {
129   my($self,$file)=@_;
130   my($dir)=$self->dir;
131   my $fh = new IO::File "<$dir/$file" or return;
132   local $/;
133   my $content = <$fh>;
134   $content;
135 }
136
137 =item exists KEY
138
139 Returns true if the specified key exists, even if the corresponding value
140 is undefined.
141
142 =cut
143
144 sub exists {
145   my($self,$file)=@_;
146   my($dir) = $self->dir;
147   -e "$dir/$file";
148 }
149
150 =item config_orbase KEY SUFFIX
151
152 Returns the configuration value or values (depending on context) for 
153 KEY_SUFFIX, if it exists, otherwise for KEY
154
155 =cut
156
157 sub config_orbase {
158   my( $self, $file, $suffix ) = @_;
159   if ( $self->exists("${file}_$suffix") ) {
160     $self->config("${file}_$suffix");
161   } else {
162     $self->config($file);
163   }
164 }
165
166 =item touch KEY
167
168 Creates the specified configuration key if it does not exist.
169
170 =cut
171
172 sub touch {
173   my($self, $file) = @_;
174   my $dir = $self->dir;
175   unless ( $self->exists($file) ) {
176     warn "[FS::Conf] TOUCH $file\n" if $DEBUG;
177     system('touch', "$dir/$file");
178   }
179 }
180
181 =item set KEY VALUE
182
183 Sets the specified configuration key to the given value.
184
185 =cut
186
187 sub set {
188   my($self, $file, $value) = @_;
189   my $dir = $self->dir;
190   $value =~ /^(.*)$/s;
191   $value = $1;
192   unless ( join("\n", @{[ $self->config($file) ]}) eq $value ) {
193     warn "[FS::Conf] SET $file\n" if $DEBUG;
194 #    warn "$dir" if is_tainted($dir);
195 #    warn "$dir" if is_tainted($file);
196     chmod 0644, "$dir/$file";
197     my $fh = new IO::File ">$dir/$file" or return;
198     chmod 0644, "$dir/$file";
199     print $fh "$value\n";
200   }
201 }
202 #sub is_tainted {
203 #             return ! eval { join('',@_), kill 0; 1; };
204 #         }
205
206 =item delete KEY
207
208 Deletes the specified configuration key.
209
210 =cut
211
212 sub delete {
213   my($self, $file) = @_;
214   my $dir = $self->dir;
215   if ( $self->exists($file) ) {
216     warn "[FS::Conf] DELETE $file\n";
217     unlink "$dir/$file";
218   }
219 }
220
221 =item config_items
222
223 Returns all of the possible configuration items as FS::ConfItem objects.  See
224 L<FS::ConfItem>.
225
226 =cut
227
228 sub config_items {
229   my $self = shift; 
230   #quelle kludge
231   @config_items,
232   ( map { 
233         my $basename = basename($_);
234         $basename =~ /^(.*)$/;
235         $basename = $1;
236         new FS::ConfItem {
237                            'key'         => $basename,
238                            'section'     => 'billing',
239                            'description' => 'Alternate template file for invoices.  See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
240                            'type'        => 'textarea',
241                          }
242       } glob($self->dir. '/invoice_template_*')
243   ),
244   ( map { 
245         my $basename = basename($_);
246         $basename =~ /^(.*)$/;
247         $basename = $1;
248         new FS::ConfItem {
249                            'key'         => $basename,
250                            'section'     => 'billing',
251                            'description' => 'Alternate HTML template for invoices.  See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
252                            'type'        => 'textarea',
253                          }
254       } glob($self->dir. '/invoice_html_*')
255   ),
256   ( map { 
257         my $basename = basename($_);
258         $basename =~ /^(.*)$/;
259         $basename = $1;
260         ($latexname = $basename ) =~ s/latex/html/;
261         new FS::ConfItem {
262                            'key'         => $basename,
263                            'section'     => 'billing',
264                            'description' => "Alternate Notes section for HTML invoices.  Defaults to the same data in $latexname if not specified.",
265                            'type'        => 'textarea',
266                          }
267       } glob($self->dir. '/invoice_htmlnotes_*')
268   ),
269   ( map { 
270         my $basename = basename($_);
271         $basename =~ /^(.*)$/;
272         $basename = $1;
273         new FS::ConfItem {
274                            'key'         => $basename,
275                            'section'     => 'billing',
276                            'description' => 'Alternate LaTeX template for invoices.  See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
277                            'type'        => 'textarea',
278                          }
279       } glob($self->dir. '/invoice_latex_*')
280   ),
281   ( map { 
282         my $basename = basename($_);
283         $basename =~ /^(.*)$/;
284         $basename = $1;
285         new FS::ConfItem {
286                            'key'         => $basename,
287                            'section'     => 'billing',
288                            'description' => 'Alternate Notes section for LaTeX typeset PostScript invoices.  See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
289                            'type'        => 'textarea',
290                          }
291       } glob($self->dir. '/invoice_latexnotes_*')
292   );
293 }
294
295 =back
296
297 =head1 BUGS
298
299 If this was more than just crud that will never be useful outside Freeside I'd
300 worry that config_items is freeside-specific and icky.
301
302 =head1 SEE ALSO
303
304 "Configuration" in the web interface (config/config.cgi).
305
306 =cut
307
308 #Business::CreditCard
309 @card_types = (
310   "VISA card",
311   "MasterCard",
312   "Discover card",
313   "American Express card",
314   "Diner's Club/Carte Blanche",
315   "enRoute",
316   "JCB",
317   "BankCard",
318   "Switch",
319   "Solo",
320 );
321
322 @config_items = map { new FS::ConfItem $_ } (
323
324   {
325     'key'         => 'address',
326     'section'     => 'deprecated',
327     'description' => 'This configuration option is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.',
328     'type'        => 'text',
329   },
330
331   {
332     'key'         => 'alerter_template',
333     'section'     => 'billing',
334     'description' => 'Template file for billing method expiration alerts.  See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Credit_cards_and_Electronic_checks">billing documentation</a> for details.',
335     'type'        => 'textarea',
336   },
337
338   {
339     'key'         => 'apacheroot',
340     'section'     => 'deprecated',
341     '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',
342     'type'        => 'text',
343   },
344
345   {
346     'key'         => 'apacheip',
347     'section'     => 'deprecated',
348     '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',
349     'type'        => 'text',
350   },
351
352   {
353     'key'         => 'apachemachine',
354     'section'     => 'deprecated',
355     '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.',
356     'type'        => 'text',
357   },
358
359   {
360     'key'         => 'apachemachines',
361     'section'     => 'deprecated',
362     '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.',
363     'type'        => 'textarea',
364   },
365
366   {
367     'key'         => 'bindprimary',
368     'section'     => 'deprecated',
369     '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',
370     'type'        => 'text',
371   },
372
373   {
374     'key'         => 'bindsecondaries',
375     'section'     => 'deprecated',
376     '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',
377     'type'        => 'textarea',
378   },
379
380   {
381     'key'         => 'encryption',
382     'section'     => 'billing',
383     'description' => 'Enable encryption of credit cards.',
384     'type'        => 'checkbox',
385   },
386
387   {
388     'key'         => 'encryptionmodule',
389     'section'     => 'billing',
390     'description' => 'Use which module for encryption?',
391     'type'        => 'text',
392   },
393
394   {
395     'key'         => 'encryptionpublickey',
396     'section'     => 'billing',
397     'description' => 'Your RSA Public Key - Required if Encryption is turned on.',
398     'type'        => 'textarea',
399   },
400
401   {
402     'key'         => 'encryptionprivatekey',
403     'section'     => 'billing',
404     '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.',
405     'type'        => 'textarea',
406   },
407
408   {
409     'key'         => 'business-onlinepayment',
410     'section'     => 'billing',
411     '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.',
412     'type'        => 'textarea',
413   },
414
415   {
416     'key'         => 'business-onlinepayment-ach',
417     'section'     => 'billing',
418     '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.',
419     'type'        => 'textarea',
420   },
421
422   {
423     'key'         => 'business-onlinepayment-description',
424     'section'     => 'billing',
425     '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)',
426     'type'        => 'text',
427   },
428
429   {
430     'key'         => 'business-onlinepayment-email-override',
431     'section'     => 'billing',
432     'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
433     'type'        => 'text',
434   },
435
436   {
437     'key'         => 'bsdshellmachines',
438     'section'     => 'deprecated',
439     '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\'.',
440     'type'        => 'textarea',
441   },
442
443   {
444     'key'         => 'countrydefault',
445     'section'     => 'UI',
446     'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
447     'type'        => 'text',
448   },
449
450   {
451     'key'         => 'date_format',
452     'section'     => 'UI',
453     'description' => 'Format for displaying dates',
454     'type'        => 'select',
455     'select_hash' => [
456                        '%m/%d/%Y' => 'MM/DD/YYYY',
457                        '%Y/%m/%d' => 'YYYY/MM/DD',
458                      ],
459   },
460
461   {
462     'key'         => 'cyrus',
463     'section'     => 'deprecated',
464     '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.',
465     'type'        => 'textarea',
466   },
467
468   {
469     'key'         => 'cp_app',
470     'section'     => 'deprecated',
471     '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).',
472     'type'        => 'textarea',
473   },
474
475   {
476     'key'         => 'deletecustomers',
477     'section'     => 'UI',
478     '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.',
479     'type'        => 'checkbox',
480   },
481
482   {
483     'key'         => 'deletepayments',
484     'section'     => 'billing',
485     'description' => 'Enable deletion of unclosed payments.  Really, with voids this is pretty much not recommended in any situation anymore.  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.',
486     'type'        => [qw( checkbox text )],
487   },
488
489   {
490     'key'         => 'deletecredits',
491     'section'     => 'deprecated',
492     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to 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.',
493     'type'        => [qw( checkbox text )],
494   },
495
496   {
497     'key'         => 'deleterefunds',
498     'section'     => 'billing',
499     'description' => 'Enable deletion of unclosed refunds.  Be very careful!  Only delete refunds that were data-entry errors, not adjustments.',
500     'type'        => 'checkbox',
501   },
502
503   {
504     'key'         => 'unapplypayments',
505     'section'     => 'deprecated',
506     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable "unapplication" of unclosed payments.',
507     'type'        => 'checkbox',
508   },
509
510   {
511     'key'         => 'unapplycredits',
512     'section'     => 'deprecated',
513     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to nable "unapplication" of unclosed credits.',
514     'type'        => 'checkbox',
515   },
516
517   {
518     'key'         => 'dirhash',
519     'section'     => 'shell',
520     '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>',
521     'type'        => 'text',
522   },
523
524   {
525     'key'         => 'disable_customer_referrals',
526     'section'     => 'UI',
527     'description' => 'Disable new customer-to-customer referrals in the web interface',
528     'type'        => 'checkbox',
529   },
530
531   {
532     'key'         => 'editreferrals',
533     'section'     => 'UI',
534     'description' => 'Enable advertising source modification for existing customers',
535     'type'       => 'checkbox',
536   },
537
538   {
539     'key'         => 'emailinvoiceonly',
540     'section'     => 'billing',
541     'description' => 'Disables postal mail invoices',
542     'type'       => 'checkbox',
543   },
544
545   {
546     'key'         => 'disablepostalinvoicedefault',
547     'section'     => 'billing',
548     '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>.',
549     'type'       => 'checkbox',
550   },
551
552   {
553     'key'         => 'emailinvoiceauto',
554     'section'     => 'billing',
555     'description' => 'Automatically adds new accounts to the email invoice list',
556     'type'       => 'checkbox',
557   },
558
559   {
560     'key'         => 'emailinvoiceautoalways',
561     'section'     => 'billing',
562     'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses',
563     'type'       => 'checkbox',
564   },
565
566   {
567     'key'         => 'exclude_ip_addr',
568     'section'     => '',
569     'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
570     'type'        => 'textarea',
571   },
572   
573   {
574     'key'         => 'erpcdmachines',
575     'section'     => 'deprecated',
576     'description' => '<b>DEPRECATED</b>, ERPCD is no longer supported.  Used to be ERPCD authentication machines, one per line.  This enables export of `/usr/annex/acp_passwd\' and `/usr/annex/acp_dialup\'',
577     'type'        => 'textarea',
578   },
579
580   {
581     'key'         => 'hidecancelledpackages',
582     'section'     => 'UI',
583     'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
584     'type'        => 'checkbox',
585   },
586
587   {
588     'key'         => 'hidecancelledcustomers',
589     'section'     => 'UI',
590     'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
591     'type'        => 'checkbox',
592   },
593
594   {
595     'key'         => 'home',
596     'section'     => 'required',
597     'description' => 'For new users, prefixed to username to create a directory name.  Should have a leading but not a trailing slash.',
598     'type'        => 'text',
599   },
600
601   {
602     'key'         => 'icradiusmachines',
603     'section'     => 'deprecated',
604     '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>',
605     'type'        => [qw( checkbox textarea )],
606   },
607
608   {
609     'key'         => 'icradius_mysqldest',
610     'section'     => 'deprecated',
611     '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/".',
612     'type'        => 'text',
613   },
614
615   {
616     'key'         => 'icradius_mysqlsource',
617     'section'     => 'deprecated',
618     '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".',
619     'type'        => 'text',
620   },
621
622   {
623     'key'         => 'icradius_secrets',
624     'section'     => 'deprecated',
625     '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.',
626     'type'        => 'textarea',
627   },
628
629   {
630     'key'         => 'invoice_from',
631     'section'     => 'required',
632     'description' => 'Return address on email invoices',
633     'type'        => 'text',
634   },
635
636   {
637     'key'         => 'invoice_template',
638     'section'     => 'required',
639     'description' => 'Required template file for invoices.  See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Plaintext_invoice_templates">billing documentation</a> for details.',
640     'type'        => 'textarea',
641   },
642
643   {
644     'key'         => 'invoice_html',
645     'section'     => 'billing',
646     'description' => 'Optional HTML template for invoices.  See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#HTML_invoice_templates">billing documentation</a> for details.',
647
648     'type'        => 'textarea',
649   },
650
651   {
652     'key'         => 'invoice_htmlnotes',
653     'section'     => 'billing',
654     'description' => 'Notes section for HTML invoices.  Defaults to the same data in invoice_latexnotes if not specified.',
655     'type'        => 'textarea',
656   },
657
658   {
659     'key'         => 'invoice_htmlfooter',
660     'section'     => 'billing',
661     'description' => 'Footer for HTML invoices.  Defaults to the same data in invoice_latexfooter if not specified.',
662     'type'        => 'textarea',
663   },
664
665   {
666     'key'         => 'invoice_htmlreturnaddress',
667     'section'     => 'billing',
668     'description' => 'Return address for HTML invoices.  Defaults to the same data in invoice_latexreturnaddress if not specified.',
669     'type'        => 'textarea',
670   },
671
672   {
673     'key'         => 'invoice_latex',
674     'section'     => 'billing',
675     'description' => 'Optional LaTeX template for typeset PostScript invoices.  See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Typeset_.28LaTeX.29_invoice_templates">billing documentation</a> for details.',
676     'type'        => 'textarea',
677   },
678
679   {
680     'key'         => 'invoice_latexnotes',
681     'section'     => 'billing',
682     'description' => 'Notes section for LaTeX typeset PostScript invoices.',
683     'type'        => 'textarea',
684   },
685
686   {
687     'key'         => 'invoice_latexfooter',
688     'section'     => 'billing',
689     'description' => 'Footer for LaTeX typeset PostScript invoices.',
690     'type'        => 'textarea',
691   },
692
693   {
694     'key'         => 'invoice_latexreturnaddress',
695     'section'     => 'billing',
696     'description' => 'Return address for LaTeX typeset PostScript invoices.',
697     'type'        => 'textarea',
698   },
699
700   {
701     'key'         => 'invoice_latexsmallfooter',
702     'section'     => 'billing',
703     'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
704     'type'        => 'textarea',
705   },
706
707   {
708     'key'         => 'invoice_email_pdf',
709     'section'     => 'billing',
710     '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.',
711     'type'        => 'checkbox'
712   },
713
714   {
715     'key'         => 'invoice_email_pdf_note',
716     'section'     => 'billing',
717     'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.',
718     'type'        => 'textarea'
719   },
720
721
722   { 
723     'key'         => 'invoice_default_terms',
724     'section'     => 'billing',
725     'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
726     'type'        => 'select',
727     'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 30', 'Net 45', 'Net 60' ],
728   },
729
730   {
731     'key'         => 'invoice_send_receipts',
732     'section'     => 'deprecated',
733     'description' => '<b>DEPRECATED</b>, this used to send an invoice copy on payments and credits.  See the payment_receipt_email and XXXX instead.',
734     'type'        => 'checkbox',
735   },
736
737   {
738     'key'         => 'payment_receipt_email',
739     'section'     => 'billing',
740     '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>',
741     'type'        => [qw( checkbox textarea )],
742   },
743
744   {
745     'key'         => 'lpr',
746     'section'     => 'required',
747     'description' => 'Print command for paper invoices, for example `lpr -h\'',
748     'type'        => 'text',
749   },
750
751   {
752     'key'         => 'maildisablecatchall',
753     'section'     => 'deprecated',
754     '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.',
755     'type'        => 'checkbox',
756   },
757
758   {
759     'key'         => 'lpr-postscript_prefix',
760     'section'     => 'billing',
761     'description' => 'Raw printer commands prepended to the beginning of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
762     'type'        => 'text',
763   },
764
765   {
766     'key'         => 'lpr-postscript_suffix',
767     'section'     => 'billing',
768     'description' => 'Raw printer commands added to the end of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
769     'type'        => 'text',
770   },
771
772   {
773     'key'         => 'money_char',
774     'section'     => '',
775     'description' => 'Currency symbol - defaults to `$\'',
776     'type'        => 'text',
777   },
778
779   {
780     'key'         => 'mxmachines',
781     'section'     => 'deprecated',
782     'description' => 'MX entries for new domains, weight and machine, one per line, with trailing `.\'',
783     'type'        => 'textarea',
784   },
785
786   {
787     'key'         => 'nsmachines',
788     'section'     => 'deprecated',
789     'description' => 'NS nameservers for new domains, one per line, with trailing `.\'',
790     'type'        => 'textarea',
791   },
792
793   {
794     'key'         => 'defaultrecords',
795     'section'     => 'BIND',
796     'description' => 'DNS entries to add automatically when creating a domain',
797     'type'        => 'editlist',
798     'editlist_parts' => [ { type=>'text' },
799                           { type=>'immutable', value=>'IN' },
800                           { type=>'select',
801                             select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS TXT)} },
802                           { type=> 'text' }, ],
803   },
804
805   {
806     'key'         => 'arecords',
807     'section'     => 'deprecated',
808     'description' => 'A list of tab seperated CNAME records to add automatically when creating a domain',
809     'type'        => 'textarea',
810   },
811
812   {
813     'key'         => 'cnamerecords',
814     'section'     => 'deprecated',
815     'description' => 'A list of tab seperated CNAME records to add automatically when creating a domain',
816     'type'        => 'textarea',
817   },
818
819   {
820     'key'         => 'nismachines',
821     'section'     => 'deprecated',
822     '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\'.',
823     'type'        => 'textarea',
824   },
825
826   {
827     'key'         => 'passwordmin',
828     'section'     => 'password',
829     'description' => 'Minimum password length (default 6)',
830     'type'        => 'text',
831   },
832
833   {
834     'key'         => 'passwordmax',
835     'section'     => 'password',
836     'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
837     'type'        => 'text',
838   },
839
840   {
841     'key' => 'password-noampersand',
842     'section' => 'password',
843     'description' => 'Disallow ampersands in passwords',
844     'type' => 'checkbox',
845   },
846
847   {
848     'key' => 'password-noexclamation',
849     'section' => 'password',
850     'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
851     'type' => 'checkbox',
852   },
853
854   {
855     'key'         => 'qmailmachines',
856     'section'     => 'deprecated',
857     '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.',
858     'type'        => [qw( checkbox textarea )],
859   },
860
861   {
862     'key'         => 'radiusmachines',
863     'section'     => 'deprecated',
864     '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\'.',
865     'type'        => 'textarea',
866   },
867
868   {
869     'key'         => 'referraldefault',
870     'section'     => 'UI',
871     'description' => 'Default referral, specified by refnum',
872     'type'        => 'text',
873   },
874
875 #  {
876 #    'key'         => 'registries',
877 #    'section'     => 'required',
878 #    'description' => 'Directory which contains domain registry information.  Each registry is a directory.',
879 #  },
880
881   {
882     'key'         => 'report_template',
883     'section'     => 'deprecated',
884     'description' => 'Deprecated template file for reports.',
885     'type'        => 'textarea',
886   },
887
888
889   {
890     'key'         => 'maxsearchrecordsperpage',
891     'section'     => 'UI',
892     'description' => 'If set, number of search records to return per page.',
893     'type'        => 'text',
894   },
895
896   {
897     'key'         => 'sendmailconfigpath',
898     'section'     => 'deprecated',
899     '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\'.',
900     'type'        => 'text',
901   },
902
903   {
904     'key'         => 'sendmailmachines',
905     'section'     => 'deprecated',
906     '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\'.',
907     'type'        => 'textarea',
908   },
909
910   {
911     'key'         => 'sendmailrestart',
912     'section'     => 'deprecated',
913     '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.',
914     'type'        => 'text',
915   },
916
917   {
918     'key'         => 'session-start',
919     'section'     => 'session',
920     '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.',
921     'type'        => 'text',
922   },
923
924   {
925     'key'         => 'session-stop',
926     'section'     => 'session',
927     '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.',
928     'type'        => 'text',
929   },
930
931   {
932     'key'         => 'shellmachine',
933     'section'     => 'deprecated',
934     '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.',
935     'type'        => 'text',
936   },
937
938   {
939     'key'         => 'shellmachine-useradd',
940     'section'     => 'deprecated',
941     '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>.',
942     'type'        => [qw( checkbox text )],
943   },
944
945   {
946     'key'         => 'shellmachine-userdel',
947     'section'     => 'deprecated',
948     '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>.',
949     'type'        => [qw( checkbox text )],
950   },
951
952   {
953     'key'         => 'shellmachine-usermod',
954     'section'     => 'deprecated',
955     '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>.',
956     #'type'        => [qw( checkbox text )],
957     'type'        => 'text',
958   },
959
960   {
961     'key'         => 'shellmachines',
962     'section'     => 'deprecated',
963     '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.',
964      'type'        => 'textarea',
965  },
966
967   {
968     'key'         => 'shells',
969     'section'     => 'required',
970     '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.',
971     'type'        => 'textarea',
972   },
973
974   {
975     'key'         => 'showpasswords',
976     'section'     => 'UI',
977     'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
978     'type'        => 'checkbox',
979   },
980
981   {
982     'key'         => 'signupurl',
983     'section'     => 'UI',
984     'description' => 'if you are using customer-to-customer referrals, and you enter the URL of your <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Self-Service_Installation">signup server CGI</a>, the customer view screen will display a customized link to the signup server with the appropriate customer as referral',
985     'type'        => 'text',
986   },
987
988   {
989     'key'         => 'smtpmachine',
990     'section'     => 'required',
991     'description' => 'SMTP relay for Freeside\'s outgoing mail',
992     'type'        => 'text',
993   },
994
995   {
996     'key'         => 'soadefaultttl',
997     'section'     => 'BIND',
998     'description' => 'SOA default TTL for new domains.',
999     'type'        => 'text',
1000   },
1001
1002   {
1003     'key'         => 'soaemail',
1004     'section'     => 'BIND',
1005     'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
1006     'type'        => 'text',
1007   },
1008
1009   {
1010     'key'         => 'soaexpire',
1011     'section'     => 'BIND',
1012     'description' => 'SOA expire for new domains',
1013     'type'        => 'text',
1014   },
1015
1016   {
1017     'key'         => 'soamachine',
1018     'section'     => 'BIND',
1019     'description' => 'SOA machine for new domains, with trailing `.\'',
1020     'type'        => 'text',
1021   },
1022
1023   {
1024     'key'         => 'soarefresh',
1025     'section'     => 'BIND',
1026     'description' => 'SOA refresh for new domains',
1027     'type'        => 'text',
1028   },
1029
1030   {
1031     'key'         => 'soaretry',
1032     'section'     => 'BIND',
1033     'description' => 'SOA retry for new domains',
1034     'type'        => 'text',
1035   },
1036
1037   {
1038     'key'         => 'statedefault',
1039     'section'     => 'UI',
1040     'description' => 'Default state or province (if not supplied, the default is `CA\')',
1041     'type'        => 'text',
1042   },
1043
1044   {
1045     'key'         => 'radiusprepend',
1046     'section'     => 'deprecated',
1047     '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).',
1048     'type'        => 'textarea',
1049   },
1050
1051   {
1052     'key'         => 'textradiusprepend',
1053     'section'     => 'deprecated',
1054     '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.',
1055     'type'        => 'text',
1056   },
1057
1058   {
1059     'key'         => 'unsuspendauto',
1060     'section'     => 'billing',
1061     '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',
1062     'type'        => 'checkbox',
1063   },
1064
1065   {
1066     'key'         => 'unsuspend-always_adjust_next_bill_date',
1067     'section'     => 'billing',
1068     'description' => 'Global override that causes unsuspensions to always adjust the next bill date under any circumstances.  This is now controlled on a per-package bases - probably best not to use this option unless you are a legacy installation that requires this behaviour.',
1069     'type'        => 'checkbox',
1070   },
1071
1072   {
1073     'key'         => 'usernamemin',
1074     'section'     => 'username',
1075     'description' => 'Minimum username length (default 2)',
1076     'type'        => 'text',
1077   },
1078
1079   {
1080     'key'         => 'usernamemax',
1081     'section'     => 'username',
1082     'description' => 'Maximum username length',
1083     'type'        => 'text',
1084   },
1085
1086   {
1087     'key'         => 'username-ampersand',
1088     'section'     => 'username',
1089     '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.',
1090     'type'        => 'checkbox',
1091   },
1092
1093   {
1094     'key'         => 'username-letter',
1095     'section'     => 'username',
1096     'description' => 'Usernames must contain at least one letter',
1097     'type'        => 'checkbox',
1098   },
1099
1100   {
1101     'key'         => 'username-letterfirst',
1102     'section'     => 'username',
1103     'description' => 'Usernames must start with a letter',
1104     'type'        => 'checkbox',
1105   },
1106
1107   {
1108     'key'         => 'username-noperiod',
1109     'section'     => 'username',
1110     'description' => 'Disallow periods in usernames',
1111     'type'        => 'checkbox',
1112   },
1113
1114   {
1115     'key'         => 'username-nounderscore',
1116     'section'     => 'username',
1117     'description' => 'Disallow underscores in usernames',
1118     'type'        => 'checkbox',
1119   },
1120
1121   {
1122     'key'         => 'username-nodash',
1123     'section'     => 'username',
1124     'description' => 'Disallow dashes in usernames',
1125     'type'        => 'checkbox',
1126   },
1127
1128   {
1129     'key'         => 'username-uppercase',
1130     'section'     => 'username',
1131     'description' => 'Allow uppercase characters in usernames.  Not recommended for use with FreeRADIUS with MySQL backend, which is case-insensitive by default.',
1132     'type'        => 'checkbox',
1133   },
1134
1135   { 
1136     'key'         => 'username-percent',
1137     'section'     => 'username',
1138     'description' => 'Allow the percent character (%) in usernames.',
1139     'type'        => 'checkbox',
1140   },
1141
1142   {
1143     'key'         => 'username_policy',
1144     'section'     => 'deprecated',
1145     '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\'',
1146     'type'        => 'select',
1147     'select_enum' => [ 'prepend domsvc', 'append domsvc', 'append domain', 'append @domain' ],
1148     #'type'        => 'text',
1149   },
1150
1151   {
1152     'key'         => 'vpopmailmachines',
1153     'section'     => 'deprecated',
1154     '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',
1155     'type'        => 'textarea',
1156   },
1157
1158   {
1159     'key'         => 'vpopmailrestart',
1160     'section'     => 'deprecated',
1161     '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.',
1162     'type'        => 'textarea',
1163   },
1164
1165   {
1166     'key'         => 'safe-part_pkg',
1167     'section'     => 'deprecated',
1168     'description' => '<b>DEPRECATED</b>, obsolete.  Used to validate package definition setup and recur expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
1169     'type'        => 'checkbox',
1170   },
1171
1172   {
1173     'key'         => 'safe-part_bill_event',
1174     'section'     => 'UI',
1175     'description' => 'Validates invoice event expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
1176     'type'        => 'checkbox',
1177   },
1178
1179   {
1180     'key'         => 'show_ss',
1181     'section'     => 'UI',
1182     'description' => 'Turns on display/collection of SS# in the web interface.',
1183     'type'        => 'checkbox',
1184   },
1185
1186   { 
1187     'key'         => 'show_stateid',
1188     'section'     => 'UI',
1189     'description' => "Turns on display/collection of driver's license/state issued id numbers in the web interface.  Sometimes required by electronic check (ACH) processors.",
1190     'type'        => 'checkbox',
1191   },
1192
1193   {
1194     'key'         => 'show_bankstate',
1195     'section'     => 'UI',
1196     'description' => "Turns on display/collection of state for bank accounts in the web interface.  Sometimes required by electronic check (ACH) processors.",
1197     'type'        => 'checkbox',
1198   },
1199
1200   { 
1201     'key'         => 'agent_defaultpkg',
1202     'section'     => 'UI',
1203     'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
1204     'type'        => 'checkbox',
1205   },
1206
1207   {
1208     'key'         => 'legacy_link',
1209     'section'     => 'UI',
1210     'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
1211     'type'        => 'checkbox',
1212   },
1213
1214   {
1215     'key'         => 'legacy_link-steal',
1216     'section'     => 'UI',
1217     'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
1218     'type'        => 'checkbox',
1219   },
1220
1221   {
1222     'key'         => 'queue_dangerous_controls',
1223     'section'     => 'UI',
1224     '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.',
1225     'type'        => 'checkbox',
1226   },
1227
1228   {
1229     'key'         => 'security_phrase',
1230     'section'     => 'password',
1231     'description' => 'Enable the tracking of a "security phrase" with each account.  Not recommended, as it is vulnerable to social engineering.',
1232     'type'        => 'checkbox',
1233   },
1234
1235   {
1236     'key'         => 'locale',
1237     'section'     => 'UI',
1238     'description' => 'Message locale',
1239     'type'        => 'select',
1240     'select_enum' => [ qw(en_US) ],
1241   },
1242
1243   {
1244     'key'         => 'selfservice_server-quiet',
1245     'section'     => 'deprecated',
1246     '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.',
1247     'type'        => 'checkbox',
1248   },
1249
1250   {
1251     'key'         => 'signup_server-quiet',
1252     'section'     => 'deprecated',
1253     '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.',
1254     'type'        => 'checkbox',
1255   },
1256
1257   {
1258     'key'         => 'signup_server-payby',
1259     'section'     => '',
1260     'description' => 'Acceptable payment types for the signup server',
1261     'type'        => 'selectmultiple',
1262     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
1263   },
1264
1265   {
1266     'key'         => 'signup_server-email',
1267     'section'     => 'deprecated',
1268     '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.',
1269     'type'        => 'text',
1270   },
1271
1272   {
1273     'key'         => 'signup_server-default_agentnum',
1274     'section'     => '',
1275     'description' => 'Default agent for the signup server',
1276     'type'        => 'select-sub',
1277     'options_sub' => sub { require FS::Record;
1278                            require FS::agent;
1279                            map { $_->agentnum => $_->agent }
1280                                FS::Record::qsearch('agent', { disabled=>'' } );
1281                          },
1282     'option_sub'  => sub { require FS::Record;
1283                            require FS::agent;
1284                            my $agent = FS::Record::qsearchs(
1285                              'agent', { 'agentnum'=>shift }
1286                            );
1287                            $agent ? $agent->agent : '';
1288                          },
1289   },
1290
1291   {
1292     'key'         => 'signup_server-default_refnum',
1293     'section'     => '',
1294     'description' => 'Default advertising source for the signup server',
1295     'type'        => 'select-sub',
1296     'options_sub' => sub { require FS::Record;
1297                            require FS::part_referral;
1298                            map { $_->refnum => $_->referral }
1299                                FS::Record::qsearch( 'part_referral', 
1300                                                     { 'disabled' => '' }
1301                                                   );
1302                          },
1303     'option_sub'  => sub { require FS::Record;
1304                            require FS::part_referral;
1305                            my $part_referral = FS::Record::qsearchs(
1306                              'part_referral', { 'refnum'=>shift } );
1307                            $part_referral ? $part_referral->referral : '';
1308                          },
1309   },
1310
1311   {
1312     'key'         => 'signup_server-default_pkgpart',
1313     'section'     => '',
1314     'description' => 'Default pakcage for the signup server',
1315     'type'        => 'select-sub',
1316     'options_sub' => sub { require FS::Record;
1317                            require FS::part_pkg;
1318                            map { $_->pkgpart => $_->pkg.' - '.$_->comment }
1319                                FS::Record::qsearch( 'part_pkg',
1320                                                     { 'disabled' => ''}
1321                                                   );
1322                          },
1323     'option_sub'  => sub { require FS::Record;
1324                            require FS::part_pkg;
1325                            my $part_pkg = FS::Record::qsearchs(
1326                              'part_pkg', { 'pkgpart'=>shift }
1327                            );
1328                            $part_pkg
1329                              ? $part_pkg->pkg.' - '.$part_pkg->comment
1330                              : '';
1331                          },
1332   },
1333
1334   {
1335     'key'         => 'show-msgcat-codes',
1336     'section'     => 'UI',
1337     'description' => 'Show msgcat codes in error messages.  Turn this option on before reporting errors to the mailing list.',
1338     'type'        => 'checkbox',
1339   },
1340
1341   {
1342     'key'         => 'signup_server-realtime',
1343     'section'     => '',
1344     'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
1345     'type'        => 'checkbox',
1346   },
1347   {
1348     'key'         => 'signup_server-classnum2',
1349     'section'     => '',
1350     'description' => 'Package Class for first optional purchase',
1351     'type'        => 'select-sub',
1352     'options_sub' => sub { require FS::Record;
1353                            require FS::pkg_class;
1354                            map { $_->classnum => $_->classname }
1355                                FS::Record::qsearch('pkg_class', {} );
1356                          },
1357     'option_sub'  => sub { require FS::Record;
1358                            require FS::pkg_class;
1359                            my $pkg_class = FS::Record::qsearchs(
1360                              'pkg_class', { 'classnum'=>shift }
1361                            );
1362                            $pkg_class ? $pkg_class->classname : '';
1363                          },
1364   },
1365
1366   {
1367     'key'         => 'signup_server-classnum3',
1368     'section'     => '',
1369     'description' => 'Package Class for second optional purchase',
1370     'type'        => 'select-sub',
1371     'options_sub' => sub { require FS::Record;
1372                            require FS::pkg_class;
1373                            map { $_->classnum => $_->classname }
1374                                FS::Record::qsearch('pkg_class', {} );
1375                          },
1376     'option_sub'  => sub { require FS::Record;
1377                            require FS::pkg_class;
1378                            my $pkg_class = FS::Record::qsearchs(
1379                              'pkg_class', { 'classnum'=>shift }
1380                            );
1381                            $pkg_class ? $pkg_class->classname : '';
1382                          },
1383   },
1384
1385   {
1386     'key'         => 'backend-realtime',
1387     'section'     => '',
1388     'description' => 'Run billing for backend signups immediately.',
1389     'type'        => 'checkbox',
1390   },
1391
1392   {
1393     'key'         => 'declinetemplate',
1394     'section'     => 'billing',
1395     'description' => 'Template file for credit card decline emails.',
1396     'type'        => 'textarea',
1397   },
1398
1399   {
1400     'key'         => 'emaildecline',
1401     'section'     => 'billing',
1402     'description' => 'Enable emailing of credit card decline notices.',
1403     'type'        => 'checkbox',
1404   },
1405
1406   {
1407     'key'         => 'emaildecline-exclude',
1408     'section'     => 'billing',
1409     'description' => 'List of error messages that should not trigger email decline notices, one per line.',
1410     'type'        => 'textarea',
1411   },
1412
1413   {
1414     'key'         => 'cancelmessage',
1415     'section'     => 'billing',
1416     'description' => 'Template file for cancellation emails.',
1417     'type'        => 'textarea',
1418   },
1419
1420   {
1421     'key'         => 'cancelsubject',
1422     'section'     => 'billing',
1423     'description' => 'Subject line for cancellation emails.',
1424     'type'        => 'text',
1425   },
1426
1427   {
1428     'key'         => 'emailcancel',
1429     'section'     => 'billing',
1430     'description' => 'Enable emailing of cancellation notices.',
1431     'type'        => 'checkbox',
1432   },
1433
1434   {
1435     'key'         => 'require_cardname',
1436     'section'     => 'billing',
1437     'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
1438     'type'        => 'checkbox',
1439   },
1440
1441   {
1442     'key'         => 'enable_taxclasses',
1443     'section'     => 'billing',
1444     'description' => 'Enable per-package tax classes',
1445     'type'        => 'checkbox',
1446   },
1447
1448   {
1449     'key'         => 'require_taxclasses',
1450     'section'     => 'billing',
1451     'description' => 'Require a taxclass to be entered for every package',
1452     'type'        => 'checkbox',
1453   },
1454
1455   {
1456     'key'         => 'welcome_email',
1457     'section'     => '',
1458     '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>',
1459     'type'        => 'textarea',
1460   },
1461
1462   {
1463     'key'         => 'welcome_email-from',
1464     'section'     => '',
1465     'description' => 'From: address header for welcome email',
1466     'type'        => 'text',
1467   },
1468
1469   {
1470     'key'         => 'welcome_email-subject',
1471     'section'     => '',
1472     'description' => 'Subject: header for welcome email',
1473     'type'        => 'text',
1474   },
1475   
1476   {
1477     'key'         => 'welcome_email-mimetype',
1478     'section'     => '',
1479     'description' => 'MIME type for welcome email',
1480     'type'        => 'select',
1481     'select_enum' => [ 'text/plain', 'text/html' ],
1482   },
1483
1484   {
1485     'key'         => 'welcome_letter',
1486     'section'     => '',
1487     'description' => 'Optional LaTex template file for a printed welcome letter.  A welcome letter is printed the first time a cust_pkg record is created.  See the <a href="http://search.cpan.org/~mjd/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation and the billing documentation for details on the template substitution language.  A variable exists for each fieldname in the customer record (<code>$first, $last, etc</code>).  The following additional variables are available<ul><li><code>$payby</code> - a friendler represenation of the field<li><code>$payinfo</code> - the masked payment information<li><code>$expdate</code> - the time at which the payment method expires (a UNIX timestamp)<li><code>$returnaddress</code> - the invoice return address for this customer\'s agent</ul>',
1488     'type'        => 'textarea',
1489   },
1490
1491   {
1492     'key'         => 'warning_email',
1493     'section'     => '',
1494     'description' => 'Template file for warning email.  Warning emails are sent to the customer email invoice destination(s) each time a svc_acct record has its usage drop below a threshold or 0.  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> <li><code>$column</code> <li><code>$amount</code> <li><code>$threshold</code></ul>',
1495     'type'        => 'textarea',
1496   },
1497
1498   {
1499     'key'         => 'warning_email-from',
1500     'section'     => '',
1501     'description' => 'From: address header for warning email',
1502     'type'        => 'text',
1503   },
1504
1505   {
1506     'key'         => 'warning_email-cc',
1507     'section'     => '',
1508     'description' => 'Additional recipient(s) (comma separated) for warning email when remaining usage reaches zero.',
1509     'type'        => 'text',
1510   },
1511
1512   {
1513     'key'         => 'warning_email-subject',
1514     'section'     => '',
1515     'description' => 'Subject: header for warning email',
1516     'type'        => 'text',
1517   },
1518   
1519   {
1520     'key'         => 'warning_email-mimetype',
1521     'section'     => '',
1522     'description' => 'MIME type for warning email',
1523     'type'        => 'select',
1524     'select_enum' => [ 'text/plain', 'text/html' ],
1525   },
1526
1527   {
1528     'key'         => 'payby',
1529     'section'     => 'billing',
1530     'description' => 'Available payment types.',
1531     'type'        => 'selectmultiple',
1532     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP) ],
1533   },
1534
1535   {
1536     'key'         => 'payby-default',
1537     'section'     => 'UI',
1538     'description' => 'Default payment type.  HIDE disables display of billing information and sets customers to BILL.',
1539     'type'        => 'select',
1540     'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP HIDE) ],
1541   },
1542
1543   {
1544     'key'         => 'paymentforcedtobatch',
1545     'section'     => 'UI',
1546     'description' => 'Causes per customer payment entry to be forced to a batch processor rather than performed realtime.',
1547     'type'        => 'checkbox',
1548   },
1549
1550   {
1551     'key'         => 'svc_acct-notes',
1552     'section'     => 'UI',
1553     'description' => 'Extra HTML to be displayed on the Account View screen.',
1554     'type'        => 'textarea',
1555   },
1556
1557   {
1558     'key'         => 'radius-password',
1559     'section'     => '',
1560     'description' => 'RADIUS attribute for plain-text passwords.',
1561     'type'        => 'select',
1562     'select_enum' => [ 'Password', 'User-Password' ],
1563   },
1564
1565   {
1566     'key'         => 'radius-ip',
1567     'section'     => '',
1568     'description' => 'RADIUS attribute for IP addresses.',
1569     'type'        => 'select',
1570     'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
1571   },
1572
1573   {
1574     'key'         => 'svc_acct-alldomains',
1575     'section'     => '',
1576     '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.',
1577     'type'        => 'checkbox',
1578   },
1579
1580   {
1581     'key'         => 'dump-scpdest',
1582     'section'     => '',
1583     'description' => 'destination for scp database dumps: user@host:/path',
1584     'type'        => 'text',
1585   },
1586
1587   {
1588     'key'         => 'dump-pgpid',
1589     'section'     => '',
1590     '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.",
1591     'type'        => 'text',
1592   },
1593
1594   {
1595     'key'         => 'users-allow_comp',
1596     'section'     => 'deprecated',
1597     'description' => '<b>DEPRECATED</b>, enable the <i>Complimentary customer</i> access right instead.  Was: 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.',
1598     'type'        => 'textarea',
1599   },
1600
1601   {
1602     'key'         => 'cvv-save',
1603     'section'     => 'billing',
1604     '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.',
1605     'type'        => 'selectmultiple',
1606     'select_enum' => \@card_types,
1607   },
1608
1609   {
1610     'key'         => 'allow_negative_charges',
1611     'section'     => 'billing',
1612     'description' => 'Allow negative charges.  Normally not used unless importing data from a legacy system that requires this.',
1613     'type'        => 'checkbox',
1614   },
1615   {
1616       'key'         => 'auto_unset_catchall',
1617       'section'     => '',
1618       '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.',
1619       'type'        => 'checkbox',
1620   },
1621
1622   {
1623     'key'         => 'system_usernames',
1624     'section'     => 'username',
1625     '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.',
1626     'type'        => 'textarea',
1627   },
1628
1629   {
1630     'key'         => 'cust_pkg-change_svcpart',
1631     'section'     => '',
1632     'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
1633     'type'        => 'checkbox',
1634   },
1635
1636   {
1637     'key'         => 'disable_autoreverse',
1638     'section'     => 'BIND',
1639     'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
1640     'type'        => 'checkbox',
1641   },
1642
1643   {
1644     'key'         => 'svc_www-enable_subdomains',
1645     'section'     => '',
1646     'description' => 'Enable selection of specific subdomains for virtual host creation.',
1647     'type'        => 'checkbox',
1648   },
1649
1650   {
1651     'key'         => 'svc_www-usersvc_svcpart',
1652     'section'     => '',
1653     'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
1654     'type'        => 'textarea',
1655   },
1656
1657   {
1658     'key'         => 'selfservice_server-primary_only',
1659     'section'     => '',
1660     'description' => 'Only allow primary accounts to access self-service functionality.',
1661     'type'        => 'checkbox',
1662   },
1663
1664   {
1665     'key'         => 'card_refund-days',
1666     'section'     => 'billing',
1667     'description' => 'After a payment, the number of days a refund link will be available for that payment.  Defaults to 120.',
1668     'type'        => 'text',
1669   },
1670
1671   {
1672     'key'         => 'agent-showpasswords',
1673     'section'     => '',
1674     'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
1675     'type'        => 'checkbox',
1676   },
1677
1678   {
1679     'key'         => 'global_unique-username',
1680     'section'     => 'username',
1681     '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).  disabled turns off duplicate checking completely and is STRONGLY NOT RECOMMENDED unless you REALLY need to turn this off.',
1682     'type'        => 'select',
1683     'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
1684   },
1685
1686   {
1687     'key'         => 'svc_external-skip_manual',
1688     'section'     => 'UI',
1689     '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).',
1690     'type'        => 'checkbox',
1691   },
1692
1693   {
1694     'key'         => 'svc_external-display_type',
1695     'section'     => 'UI',
1696     'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
1697     'type'        => 'select',
1698     'select_enum' => [ 'generic', 'artera_turbo', ],
1699   },
1700
1701   {
1702     'key'         => 'ticket_system',
1703     'section'     => '',
1704     'description' => 'Ticketing system integration.  <b>RT_Internal</b> uses the built-in RT ticketing system (see the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:RT_Installation">integrated ticketing installation instructions</a>).   <b>RT_External</b> accesses an external RT installation in a separate database (local or remote).',
1705     'type'        => 'select',
1706     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
1707     'select_enum' => [ '', qw(RT_Internal RT_External) ],
1708   },
1709
1710   {
1711     'key'         => 'ticket_system-default_queueid',
1712     'section'     => '',
1713     'description' => 'Default queue used when creating new customer tickets.',
1714     'type'        => 'select-sub',
1715     'options_sub' => sub {
1716                            my $conf = new FS::Conf;
1717                            if ( $conf->config('ticket_system') ) {
1718                              eval "use FS::TicketSystem;";
1719                              die $@ if $@;
1720                              FS::TicketSystem->queues();
1721                            } else {
1722                              ();
1723                            }
1724                          },
1725     'option_sub'  => sub { 
1726                            my $conf = new FS::Conf;
1727                            if ( $conf->config('ticket_system') ) {
1728                              eval "use FS::TicketSystem;";
1729                              die $@ if $@;
1730                              FS::TicketSystem->queue(shift);
1731                            } else {
1732                              '';
1733                            }
1734                          },
1735   },
1736
1737   {
1738     'key'         => 'ticket_system-custom_priority_field',
1739     'section'     => '',
1740     'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
1741     'type'        => 'text',
1742   },
1743
1744   {
1745     'key'         => 'ticket_system-custom_priority_field-values',
1746     'section'     => '',
1747     'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
1748     'type'        => 'textarea',
1749   },
1750
1751   {
1752     'key'         => 'ticket_system-custom_priority_field_queue',
1753     'section'     => '',
1754     'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
1755     'type'        => 'text',
1756   },
1757
1758   {
1759     'key'         => 'ticket_system-rt_external_datasrc',
1760     'section'     => '',
1761     'description' => 'With external RT integration, the DBI data source for the external RT installation, for example, <code>DBI:Pg:user=rt_user;password=rt_word;host=rt.example.com;dbname=rt</code>',
1762     'type'        => 'text',
1763
1764   },
1765
1766   {
1767     'key'         => 'ticket_system-rt_external_url',
1768     'section'     => '',
1769     'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
1770     'type'        => 'text',
1771   },
1772
1773   {
1774     'key'         => 'company_name',
1775     'section'     => 'required',
1776     'description' => 'Your company name',
1777     'type'        => 'text',
1778   },
1779
1780   {
1781     'key'         => 'echeck-void',
1782     'section'     => 'deprecated',
1783     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable local-only voiding of echeck payments in addition to refunds against the payment gateway',
1784     'type'        => 'checkbox',
1785   },
1786
1787   {
1788     'key'         => 'cc-void',
1789     'section'     => 'deprecated',
1790     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable local-only voiding of credit card payments in addition to refunds against the payment gateway',
1791     'type'        => 'checkbox',
1792   },
1793
1794   {
1795     'key'         => 'unvoid',
1796     'section'     => 'deprecated',
1797     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable unvoiding of voided payments',
1798     'type'        => 'checkbox',
1799   },
1800
1801   {
1802     'key'         => 'address2-search',
1803     'section'     => 'UI',
1804     'description' => 'Enable a "Unit" search box which searches the second address field',
1805     'type'        => 'checkbox',
1806   },
1807
1808   { 'key'         => 'referral_credit',
1809     'section'     => 'billing',
1810     'description' => "Enables one-time referral credits in the amount of one month <i>referred</i> customer's recurring fee (irregardless of frequency).",
1811     'type'        => 'checkbox',
1812   },
1813
1814   { 'key'         => 'selfservice_server-cache_module',
1815     'section'     => '',
1816     '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.',
1817     'type'        => 'select',
1818     'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
1819   },
1820
1821   {
1822     'key'         => 'hylafax',
1823     'section'     => '',
1824     '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).',
1825     'type'        => [qw( checkbox textarea )],
1826   },
1827
1828   {
1829     'key'         => 'svc_acct-usage_suspend',
1830     'section'     => 'billing',
1831     'description' => 'Suspends the package an account belongs to when svc_acct.seconds or a bytecount is decremented to 0 or below (accounts with an empty seconds and up|down|totalbytes value are ignored).  Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd.',
1832     'type'        => 'checkbox',
1833   },
1834
1835   {
1836     'key'         => 'svc_acct-usage_unsuspend',
1837     'section'     => 'billing',
1838     'description' => 'Unuspends the package an account belongs to when svc_acct.seconds or a bytecount is incremented from 0 or below to a positive value (accounts with an empty seconds and up|down|totalbytes value are ignored).  Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd.',
1839     'type'        => 'checkbox',
1840   },
1841
1842   {
1843     'key'         => 'svc_acct-usage_threshold',
1844     'section'     => 'billing',
1845     'description' => 'The threshold (expressed as percentage) of acct.seconds or acct.up|down|totalbytes at which a warning message is sent to a service holder.  Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd.  Defaults to 80.',
1846     'type'        => 'text',
1847   },
1848
1849   {
1850     'key'         => 'cust-fields',
1851     'section'     => 'UI',
1852     'description' => 'Which customer fields to display on reports by default',
1853     'type'        => 'select',
1854     'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
1855   },
1856
1857   {
1858     'key'         => 'cust_pkg-display_times',
1859     'section'     => 'UI',
1860     'description' => 'Display full timestamps (not just dates) for customer packages.  Useful if you are doing real-time things like hourly prepaid.',
1861     'type'        => 'checkbox',
1862   },
1863
1864   {
1865     'key'         => 'svc_acct-edit_uid',
1866     'section'     => 'shell',
1867     'description' => 'Allow UID editing.',
1868     'type'        => 'checkbox',
1869   },
1870
1871   {
1872     'key'         => 'svc_acct-edit_gid',
1873     'section'     => 'shell',
1874     'description' => 'Allow GID editing.',
1875     'type'        => 'checkbox',
1876   },
1877
1878   {
1879     'key'         => 'zone-underscore',
1880     'section'     => 'BIND',
1881     'description' => 'Allow underscores in zone names.  As underscores are illegal characters in zone names, this option is not recommended.',
1882     'type'        => 'checkbox',
1883   },
1884
1885   #these should become per-user...
1886   {
1887     'key'         => 'vonage-username',
1888     'section'     => '',
1889     'description' => 'Vonage Click2Call username (see <a href="https://secure.click2callu.com/">https://secure.click2callu.com/</a>)',
1890     'type'        => 'text',
1891   },
1892   {
1893     'key'         => 'vonage-password',
1894     'section'     => '',
1895     'description' => 'Vonage Click2Call username (see <a href="https://secure.click2callu.com/">https://secure.click2callu.com/</a>)',
1896     'type'        => 'text',
1897   },
1898   {
1899     'key'         => 'vonage-fromnumber',
1900     'section'     => '',
1901     'description' => 'Vonage Click2Call number (see <a href="https://secure.click2callu.com/">https://secure.click2callu.com/</a>)',
1902     'type'        => 'text',
1903   },
1904
1905   {
1906     'key'         => 'echeck-nonus',
1907     'section'     => 'billing',
1908     'description' => 'Disable ABA-format account checking for Electronic Check payment info',
1909     'type'        => 'checkbox',
1910   },
1911
1912   {
1913     'key'         => 'voip-cust_cdr_spools',
1914     'section'     => '',
1915     'description' => 'Enable the per-customer option for individual CDR spools.',
1916     'type'        => 'checkbox',
1917   },
1918
1919   {
1920     'key'         => 'svc_forward-arbitrary_dst',
1921     'section'     => '',
1922     'description' => "Allow forwards to point to arbitrary strings that don't necessarily look like email addresses.  Only used when using forwards for weird, non-email things.",
1923     'type'        => 'checkbox',
1924   },
1925
1926   {
1927     'key'         => 'tax-ship_address',
1928     'section'     => 'billing',
1929     'description' => 'By default, tax calculations are done based on the billing address.  Enable this switch to calculate tax based on the shipping address instead.  Note: Tax reports can take a long time when enabled.',
1930     'type'        => 'checkbox',
1931   },
1932
1933   {
1934     'key'         => 'batch-enable',
1935     'section'     => 'billing',
1936     'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
1937     'type'        => 'checkbox',
1938   },
1939
1940   {
1941     'key'         => 'batch-default_format',
1942     'section'     => 'billing',
1943     'description' => 'Default format for batches.',
1944     'type'        => 'select',
1945     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch',
1946                        'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
1947                        'ach-spiritone',
1948                     ]
1949   },
1950
1951   {
1952     'key'         => 'batch-fixed_format-CARD',
1953     'section'     => 'billing',
1954     'description' => 'Fixed (unchangeable) format for credit card batches.',
1955     'type'        => 'select',
1956     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
1957                        'csv-chase_canada-E-xactBatch', 'BoM', 'PAP' ]
1958   },
1959
1960   {
1961     'key'         => 'batch-fixed_format-CHEK',
1962     'section'     => 'billing',
1963     'description' => 'Fixed (unchangeable) format for electronic check batches.',
1964     'type'        => 'select',
1965     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP',
1966                        'ach-spiritone',
1967                      ]
1968   },
1969
1970   {
1971     'key'         => 'batch-increment_expiration',
1972     'section'     => 'billing',
1973     'description' => 'Increment expiration date years in batches until cards are current.  Make sure this is acceptable to your batching provider before enabling.',
1974     'type'        => 'checkbox'
1975   },
1976
1977   {
1978     'key'         => 'batchconfig-BoM',
1979     'section'     => 'billing',
1980     'description' => 'Configuration for Bank of Montreal batching, seven lines: 1. Origin ID, 2. Datacenter, 3. Typecode, 4. Short name, 5. Long name, 6. Bank, 7. Bank account',
1981     'type'        => 'textarea',
1982   },
1983
1984   {
1985     'key'         => 'batchconfig-PAP',
1986     'section'     => 'billing',
1987     'description' => 'Configuration for PAP batching, seven lines: 1. Origin ID, 2. Datacenter, 3. Typecode, 4. Short name, 5. Long name, 6. Bank, 7. Bank account',
1988     'type'        => 'textarea',
1989   },
1990
1991   {
1992     'key'         => 'batchconfig-csv-chase_canada-E-xactBatch',
1993     'section'     => 'billing',
1994     'description' => 'Gateway ID for Chase Canada E-xact batching',
1995     'type'        => 'text',
1996   },
1997
1998   {
1999     'key'         => 'payment_history-years',
2000     'section'     => 'UI',
2001     'description' => 'Number of years of payment history to show by default.  Currently defaults to 2.',
2002     'type'        => 'text',
2003   },
2004
2005   {
2006     'key'         => 'cust_main-use_comments',
2007     'section'     => 'UI',
2008     'description' => 'Display free form comments on the customer edit screen.  Useful as a scratch pad.',
2009     'type'        => 'checkbox',
2010   },
2011
2012   {
2013     'key'         => 'cust_main-disable_notes',
2014     'section'     => 'UI',
2015     'description' => 'Disable new style customer notes - timestamped and user identified customer notes.  Useful in tracking who did what.',
2016     'type'        => 'checkbox',
2017   },
2018
2019   {
2020     'key'         => 'cust_main_note-display_times',
2021     'section'     => 'UI',
2022     'description' => 'Display full timestamps (not just dates) for customer notes.',
2023     'type'        => 'checkbox',
2024   },
2025
2026   {
2027     'key'         => 'cust_main-ticket_statuses',
2028     'section'     => 'UI',
2029     'description' => 'Show tickets with these statuses on the customer view page.',
2030     'type'        => 'selectmultiple',
2031     'select_enum' => [qw( new open stalled resolved rejected deleted )],
2032   },
2033
2034   {
2035     'key'         => 'cust_main-max_tickets',
2036     'section'     => 'UI',
2037     'description' => 'Maximum number of tickets to show on the customer view page.',
2038     'type'        => 'text',
2039   },
2040
2041   {
2042     'key'         => 'cust_main-skeleton_tables',
2043     'section'     => '',
2044     'description' => 'Tables which will have skeleton records inserted into them for each customer.  Syntax for specifying tables is unfortunately a tricky perl data structure for now.',
2045     'type'        => 'textarea',
2046   },
2047
2048   {
2049     'key'         => 'cust_main-skeleton_custnum',
2050     'section'     => '',
2051     'description' => 'Customer number specifying the source data to copy into skeleton tables for new customers.',
2052     'type'        => 'text',
2053   },
2054
2055   {
2056     'key'         => 'cust_main-enable_birthdate',
2057     'section'     => 'UI',
2058     'descritpion' => 'Enable tracking of a birth date with each customer record',
2059     'type'        => 'checkbox',
2060   },
2061
2062   {
2063     'key'         => 'support-key',
2064     'section'     => '',
2065     'description' => 'A support key enables access to commercial services delivered over the network, such as the payroll module, access to the internal ticket system, priority support and optional backups.',
2066     'type'        => 'text',
2067   },
2068
2069   {
2070     'key'         => 'card-types',
2071     'section'     => 'billing',
2072     'description' => 'Select one or more card types to enable only those card types.  If no card types are selected, all card types are available.',
2073     'type'        => 'selectmultiple',
2074     'select_enum' => \@card_types,
2075   },
2076
2077   {
2078     'key'         => 'dashboard-toplist',
2079     'section'     => 'UI',
2080     'description' => 'List of items to display on the top of the front page',
2081     'type'        => 'textarea',
2082   },
2083
2084   {
2085     'key'         => 'impending_recur_template',
2086     'section'     => 'billing',
2087     'description' => 'Template file for alerts about looming first time recurrant billing.  See the <a href="http://search.cpan.org/~mjd/Text-Template.pm">Text::Template</a> documentation for details on the template substitition language.  Also see packages with a <a href="../browse/part_pkg.cgi">flat price plan</a>  The following variables are available<ul><li><code>$packages</code> allowing <code>$packages->[0]</code> thru <code>$packages->[n]</code> <li><code>$package</code> the first package, same as <code>$packages->[0]</code> <li><code>$recurdates</code> allowing <code>$recurdates->[0]</code> thru <code>$recurdates->[n]</code> <li><code>$recurdate</code> the first recurdate, same as <code>$recurdate->[0]</code> <li><code>$first</code> <li><code>$last</code></ul>',
2088 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
2089     'type'        => 'textarea',
2090   },
2091
2092   {
2093     'key'         => 'disable_setup_suspended_pkgs',
2094     'section'     => 'billing',
2095     'description' => 'Disables charging of setup fees for suspended packages.',
2096     'type'       => 'checkbox',
2097   },
2098
2099   {
2100     'key' => 'password-generated-allcaps',
2101     'section' => 'password',
2102     'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
2103     'type' => 'checkbox',
2104   },
2105
2106   {
2107     'key'         => 'datavolume-forcemegabytes',
2108     'section'     => 'UI',
2109     'description' => 'All data volumes are expressed in megabytes',
2110     'type'        => 'checkbox',
2111   },
2112
2113   {
2114     'key'         => 'datavolume-significantdigits',
2115     'section'     => 'UI',
2116     'description' => 'number of significant digits to use to represent data volumes',
2117     'type'        => 'text',
2118   },
2119
2120   {
2121     'key'         => 'disable_void_after',
2122     'section'     => 'billing',
2123     'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
2124     'type'        => 'text',
2125   },
2126
2127   {
2128     'key'         => 'disable_line_item_date_ranges',
2129     'section'     => 'billing',
2130     'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
2131     'type'        => 'checkbox',
2132   },
2133
2134   
2135
2136   {
2137     'key'         => 'cust_main-require_phone',
2138     'section'     => '',
2139     'description' => 'Require daytime or night for all customer records.',
2140     'type'        => 'checkbox',
2141   },
2142
2143   {
2144     'key'         => 'cust_main-require_invoicing_list_email',
2145     'section'     => '',
2146     'description' => 'Require at least one invoicing email address for all customer records.',
2147     'type'        => 'checkbox',
2148   },
2149
2150 );
2151
2152 1;
2153