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