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