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