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