1 package FS::Conf_compat17;
3 use vars qw($default_dir $base_dir @config_items @card_types $DEBUG );
9 $base_dir = '%%%FREESIDE_CONF%%%';
10 $default_dir = '%%%FREESIDE_CONF%%%';
17 FS::Conf - Freeside configuration values
23 $conf = new FS::Conf "/config/directory";
25 $FS::Conf::default_dir = "/config/directory";
30 $value = $conf->config('key');
31 @list = $conf->config('key');
32 $bool = $conf->exists('key');
35 $conf->set('key' => 'value');
38 @config_items = $conf->config_items;
42 Read and write Freeside configuration values. Keys currently map to filenames,
43 but this may change in the future.
49 =item new [ DIRECTORY ]
51 Create a new configuration object. A directory arguement is required if
52 $FS::Conf::default_dir has not been set.
58 my($class) = ref($proto) || $proto;
59 my($self) = { 'dir' => $dir || $default_dir,
60 'base_dir' => $base_dir,
62 bless ($self, $class);
67 Returns the conf directory.
73 my $dir = $self->{dir};
74 -e $dir or die "FATAL: $dir doesn't exist!";
75 -d $dir or die "FATAL: $dir isn't a directory!";
76 -r $dir or die "FATAL: Can't read $dir!";
77 -x $dir or die "FATAL: $dir not searchable (executable)!";
84 Returns the base directory. By default this is /usr/local/etc/freeside.
90 my $base_dir = $self->{base_dir};
91 -e $base_dir or die "FATAL: $base_dir doesn't exist!";
92 -d $base_dir or die "FATAL: $base_dir isn't a directory!";
93 -r $base_dir or die "FATAL: Can't read $base_dir!";
94 -x $base_dir or die "FATAL: $base_dir not searchable (executable)!";
95 $base_dir =~ /^(.*)$/;
101 Returns the configuration value or values (depending on context) for key.
108 my $fh = new IO::File "<$dir/$file" or return;
112 or die "Illegal line (array context) in $dir/$file:\n$_\n";
117 or die "Illegal line (scalar context) in $dir/$file:\n$_\n";
122 =item config_binary KEY
124 Returns the exact scalar value for key.
131 my $fh = new IO::File "<$dir/$file" or return;
139 Returns true if the specified key exists, even if the corresponding value
146 my($dir) = $self->dir;
150 =item config_orbase KEY SUFFIX
152 Returns the configuration value or values (depending on context) for
153 KEY_SUFFIX, if it exists, otherwise for KEY
158 my( $self, $file, $suffix ) = @_;
159 if ( $self->exists("${file}_$suffix") ) {
160 $self->config("${file}_$suffix");
162 $self->config($file);
168 Creates the specified configuration key if it does not exist.
173 my($self, $file) = @_;
174 my $dir = $self->dir;
175 unless ( $self->exists($file) ) {
176 warn "[FS::Conf] TOUCH $file\n" if $DEBUG;
177 system('touch', "$dir/$file");
183 Sets the specified configuration key to the given value.
188 my($self, $file, $value) = @_;
189 my $dir = $self->dir;
192 unless ( join("\n", @{[ $self->config($file) ]}) eq $value ) {
193 warn "[FS::Conf] SET $file\n" if $DEBUG;
194 # warn "$dir" if is_tainted($dir);
195 # warn "$dir" if is_tainted($file);
196 chmod 0644, "$dir/$file";
197 my $fh = new IO::File ">$dir/$file" or return;
198 chmod 0644, "$dir/$file";
199 print $fh "$value\n";
203 # return ! eval { join('',@_), kill 0; 1; };
208 Deletes the specified configuration key.
213 my($self, $file) = @_;
214 my $dir = $self->dir;
215 if ( $self->exists($file) ) {
216 warn "[FS::Conf] DELETE $file\n";
223 Returns all of the possible configuration items as FS::ConfItem objects. See
233 my $basename = basename($_);
234 $basename =~ /^(.*)$/;
238 'section' => 'billing',
239 'description' => 'Alternate template file for invoices. See the <a href="../docs/billing.html">billing documentation</a> for details.',
240 'type' => 'textarea',
242 } glob($self->dir. '/invoice_template_*')
245 my $basename = basename($_);
246 $basename =~ /^(.*)$/;
250 'section' => 'billing',
251 'description' => 'Alternate HTML template for invoices. See the <a href="../docs/billing.html">billing documentation</a> for details.',
252 'type' => 'textarea',
254 } glob($self->dir. '/invoice_html_*')
257 my $basename = basename($_);
258 $basename =~ /^(.*)$/;
260 ($latexname = $basename ) =~ s/latex/html/;
263 'section' => 'billing',
264 'description' => "Alternate Notes section for HTML invoices. Defaults to the same data in $latexname if not specified.",
265 'type' => 'textarea',
267 } glob($self->dir. '/invoice_htmlnotes_*')
270 my $basename = basename($_);
271 $basename =~ /^(.*)$/;
275 'section' => 'billing',
276 'description' => 'Alternate LaTeX template for invoices. See the <a href="../docs/billing.html">billing documentation</a> for details.',
277 'type' => 'textarea',
279 } glob($self->dir. '/invoice_latex_*')
282 my $basename = basename($_);
283 $basename =~ /^(.*)$/;
287 'section' => 'billing',
288 'description' => 'Alternate Notes section for LaTeX typeset PostScript invoices. See the <a href="../docs/billing.html">billing documentation</a> for details.',
289 'type' => 'textarea',
291 } glob($self->dir. '/invoice_latexnotes_*')
299 If this was more than just crud that will never be useful outside Freeside I'd
300 worry that config_items is freeside-specific and icky.
304 "Configuration" in the web interface (config/config.cgi).
306 httemplate/docs/config.html
310 #Business::CreditCard
315 "American Express card",
316 "Diner's Club/Carte Blanche",
324 @config_items = map { new FS::ConfItem $_ } (
328 'section' => 'deprecated',
329 'description' => 'This configuration option is no longer used. See <a href="#invoice_template">invoice_template</a> instead.',
334 'key' => 'alerter_template',
335 'section' => 'billing',
336 'description' => 'Template file for billing method expiration alerts. See the <a href="../docs/billing.html#invoice_template">billing documentation</a> for details.',
337 'type' => 'textarea',
341 'key' => 'apacheroot',
342 'section' => 'deprecated',
343 'description' => '<b>DEPRECATED</b>, add a <i>www_shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead. The directory containing Apache virtual hosts',
349 'section' => 'deprecated',
350 'description' => '<b>DEPRECATED</b>, add an <i>apache</i> <a href="../browse/part_export.cgi">export</a> instead. Used to be the current IP address to assign to new virtual hosts',
355 'key' => 'apachemachine',
356 'section' => 'deprecated',
357 'description' => '<b>DEPRECATED</b>, add a <i>www_shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead. A machine with the apacheroot directory and user home directories. The existance of this file enables setup of virtual host directories, and, in conjunction with the `home\' configuration file, symlinks into user home directories.',
362 'key' => 'apachemachines',
363 'section' => 'deprecated',
364 'description' => '<b>DEPRECATED</b>, add an <i>apache</i> <a href="../browse/part_export.cgi">export</a> instead. Used to be Apache machines, one per line. This enables export of `/etc/apache/vhosts.conf\', which can be included in your Apache configuration via the <a href="http://www.apache.org/docs/mod/core.html#include">Include</a> directive.',
365 'type' => 'textarea',
369 'key' => 'bindprimary',
370 'section' => 'deprecated',
371 'description' => '<b>DEPRECATED</b>, add a <i>bind</i> <a href="../browse/part_export.cgi">export</a> instead. Your BIND primary nameserver. This enables export of /var/named/named.conf and zone files into /var/named',
376 'key' => 'bindsecondaries',
377 'section' => 'deprecated',
378 'description' => '<b>DEPRECATED</b>, add a <i>bind_slave</i> <a href="../browse/part_export.cgi">export</a> instead. Your BIND secondary nameservers, one per line. This enables export of /var/named/named.conf',
379 'type' => 'textarea',
383 'key' => 'encryption',
384 'section' => 'billing',
385 'description' => 'Enable encryption of credit cards.',
386 'type' => 'checkbox',
390 'key' => 'encryptionmodule',
391 'section' => 'billing',
392 'description' => 'Use which module for encryption?',
397 'key' => 'encryptionpublickey',
398 'section' => 'billing',
399 'description' => 'Your RSA Public Key - Required if Encryption is turned on.',
400 'type' => 'textarea',
404 'key' => 'encryptionprivatekey',
405 'section' => 'billing',
406 'description' => 'Your RSA Private Key - Including this will enable the "Bill Now" feature. However if the system is compromised, a hacker can use this key to decode the stored credit card information. This is generally not a good idea.',
407 'type' => 'textarea',
411 'key' => 'business-onlinepayment',
412 'section' => 'billing',
413 'description' => '<a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> support, at least three lines: processor, login, and password. An optional fourth line specifies the action or actions (multiple actions are separated with `,\': for example: `Authorization Only, Post Authorization\'). Optional additional lines are passed to Business::OnlinePayment as %processor_options.',
414 'type' => 'textarea',
418 'key' => 'business-onlinepayment-ach',
419 'section' => 'billing',
420 'description' => 'Alternate <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> support for ACH transactions (defaults to regular <b>business-onlinepayment</b>). At least three lines: processor, login, and password. An optional fourth line specifies the action or actions (multiple actions are separated with `,\': for example: `Authorization Only, Post Authorization\'). Optional additional lines are passed to Business::OnlinePayment as %processor_options.',
421 'type' => 'textarea',
425 'key' => 'business-onlinepayment-description',
426 'section' => 'billing',
427 'description' => 'String passed as the description field to <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a>. Evaluated as a double-quoted perl string, with the following variables available: <code>$agent</code> (the agent name), and <code>$pkgs</code> (a comma-separated list of packages for which these charges apply)',
432 'key' => 'business-onlinepayment-email-override',
433 'section' => 'billing',
434 'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
439 'key' => 'bsdshellmachines',
440 'section' => 'deprecated',
441 'description' => '<b>DEPRECATED</b>, add a <i>bsdshell</i> <a href="../browse/part_export.cgi">export</a> instead. Your BSD flavored shell (and mail) machines, one per line. This enables export of `/etc/passwd\' and `/etc/master.passwd\'.',
442 'type' => 'textarea',
446 'key' => 'business-onlinepayment-email_customer',
447 'section' => 'billing',
448 'description' => 'Controls the "email_customer" flag used by some Business::OnlinePayment processors to enable customer receipts.',
449 'type' => 'checkbox',
453 'key' => 'countrydefault',
455 'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
460 'key' => 'date_format',
462 'description' => 'Format for displaying dates',
465 '%m/%d/%Y' => 'MM/DD/YYYY',
466 '%Y/%m/%d' => 'YYYY/MM/DD',
472 'section' => 'deprecated',
473 '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.',
474 'type' => 'textarea',
479 'section' => 'deprecated',
480 '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).',
481 'type' => 'textarea',
485 'key' => 'deletecustomers',
487 'description' => 'Enable customer deletions. Be very careful! Deleting a customer will remove all traces that the 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.',
488 'type' => 'checkbox',
492 'key' => 'deleteinvoices',
494 'description' => 'Enable invoices deletions. Be very careful! Deleting an invoice will remove all traces that the invoice ever existed! Normally, you would apply a credit against the invoice instead.', #invoice voiding?
495 'type' => 'checkbox',
499 'key' => 'deletepayments',
500 'section' => 'billing',
501 '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.',
502 'type' => [qw( checkbox text )],
506 'key' => 'deletecredits',
507 'section' => 'deprecated',
508 '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.',
509 'type' => [qw( checkbox text )],
513 'key' => 'deleterefunds',
514 'section' => 'billing',
515 'description' => 'Enable deletion of unclosed refunds. Be very careful! Only delete refunds that were data-entry errors, not adjustments.',
516 'type' => 'checkbox',
520 'key' => 'unapplypayments',
521 'section' => 'deprecated',
522 'description' => '<B>DEPRECATED</B>, now controlled by ACLs. Used to enable "unapplication" of unclosed payments.',
523 'type' => 'checkbox',
527 'key' => 'unapplycredits',
528 'section' => 'deprecated',
529 'description' => '<B>DEPRECATED</B>, now controlled by ACLs. Used to nable "unapplication" of unclosed credits.',
530 'type' => 'checkbox',
535 'section' => 'shell',
536 '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 'key' => 'disable_customer_referrals',
543 'description' => 'Disable new customer-to-customer referrals in the web interface',
544 'type' => 'checkbox',
548 'key' => 'editreferrals',
550 'description' => 'Enable advertising source modification for existing customers',
551 'type' => 'checkbox',
555 'key' => 'emailinvoiceonly',
556 'section' => 'billing',
557 'description' => 'Disables postal mail invoices',
558 'type' => 'checkbox',
562 'key' => 'disablepostalinvoicedefault',
563 'section' => 'billing',
564 '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>.',
565 'type' => 'checkbox',
569 'key' => 'emailinvoiceauto',
570 'section' => 'billing',
571 'description' => 'Automatically adds new accounts to the email invoice list',
572 'type' => 'checkbox',
576 'key' => 'emailinvoiceautoalways',
577 'section' => 'billing',
578 'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses',
579 'type' => 'checkbox',
583 'key' => 'exclude_ip_addr',
585 'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
586 'type' => 'textarea',
590 'key' => 'erpcdmachines',
591 'section' => 'deprecated',
592 '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\'',
593 'type' => 'textarea',
597 'key' => 'hidecancelledpackages',
599 'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
600 'type' => 'checkbox',
604 'key' => 'hidecancelledcustomers',
606 'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
607 'type' => 'checkbox',
612 'section' => 'required',
613 'description' => 'For new users, prefixed to username to create a directory name. Should have a leading but not a trailing slash.',
618 'key' => 'icradiusmachines',
619 'section' => 'deprecated',
620 '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 radius_db radius_user passw0rd"</CODE></blockquote>',
621 'type' => [qw( checkbox textarea )],
625 'key' => 'icradius_mysqldest',
626 'section' => 'deprecated',
627 '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 'key' => 'icradius_mysqlsource',
633 'section' => 'deprecated',
634 '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 'key' => 'icradius_secrets',
640 'section' => 'deprecated',
641 '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.',
642 'type' => 'textarea',
646 'key' => 'invoice_from',
647 'section' => 'required',
648 'description' => 'Return address on email invoices',
653 'key' => 'invoice_subject',
654 'section' => 'billing',
655 'description' => 'Subject: header on email invoices. Defaults to "Invoice". The following substitutions are available: $name, $name_short, $invoice_number, and $invoice_date.',
660 'key' => 'invoice_template',
661 'section' => 'required',
662 'description' => 'Required template file for invoices. See the <a href="../docs/billing.html">billing documentation</a> for details.',
663 'type' => 'textarea',
667 'key' => 'invoice_html',
668 'section' => 'billing',
669 'description' => 'Optional HTML template for invoices. See the <a href="../docs/billing.html">billing documentation</a> for details.',
671 'type' => 'textarea',
675 'key' => 'invoice_htmlnotes',
676 'section' => 'billing',
677 'description' => 'Notes section for HTML invoices. Defaults to the same data in invoice_latexnotes if not specified.',
678 'type' => 'textarea',
682 'key' => 'invoice_htmlfooter',
683 'section' => 'billing',
684 'description' => 'Footer for HTML invoices. Defaults to the same data in invoice_latexfooter if not specified.',
685 'type' => 'textarea',
689 'key' => 'invoice_htmlreturnaddress',
690 'section' => 'billing',
691 'description' => 'Return address for HTML invoices. Defaults to the same data in invoice_latexreturnaddress if not specified.',
692 'type' => 'textarea',
696 'key' => 'invoice_latex',
697 'section' => 'billing',
698 'description' => 'Optional LaTeX template for typeset PostScript invoices. See the <a href="../docs/billing.html">billing documentation</a> for details.',
699 'type' => 'textarea',
703 'key' => 'invoice_latexnotes',
704 'section' => 'billing',
705 'description' => 'Notes section for LaTeX typeset PostScript invoices.',
706 'type' => 'textarea',
710 'key' => 'invoice_latexfooter',
711 'section' => 'billing',
712 'description' => 'Footer for LaTeX typeset PostScript invoices.',
713 'type' => 'textarea',
717 'key' => 'invoice_latexcoupon',
718 'section' => 'billing',
719 'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.',
720 'type' => 'textarea',
724 'key' => 'invoice_latexreturnaddress',
725 'section' => 'billing',
726 'description' => 'Return address for LaTeX typeset PostScript invoices.',
727 'type' => 'textarea',
731 'key' => 'invoice_latexsmallfooter',
732 'section' => 'billing',
733 'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
734 'type' => 'textarea',
738 'key' => 'invoice_email_pdf',
739 'section' => 'billing',
740 '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.',
745 'key' => 'invoice_email_pdf_note',
746 'section' => 'billing',
747 'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.',
753 'key' => 'invoice_default_terms',
754 'section' => 'billing',
755 'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
757 'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 30', 'Net 45', 'Net 60' ],
761 'key' => 'invoice_send_receipts',
762 'section' => 'deprecated',
763 'description' => '<b>DEPRECATED</b>, this used to send an invoice copy on payments and credits. See the payment_receipt_email and XXXX instead.',
764 'type' => 'checkbox',
768 'key' => 'payment_receipt_email',
769 'section' => 'billing',
770 '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>',
771 'type' => [qw( checkbox textarea )],
776 'section' => 'required',
777 'description' => 'Print command for paper invoices, for example `lpr -h\'',
782 'key' => 'maildisablecatchall',
783 'section' => 'deprecated',
784 '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.',
785 'type' => 'checkbox',
789 'key' => 'lpr-postscript_prefix',
790 'section' => 'billing',
791 'description' => 'Raw printer commands prepended to the beginning of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
796 'key' => 'lpr-postscript_suffix',
797 'section' => 'billing',
798 'description' => 'Raw printer commands added to the end of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
803 'key' => 'money_char',
805 'description' => 'Currency symbol - defaults to `$\'',
810 'key' => 'mxmachines',
811 'section' => 'deprecated',
812 'description' => 'MX entries for new domains, weight and machine, one per line, with trailing `.\'',
813 'type' => 'textarea',
817 'key' => 'nsmachines',
818 'section' => 'deprecated',
819 'description' => 'NS nameservers for new domains, one per line, with trailing `.\'',
820 'type' => 'textarea',
824 'key' => 'defaultrecords',
826 'description' => 'DNS entries to add automatically when creating a domain',
827 'type' => 'editlist',
828 'editlist_parts' => [ { type=>'text' },
829 { type=>'immutable', value=>'IN' },
831 select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS TXT)} },
832 { type=> 'text' }, ],
837 'section' => 'deprecated',
838 'description' => 'A list of tab seperated CNAME records to add automatically when creating a domain',
839 'type' => 'textarea',
843 'key' => 'cnamerecords',
844 'section' => 'deprecated',
845 'description' => 'A list of tab seperated CNAME records to add automatically when creating a domain',
846 'type' => 'textarea',
850 'key' => 'nismachines',
851 'section' => 'deprecated',
852 '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\'.',
853 'type' => 'textarea',
857 'key' => 'passwordmin',
858 'section' => 'password',
859 'description' => 'Minimum password length (default 6)',
864 'key' => 'passwordmax',
865 'section' => 'password',
866 'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
871 'key' => 'password-noampersand',
872 'section' => 'password',
873 'description' => 'Disallow ampersands in passwords',
874 'type' => 'checkbox',
878 'key' => 'password-noexclamation',
879 'section' => 'password',
880 'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
881 'type' => 'checkbox',
885 'key' => 'qmailmachines',
886 'section' => 'deprecated',
887 '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.',
888 'type' => [qw( checkbox textarea )],
892 'key' => 'radiusmachines',
893 'section' => 'deprecated',
894 '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\'.',
895 'type' => 'textarea',
899 'key' => 'referraldefault',
901 'description' => 'Default referral, specified by refnum',
906 # 'key' => 'registries',
907 # 'section' => 'required',
908 # 'description' => 'Directory which contains domain registry information. Each registry is a directory.',
912 'key' => 'report_template',
913 'section' => 'deprecated',
914 'description' => 'Deprecated template file for reports.',
915 'type' => 'textarea',
919 'key' => 'maxsearchrecordsperpage',
921 'description' => 'If set, number of search records to return per page.',
926 'key' => 'sendmailconfigpath',
927 'section' => 'deprecated',
928 '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\'.',
933 'key' => 'sendmailmachines',
934 'section' => 'deprecated',
935 '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\'.',
936 'type' => 'textarea',
940 'key' => 'sendmailrestart',
941 'section' => 'deprecated',
942 '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.',
947 'key' => 'session-start',
948 'section' => 'session',
949 '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.',
954 'key' => 'session-stop',
955 'section' => 'session',
956 '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.',
961 'key' => 'shellmachine',
962 'section' => 'deprecated',
963 '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.',
968 'key' => 'shellmachine-useradd',
969 'section' => 'deprecated',
970 '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>.',
971 'type' => [qw( checkbox text )],
975 'key' => 'shellmachine-userdel',
976 'section' => 'deprecated',
977 '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>.',
978 'type' => [qw( checkbox text )],
982 'key' => 'shellmachine-usermod',
983 'section' => 'deprecated',
984 '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 ] && 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>.',
985 #'type' => [qw( checkbox text )],
990 'key' => 'shellmachines',
991 'section' => 'deprecated',
992 '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.',
993 'type' => 'textarea',
998 'section' => 'required',
999 '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.',
1000 'type' => 'textarea',
1004 'key' => 'showpasswords',
1006 'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
1007 'type' => 'checkbox',
1011 'key' => 'signupurl',
1013 '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',
1018 'key' => 'smtpmachine',
1019 'section' => 'required',
1020 'description' => 'SMTP relay for Freeside\'s outgoing mail',
1025 'key' => 'soadefaultttl',
1026 'section' => 'BIND',
1027 'description' => 'SOA default TTL for new domains.',
1032 'key' => 'soaemail',
1033 'section' => 'BIND',
1034 'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
1039 'key' => 'soaexpire',
1040 'section' => 'BIND',
1041 'description' => 'SOA expire for new domains',
1046 'key' => 'soamachine',
1047 'section' => 'BIND',
1048 'description' => 'SOA machine for new domains, with trailing `.\'',
1053 'key' => 'soarefresh',
1054 'section' => 'BIND',
1055 'description' => 'SOA refresh for new domains',
1060 'key' => 'soaretry',
1061 'section' => 'BIND',
1062 'description' => 'SOA retry for new domains',
1067 'key' => 'statedefault',
1069 'description' => 'Default state or province (if not supplied, the default is `CA\')',
1074 'key' => 'radiusprepend',
1075 'section' => 'deprecated',
1076 '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).',
1077 'type' => 'textarea',
1081 'key' => 'textradiusprepend',
1082 'section' => 'deprecated',
1083 '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.',
1088 'key' => 'unsuspendauto',
1089 'section' => 'billing',
1090 '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',
1091 'type' => 'checkbox',
1095 'key' => 'unsuspend-always_adjust_next_bill_date',
1096 'section' => 'billing',
1097 '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.',
1098 'type' => 'checkbox',
1102 'key' => 'usernamemin',
1103 'section' => 'username',
1104 'description' => 'Minimum username length (default 2)',
1109 'key' => 'usernamemax',
1110 'section' => 'username',
1111 'description' => 'Maximum username length',
1116 'key' => 'username-ampersand',
1117 'section' => 'username',
1118 'description' => 'Allow the ampersand character (&) 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.',
1119 'type' => 'checkbox',
1123 'key' => 'username-letter',
1124 'section' => 'username',
1125 'description' => 'Usernames must contain at least one letter',
1126 'type' => 'checkbox',
1130 'key' => 'username-letterfirst',
1131 'section' => 'username',
1132 'description' => 'Usernames must start with a letter',
1133 'type' => 'checkbox',
1137 'key' => 'username-noperiod',
1138 'section' => 'username',
1139 'description' => 'Disallow periods in usernames',
1140 'type' => 'checkbox',
1144 'key' => 'username-nounderscore',
1145 'section' => 'username',
1146 'description' => 'Disallow underscores in usernames',
1147 'type' => 'checkbox',
1151 'key' => 'username-nodash',
1152 'section' => 'username',
1153 'description' => 'Disallow dashes in usernames',
1154 'type' => 'checkbox',
1158 'key' => 'username-uppercase',
1159 'section' => 'username',
1160 'description' => 'Allow uppercase characters in usernames',
1161 'type' => 'checkbox',
1165 'key' => 'username-percent',
1166 'section' => 'username',
1167 'description' => 'Allow the percent character (%) in usernames.',
1168 'type' => 'checkbox',
1172 'key' => 'username_policy',
1173 'section' => 'deprecated',
1174 '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\'',
1176 'select_enum' => [ 'prepend domsvc', 'append domsvc', 'append domain', 'append @domain' ],
1181 'key' => 'vpopmailmachines',
1182 'section' => 'deprecated',
1183 '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',
1184 'type' => 'textarea',
1188 'key' => 'vpopmailrestart',
1189 'section' => 'deprecated',
1190 '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.',
1191 'type' => 'textarea',
1195 'key' => 'safe-part_pkg',
1196 'section' => 'deprecated',
1197 'description' => '<b>DEPRECATED</b>, obsolete. Used to validate package definition setup and recur expressions against a preset list. Useful for webdemos, annoying to powerusers.',
1198 'type' => 'checkbox',
1202 'key' => 'username-colon',
1203 'section' => 'username',
1204 'description' => 'Allow the colon character (:) in usernames.',
1205 'type' => 'checkbox',
1209 'key' => 'safe-part_bill_event',
1211 'description' => 'Validates invoice event expressions against a preset list. Useful for webdemos, annoying to powerusers.',
1212 'type' => 'checkbox',
1218 'description' => 'Turns on display/collection of SS# in the web interface.',
1219 'type' => 'checkbox',
1223 'key' => 'show_stateid',
1225 'description' => "Turns on display/collection of driver's license/state issued id numbers in the web interface. Sometimes required by electronic check (ACH) processors.",
1226 'type' => 'checkbox',
1230 'key' => 'show_bankstate',
1232 'description' => "Turns on display/collection of state for bank accounts in the web interface. Sometimes required by electronic check (ACH) processors.",
1233 'type' => 'checkbox',
1237 'key' => 'agent_defaultpkg',
1239 'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
1240 'type' => 'checkbox',
1244 'key' => 'legacy_link',
1246 'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
1247 'type' => 'checkbox',
1251 'key' => 'legacy_link-steal',
1253 'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
1254 'type' => 'checkbox',
1258 'key' => 'queue_dangerous_controls',
1260 '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.',
1261 'type' => 'checkbox',
1265 'key' => 'security_phrase',
1266 'section' => 'password',
1267 'description' => 'Enable the tracking of a "security phrase" with each account. Not recommended, as it is vulnerable to social engineering.',
1268 'type' => 'checkbox',
1274 'description' => 'Message locale',
1276 'select_enum' => [ qw(en_US) ],
1280 'key' => 'selfservice_server-quiet',
1281 'section' => 'deprecated',
1282 '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.',
1283 'type' => 'checkbox',
1287 'key' => 'signup_server-quiet',
1288 'section' => 'deprecated',
1289 '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.',
1290 'type' => 'checkbox',
1294 'key' => 'signup_server-payby',
1296 'description' => 'Acceptable payment types for the signup server',
1297 'type' => 'selectmultiple',
1298 'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
1302 'key' => 'signup_server-email',
1303 'section' => 'deprecated',
1304 '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.',
1309 'key' => 'signup_server-default_agentnum',
1311 'description' => 'Default agent for the signup server',
1312 'type' => 'select-sub',
1313 'options_sub' => sub { require FS::Record;
1315 map { $_->agentnum => $_->agent }
1316 FS::Record::qsearch('agent', { disabled=>'' } );
1318 'option_sub' => sub { require FS::Record;
1320 my $agent = FS::Record::qsearchs(
1321 'agent', { 'agentnum'=>shift }
1323 $agent ? $agent->agent : '';
1328 'key' => 'signup_server-default_refnum',
1330 'description' => 'Default advertising source for the signup server',
1331 'type' => 'select-sub',
1332 'options_sub' => sub { require FS::Record;
1333 require FS::part_referral;
1334 map { $_->refnum => $_->referral }
1335 FS::Record::qsearch( 'part_referral',
1336 { 'disabled' => '' }
1339 'option_sub' => sub { require FS::Record;
1340 require FS::part_referral;
1341 my $part_referral = FS::Record::qsearchs(
1342 'part_referral', { 'refnum'=>shift } );
1343 $part_referral ? $part_referral->referral : '';
1348 'key' => 'signup_server-default_pkgpart',
1350 'description' => 'Default pakcage for the signup server',
1351 'type' => 'select-sub',
1352 'options_sub' => sub { require FS::Record;
1353 require FS::part_pkg;
1354 map { $_->pkgpart => $_->pkg.' - '.$_->comment }
1355 FS::Record::qsearch( 'part_pkg',
1359 'option_sub' => sub { require FS::Record;
1360 require FS::part_pkg;
1361 my $part_pkg = FS::Record::qsearchs(
1362 'part_pkg', { 'pkgpart'=>shift }
1365 ? $part_pkg->pkg.' - '.$part_pkg->comment
1371 'key' => 'show-msgcat-codes',
1373 'description' => 'Show msgcat codes in error messages. Turn this option on before reporting errors to the mailing list.',
1374 'type' => 'checkbox',
1378 'key' => 'signup_server-realtime',
1380 'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
1381 'type' => 'checkbox',
1384 'key' => 'signup_server-classnum2',
1386 'description' => 'Package Class for first optional purchase',
1387 'type' => 'select-sub',
1388 'options_sub' => sub { require FS::Record;
1389 require FS::pkg_class;
1390 map { $_->classnum => $_->classname }
1391 FS::Record::qsearch('pkg_class', {} );
1393 'option_sub' => sub { require FS::Record;
1394 require FS::pkg_class;
1395 my $pkg_class = FS::Record::qsearchs(
1396 'pkg_class', { 'classnum'=>shift }
1398 $pkg_class ? $pkg_class->classname : '';
1403 'key' => 'signup_server-classnum3',
1405 'description' => 'Package Class for second optional purchase',
1406 'type' => 'select-sub',
1407 'options_sub' => sub { require FS::Record;
1408 require FS::pkg_class;
1409 map { $_->classnum => $_->classname }
1410 FS::Record::qsearch('pkg_class', {} );
1412 'option_sub' => sub { require FS::Record;
1413 require FS::pkg_class;
1414 my $pkg_class = FS::Record::qsearchs(
1415 'pkg_class', { 'classnum'=>shift }
1417 $pkg_class ? $pkg_class->classname : '';
1422 'key' => 'backend-realtime',
1424 'description' => 'Run billing for backend signups immediately.',
1425 'type' => 'checkbox',
1429 'key' => 'declinetemplate',
1430 'section' => 'billing',
1431 'description' => 'Template file for credit card decline emails.',
1432 'type' => 'textarea',
1436 'key' => 'emaildecline',
1437 'section' => 'billing',
1438 'description' => 'Enable emailing of credit card decline notices.',
1439 'type' => 'checkbox',
1443 'key' => 'emaildecline-exclude',
1444 'section' => 'billing',
1445 'description' => 'List of error messages that should not trigger email decline notices, one per line.',
1446 'type' => 'textarea',
1450 'key' => 'cancelmessage',
1451 'section' => 'billing',
1452 'description' => 'Template file for cancellation emails.',
1453 'type' => 'textarea',
1457 'key' => 'cancelsubject',
1458 'section' => 'billing',
1459 'description' => 'Subject line for cancellation emails.',
1464 'key' => 'emailcancel',
1465 'section' => 'billing',
1466 'description' => 'Enable emailing of cancellation notices.',
1467 'type' => 'checkbox',
1471 'key' => 'require_cardname',
1472 'section' => 'billing',
1473 'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
1474 'type' => 'checkbox',
1478 'key' => 'enable_taxclasses',
1479 'section' => 'billing',
1480 'description' => 'Enable per-package tax classes',
1481 'type' => 'checkbox',
1485 'key' => 'require_taxclasses',
1486 'section' => 'billing',
1487 'description' => 'Require a taxclass to be entered for every package',
1488 'type' => 'checkbox',
1492 'key' => 'welcome_email',
1494 '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>',
1495 'type' => 'textarea',
1499 'key' => 'welcome_email-from',
1501 'description' => 'From: address header for welcome email',
1506 'key' => 'welcome_email-subject',
1508 'description' => 'Subject: header for welcome email',
1513 'key' => 'welcome_email-mimetype',
1515 'description' => 'MIME type for welcome email',
1517 'select_enum' => [ 'text/plain', 'text/html' ],
1521 'key' => 'welcome_letter',
1523 'description' => 'Optional LaTex template file for a printed welcome letter. A welcome letter is printed the first time a cust_pkg record is created. See the <a href="http://search.cpan.org/~mjd/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation and the billing documentation for details on the template substitution language. A variable exists for each fieldname in the customer record (<code>$first, $last, etc</code>). The following additional variables are available<ul><li><code>$payby</code> - a friendler represenation of the field<li><code>$payinfo</code> - the masked payment information<li><code>$expdate</code> - the time at which the payment method expires (a UNIX timestamp)<li><code>$returnaddress</code> - the invoice return address for this customer\'s agent</ul>',
1524 'type' => 'textarea',
1528 'key' => 'warning_email',
1530 '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>',
1531 'type' => 'textarea',
1535 'key' => 'warning_email-from',
1537 'description' => 'From: address header for warning email',
1542 'key' => 'warning_email-cc',
1544 'description' => 'Additional recipient(s) (comma separated) for warning email when remaining usage reaches zero.',
1549 'key' => 'warning_email-subject',
1551 'description' => 'Subject: header for warning email',
1556 'key' => 'warning_email-mimetype',
1558 'description' => 'MIME type for warning email',
1560 'select_enum' => [ 'text/plain', 'text/html' ],
1565 'section' => 'billing',
1566 'description' => 'Available payment types.',
1567 'type' => 'selectmultiple',
1568 'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP) ],
1572 'key' => 'payby-default',
1574 'description' => 'Default payment type. HIDE disables display of billing information and sets customers to BILL.',
1576 'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP HIDE) ],
1580 'key' => 'paymentforcedtobatch',
1581 'section' => 'deprecated',
1582 'description' => 'See batch-enable_payby and realtime-disable_payby. Used to (for CHEK): Cause per customer payment entry to be forced to a batch processor rather than performed realtime.',
1583 'type' => 'checkbox',
1587 'key' => 'svc_acct-notes',
1589 'description' => 'Extra HTML to be displayed on the Account View screen.',
1590 'type' => 'textarea',
1594 'key' => 'radius-password',
1596 'description' => 'RADIUS attribute for plain-text passwords.',
1598 'select_enum' => [ 'Password', 'User-Password' ],
1602 'key' => 'radius-ip',
1604 'description' => 'RADIUS attribute for IP addresses.',
1606 'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
1609 #http://dev.coova.org/svn/coova-chilli/doc/dictionary.chillispot
1611 'key' => 'radius-chillispot-max',
1613 'description' => 'Enable ChilliSpot (and CoovaChilli) Max attributes, specifically ChilliSpot-Max-{Input,Output,Total}-{Octets,Gigawords}.',
1614 'type' => 'checkbox',
1618 'key' => 'svc_acct-alldomains',
1620 '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.',
1621 'type' => 'checkbox',
1625 'key' => 'dump-scpdest',
1627 'description' => 'destination for scp database dumps: user@host:/path',
1632 'key' => 'dump-pgpid',
1634 '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.",
1639 'key' => 'users-allow_comp',
1640 'section' => 'deprecated',
1641 '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.',
1642 'type' => 'textarea',
1646 'key' => 'credit_card-recurring_billing_flag',
1647 'section' => 'billing',
1648 'description' => 'This controls when the system passes the "recurring_billing" flag on credit card transactions. If supported by your processor (and the Business::OnlinePayment processor module), passing the flag indicates this is a recurring transaction and may turn off the CVV requirement. ',
1651 'actual_oncard' => 'Default/classic behavior: set the flag if a customer has actual previous charges on the card.',
1652 'transaction_is_recur' => 'Set the flag if the transaction itself is recurring, irregardless of previous charges on the card.',
1657 'key' => 'credit_card-recurring_billing_acct_code',
1658 'section' => 'billing',
1659 'description' => 'When the "recurring billing" flag is set, also set the "acct_code" to "rebill". Useful for reporting purposes with supported gateways (PlugNPay, others?)',
1660 'type' => 'checkbox',
1664 'key' => 'cvv-save',
1665 'section' => 'billing',
1666 '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.',
1667 'type' => 'selectmultiple',
1668 'select_enum' => \@card_types,
1672 'key' => 'allow_negative_charges',
1673 'section' => 'billing',
1674 'description' => 'Allow negative charges. Normally not used unless importing data from a legacy system that requires this.',
1675 'type' => 'checkbox',
1678 'key' => 'auto_unset_catchall',
1680 '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.',
1681 'type' => 'checkbox',
1685 'key' => 'system_usernames',
1686 'section' => 'username',
1687 '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.',
1688 'type' => 'textarea',
1692 'key' => 'cust_pkg-change_svcpart',
1694 'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
1695 'type' => 'checkbox',
1699 'key' => 'disable_autoreverse',
1700 'section' => 'BIND',
1701 'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
1702 'type' => 'checkbox',
1706 'key' => 'svc_www-enable_subdomains',
1708 'description' => 'Enable selection of specific subdomains for virtual host creation.',
1709 'type' => 'checkbox',
1713 'key' => 'svc_www-usersvc_svcpart',
1715 'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
1716 'type' => 'textarea',
1720 'key' => 'selfservice_server-primary_only',
1722 'description' => 'Only allow primary accounts to access self-service functionality.',
1723 'type' => 'checkbox',
1727 'key' => 'card_refund-days',
1728 'section' => 'billing',
1729 'description' => 'After a payment, the number of days a refund link will be available for that payment. Defaults to 120.',
1734 'key' => 'agent-showpasswords',
1736 'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
1737 'type' => 'checkbox',
1741 'key' => 'global_unique-username',
1742 'section' => 'username',
1743 '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.',
1745 'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
1749 'key' => 'svc_external-skip_manual',
1751 '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).',
1752 'type' => 'checkbox',
1756 'key' => 'svc_external-display_type',
1758 'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
1760 'select_enum' => [ 'generic', 'artera_turbo', ],
1764 'key' => 'ticket_system',
1766 '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).',
1768 #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
1769 'select_enum' => [ '', qw(RT_Internal RT_External) ],
1773 'key' => 'ticket_system-default_queueid',
1775 'description' => 'Default queue used when creating new customer tickets.',
1776 'type' => 'select-sub',
1777 'options_sub' => sub {
1778 my $conf = new FS::Conf;
1779 if ( $conf->config('ticket_system') ) {
1780 eval "use FS::TicketSystem;";
1782 FS::TicketSystem->queues();
1787 'option_sub' => sub {
1788 my $conf = new FS::Conf;
1789 if ( $conf->config('ticket_system') ) {
1790 eval "use FS::TicketSystem;";
1792 FS::TicketSystem->queue(shift);
1800 'key' => 'ticket_system-custom_priority_field',
1802 'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
1807 'key' => 'ticket_system-custom_priority_field-values',
1809 'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
1810 'type' => 'textarea',
1814 'key' => 'ticket_system-custom_priority_field_queue',
1816 'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
1821 'key' => 'ticket_system-rt_external_datasrc',
1823 '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>',
1829 'key' => 'ticket_system-rt_external_url',
1831 'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
1836 'key' => 'company_name',
1837 'section' => 'required',
1838 'description' => 'Your company name',
1843 'key' => 'echeck-void',
1844 'section' => 'deprecated',
1845 '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',
1846 'type' => 'checkbox',
1851 'section' => 'deprecated',
1852 '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',
1853 'type' => 'checkbox',
1858 'section' => 'deprecated',
1859 'description' => '<B>DEPRECATED</B>, now controlled by ACLs. Used to enable unvoiding of voided payments',
1860 'type' => 'checkbox',
1864 'key' => 'address2-search',
1866 'description' => 'Enable a "Unit" search box which searches the second address field',
1867 'type' => 'checkbox',
1871 'key' => 'cust_main-require_address2',
1873 'description' => 'Second address field is required (on service address only, if billing and service addresses differ). Also enables "Unit" labeling of address2 on customer view and edit pages. Useful for multi-tenant applications. See also: address2-search',
1874 'type' => 'checkbox',
1877 { 'key' => 'referral_credit',
1878 'section' => 'billing',
1879 'description' => "Enables one-time referral credits in the amount of one month <i>referred</i> customer's recurring fee (irregardless of frequency).",
1880 'type' => 'checkbox',
1883 { 'key' => 'selfservice_server-cache_module',
1885 '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.',
1887 'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
1892 'section' => 'billing',
1893 '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).',
1894 'type' => [qw( checkbox textarea )],
1898 'key' => 'cust_bill-ftpformat',
1899 'section' => 'billing',
1900 'description' => 'Enable FTP of raw invoice data - format.',
1902 'select_enum' => [ '', 'default', 'billco', ],
1906 'key' => 'cust_bill-ftpserver',
1907 'section' => 'billing',
1908 'description' => 'Enable FTP of raw invoice data - server.',
1913 'key' => 'cust_bill-ftpusername',
1914 'section' => 'billing',
1915 'description' => 'Enable FTP of raw invoice data - server.',
1920 'key' => 'cust_bill-ftppassword',
1921 'section' => 'billing',
1922 'description' => 'Enable FTP of raw invoice data - server.',
1927 'key' => 'cust_bill-ftpdir',
1928 'section' => 'billing',
1929 'description' => 'Enable FTP of raw invoice data - server.',
1934 'key' => 'cust_bill-spoolformat',
1935 'section' => 'billing',
1936 'description' => 'Enable spooling of raw invoice data - format.',
1938 'select_enum' => [ '', 'default', 'billco', ],
1942 'key' => 'cust_bill-spoolagent',
1943 'section' => 'billing',
1944 'description' => 'Enable per-agent spooling of raw invoice data.',
1945 'type' => 'checkbox',
1949 'key' => 'svc_acct-usage_suspend',
1950 'section' => 'billing',
1951 '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.',
1952 'type' => 'checkbox',
1956 'key' => 'svc_acct-usage_unsuspend',
1957 'section' => 'billing',
1958 '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.',
1959 'type' => 'checkbox',
1963 'key' => 'svc_acct-usage_threshold',
1964 'section' => 'billing',
1965 '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.',
1970 'key' => 'cust-fields',
1972 'description' => 'Which customer fields to display on reports by default',
1974 'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
1978 'key' => 'cust_pkg-display_times',
1980 'description' => 'Display full timestamps (not just dates) for customer packages. Useful if you are doing real-time things like hourly prepaid.',
1981 'type' => 'checkbox',
1985 'key' => 'svc_acct-edit_uid',
1986 'section' => 'shell',
1987 'description' => 'Allow UID editing.',
1988 'type' => 'checkbox',
1992 'key' => 'svc_acct-edit_gid',
1993 'section' => 'shell',
1994 'description' => 'Allow GID editing.',
1995 'type' => 'checkbox',
1999 'key' => 'zone-underscore',
2000 'section' => 'BIND',
2001 'description' => 'Allow underscores in zone names. As underscores are illegal characters in zone names, this option is not recommended.',
2002 'type' => 'checkbox',
2005 #these should become per-user...
2007 'key' => 'vonage-username',
2009 'description' => 'Vonage Click2Call username (see <a href="https://secure.click2callu.com/">https://secure.click2callu.com/</a>)',
2013 'key' => 'vonage-password',
2015 'description' => 'Vonage Click2Call username (see <a href="https://secure.click2callu.com/">https://secure.click2callu.com/</a>)',
2019 'key' => 'vonage-fromnumber',
2021 'description' => 'Vonage Click2Call number (see <a href="https://secure.click2callu.com/">https://secure.click2callu.com/</a>)',
2026 'key' => 'echeck-nonus',
2027 'section' => 'billing',
2028 'description' => 'Disable ABA-format account checking for Electronic Check payment info',
2029 'type' => 'checkbox',
2033 'key' => 'voip-cust_cdr_spools',
2035 'description' => 'Enable the per-customer option for individual CDR spools.',
2036 'type' => 'checkbox',
2040 'key' => 'svc_forward-arbitrary_dst',
2042 '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.",
2043 'type' => 'checkbox',
2047 'key' => 'tax-ship_address',
2048 'section' => 'billing',
2049 '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.',
2050 'type' => 'checkbox',
2054 'key' => 'invoice-ship_address',
2055 'section' => 'billing',
2056 'description' => 'Enable this switch to include the ship address on the invoice.',
2057 'type' => 'checkbox',
2061 'key' => 'invoice-unitprice',
2062 'section' => 'billing',
2063 'description' => 'This switch enables unit pricing on the invoice.',
2064 'type' => 'checkbox',
2068 'key' => 'postal_invoice-fee_pkgpart',
2069 'section' => 'billing',
2070 'description' => 'This allows selection of a package to insert on invoices for customers with postal invoices selected.',
2071 'type' => 'select-sub',
2072 'options_sub' => sub { require FS::Record;
2073 require FS::part_pkg;
2074 map { $_->pkgpart => $_->pkg }
2075 FS::Record::qsearch('part_pkg', { disabled=>'' } );
2077 'option_sub' => sub { require FS::Record;
2078 require FS::part_pkg;
2079 my $part_pkg = FS::Record::qsearchs(
2080 'part_pkg', { 'pkgpart'=>shift }
2082 $part_pkg ? $part_pkg->pkg : '';
2087 'key' => 'postal_invoice-recurring_only',
2088 'section' => 'billing',
2089 'description' => 'The postal invoice fee is omitted on invoices without recurring charges when this is set',
2090 'type' => 'checkbox',
2094 'key' => 'batch-enable',
2095 'section' => 'deprecated', #make sure batch-enable_payby is set for
2096 #everyone before removing
2097 'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
2098 'type' => 'checkbox',
2102 'key' => 'batch-enable_payby',
2103 'section' => 'billing',
2104 'description' => 'Enable batch processing for the specified payment types.',
2105 'type' => 'selectmultiple',
2106 'select_enum' => [qw( CARD CHEK )],
2110 'key' => 'realtime-disable_payby',
2111 'section' => 'billing',
2112 'description' => 'Disable realtime processing for the specified payment types.',
2113 'type' => 'selectmultiple',
2114 'select_enum' => [qw( CARD CHEK )],
2118 'key' => 'batch-default_format',
2119 'section' => 'billing',
2120 'description' => 'Default format for batches.',
2122 'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch',
2123 'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
2129 'key' => 'batch-fixed_format-CARD',
2130 'section' => 'billing',
2131 'description' => 'Fixed (unchangeable) format for credit card batches.',
2133 'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
2134 'csv-chase_canada-E-xactBatch', 'BoM', 'PAP' ]
2138 'key' => 'batch-fixed_format-CHEK',
2139 'section' => 'billing',
2140 'description' => 'Fixed (unchangeable) format for electronic check batches.',
2142 'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP',
2148 'key' => 'batch-increment_expiration',
2149 'section' => 'billing',
2150 'description' => 'Increment expiration date years in batches until cards are current. Make sure this is acceptable to your batching provider before enabling.',
2151 'type' => 'checkbox'
2155 'key' => 'batchconfig-BoM',
2156 'section' => 'billing',
2157 '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',
2158 'type' => 'textarea',
2162 'key' => 'batchconfig-PAP',
2163 'section' => 'billing',
2164 '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',
2165 'type' => 'textarea',
2169 'key' => 'batchconfig-csv-chase_canada-E-xactBatch',
2170 'section' => 'billing',
2171 'description' => 'Gateway ID for Chase Canada E-xact batching',
2176 'key' => 'payment_history-years',
2178 'description' => 'Number of years of payment history to show by default. Currently defaults to 2.',
2183 'key' => 'cust_main-use_comments',
2185 'description' => 'Display free form comments on the customer edit screen. Useful as a scratch pad.',
2186 'type' => 'checkbox',
2190 'key' => 'cust_main-disable_notes',
2192 'description' => 'Disable new style customer notes - timestamped and user identified customer notes. Useful in tracking who did what.',
2193 'type' => 'checkbox',
2197 'key' => 'cust_main_note-display_times',
2199 'description' => 'Display full timestamps (not just dates) for customer notes.',
2200 'type' => 'checkbox',
2204 'key' => 'cust_main-ticket_statuses',
2206 'description' => 'Show tickets with these statuses on the customer view page.',
2207 'type' => 'selectmultiple',
2208 'select_enum' => [qw( new open stalled resolved rejected deleted )],
2212 'key' => 'cust_main-max_tickets',
2214 'description' => 'Maximum number of tickets to show on the customer view page.',
2219 'key' => 'cust_main-skeleton_tables',
2221 '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.',
2222 'type' => 'textarea',
2226 'key' => 'cust_main-skeleton_custnum',
2228 'description' => 'Customer number specifying the source data to copy into skeleton tables for new customers.',
2233 'key' => 'cust_main-enable_birthdate',
2235 'descritpion' => 'Enable tracking of a birth date with each customer record',
2236 'type' => 'checkbox',
2240 'key' => 'support-key',
2242 '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.',
2247 'key' => 'card-types',
2248 'section' => 'billing',
2249 'description' => 'Select one or more card types to enable only those card types. If no card types are selected, all card types are available.',
2250 'type' => 'selectmultiple',
2251 'select_enum' => \@card_types,
2255 'key' => 'dashboard-toplist',
2257 'description' => 'List of items to display on the top of the front page',
2258 'type' => 'textarea',
2262 'key' => 'impending_recur_template',
2263 'section' => 'billing',
2264 '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>',
2265 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
2266 'type' => 'textarea',
2270 'key' => 'selfservice-session_timeout',
2272 'description' => 'Self-service session timeout. Defaults to 1 hour.',
2274 'select_enum' => [ '1 hour', '2 hours', '4 hours', '8 hours', '1 day', '1 week', ],
2278 'key' => 'disable_setup_suspended_pkgs',
2279 'section' => 'billing',
2280 'description' => 'Disables charging of setup fees for suspended packages.',
2281 'type' => 'checkbox',
2285 'key' => 'password-generated-allcaps',
2286 'section' => 'password',
2287 'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
2288 'type' => 'checkbox',
2292 'key' => 'datavolume-forcemegabytes',
2294 'description' => 'All data volumes are expressed in megabytes',
2295 'type' => 'checkbox',
2299 'key' => 'datavolume-significantdigits',
2301 'description' => 'number of significant digits to use to represent data volumes',
2306 'key' => 'disable_void_after',
2307 'section' => 'billing',
2308 'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
2313 'key' => 'disable_line_item_date_ranges',
2314 'section' => 'billing',
2315 'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
2316 'type' => 'checkbox',
2320 'key' => 'cust_main-require_phone',
2322 'description' => 'Require daytime or night for all customer records.',
2323 'type' => 'checkbox',
2327 'key' => 'cust_main-require_invoicing_list_email',
2329 'description' => 'Email address field is required: require at least one invoicing email address for all customer records.',
2330 'type' => 'checkbox',
2334 'key' => 'cancel_credit_type',
2335 'section' => 'billing',
2336 'description' => 'The group to use for new, automatically generated credit reasons resulting from cancellation.',
2337 'type' => 'select-sub',
2338 'options_sub' => sub { require FS::Record;
2339 require FS::reason_type;
2340 map { $_->typenum => $_->type }
2341 FS::Record::qsearch('reason_type', { class=>'R' } );
2343 'option_sub' => sub { require FS::Record;
2344 require FS::reason_type;
2345 my $reason_type = FS::Record::qsearchs(
2346 'reason_type', { 'typenum' => shift }
2348 $reason_type ? $reason_type->type : '';
2353 'key' => 'referral_credit_type',
2354 'section' => 'billing',
2355 'description' => 'The group to use for new, automatically generated credit reasons resulting from referrals.',
2356 'type' => 'select-sub',
2357 'options_sub' => sub { require FS::Record;
2358 require FS::reason_type;
2359 map { $_->typenum => $_->type }
2360 FS::Record::qsearch('reason_type', { class=>'R' } );
2362 'option_sub' => sub { require FS::Record;
2363 require FS::reason_type;
2364 my $reason_type = FS::Record::qsearchs(
2365 'reason_type', { 'typenum' => shift }
2367 $reason_type ? $reason_type->type : '';
2372 'key' => 'signup_credit_type',
2373 'section' => 'billing',
2374 'description' => 'The group to use for new, automatically generated credit reasons resulting from signup and self-service declines.',
2375 'type' => 'select-sub',
2376 'options_sub' => sub { require FS::Record;
2377 require FS::reason_type;
2378 map { $_->typenum => $_->type }
2379 FS::Record::qsearch('reason_type', { class=>'R' } );
2381 'option_sub' => sub { require FS::Record;
2382 require FS::reason_type;
2383 my $reason_type = FS::Record::qsearchs(
2384 'reason_type', { 'typenum' => shift }
2386 $reason_type ? $reason_type->type : '';
2391 'key' => 'cust_main-agent_custid-format',
2393 'description' => 'Enables searching of various formatted values in cust_main.agent_custid',
2396 '' => 'Numeric only',
2397 'ww?d+' => 'Numeric with one or two letter prefix',
2402 'key' => 'card_masking_method',
2404 'description' => 'Digits to display when masking credit cards. Note that the first six digits are necessary to canonically identify the credit card type (Visa/MC, Amex, Discover, Maestro, etc.) in all cases. The first four digits can identify the most common credit card types in most cases (Visa/MC, Amex, and Discover). The first two digits can distinguish between Visa/MC and Amex.',
2407 '' => '123456xxxxxx1234',
2408 'first6last2' => '123456xxxxxxxx12',
2409 'first4last4' => '1234xxxxxxxx1234',
2410 'first4last2' => '1234xxxxxxxxxx12',
2411 'first2last4' => '12xxxxxxxxxx1234',
2412 'first2last2' => '12xxxxxxxxxxxx12',
2413 'first0last4' => 'xxxxxxxxxxxx1234',
2414 'first0last2' => 'xxxxxxxxxxxxxx12',
2419 'key' => 'disable_previous_balance',
2420 'section' => 'billing',
2421 'description' => 'Disable inclusion of previous balance lines on invoices',
2422 'type' => 'checkbox',
2426 'key' => 'disable_acl_changes',
2428 'description' => 'Disable all ACL changes, for demos.',
2429 'type' => 'checkbox',
2433 'key' => 'cust_main-edit_agent_custid',
2435 'description' => 'Enable editing of the agent_custid field.',
2436 'type' => 'checkbox',
2440 'key' => 'cust_main-default_areacode',
2442 'description' => 'Default area code for customers.',
2447 'key' => 'cust_bill-max_same_services',
2448 'section' => 'billing',
2449 'description' => 'Maximum number of the same service to list individually on invoices before condensing to a single line listing the number of services. Defaults to 5.',
2454 'key' => 'suspend_email_admin',
2456 'description' => 'Destination admin email address to enable suspension notices',
2461 'key' => 'unsuspend_email_admin',
2463 'description' => 'Destination admin email address to enable unsuspension notices',
2468 'key' => 'email_report-subject',
2470 'description' => 'Subject for reports emailed by freeside-fetch. Defaults to "Freeside report".',
2475 'key' => 'sg-multicustomer_hack',
2477 'description' => "Don't use this.",
2478 'type' => 'checkbox',
2482 'key' => 'sg-ping_username',
2484 'description' => "Don't use this.",
2489 'key' => 'sg-ping_password',
2491 'description' => "Don't use this.",
2496 'key' => 'sg-login_username',
2498 'description' => "Don't use this.",
2503 'key' => 'queued-max_kids',
2505 'description' => 'Maximum number of queued processes. Defaults to 10.',
2510 'key' => 'cancelled_cust-noevents',
2511 'section' => 'billing',
2512 'description' => "Don't run events for cancelled customers",
2513 'type' => 'checkbox',
2517 'key' => 'svc_broadband-manage_link',
2519 'description' => 'URL for svc_broadband "Manage Device" link. The following substitutions are available: $ip_addr.',