3 use vars qw($base_dir @config_items @base_items @card_types $DEBUG);
11 use FS::Record qw(qsearch qsearchs);
12 use FS::UID qw(dbh datasrc use_confcompat);
14 $base_dir = '%%%FREESIDE_CONF%%%';
20 FS::Conf - Freeside configuration values
28 $value = $conf->config('key');
29 @list = $conf->config('key');
30 $bool = $conf->exists('key');
33 $conf->set('key' => 'value');
36 @config_items = $conf->config_items;
40 Read and write Freeside configuration values. Keys currently map to filenames,
41 but this may change in the future.
49 Create a new configuration object.
55 my($class) = ref($proto) || $proto;
56 my($self) = { 'base_dir' => $base_dir };
57 bless ($self, $class);
62 Returns the base directory. By default this is /usr/local/etc/freeside.
68 my $base_dir = $self->{base_dir};
69 -e $base_dir or die "FATAL: $base_dir doesn't exist!";
70 -d $base_dir or die "FATAL: $base_dir isn't a directory!";
71 -r $base_dir or die "FATAL: Can't read $base_dir!";
72 -x $base_dir or die "FATAL: $base_dir not searchable (executable)!";
73 $base_dir =~ /^(.*)$/;
77 =item config KEY [ AGENTNUM ]
79 Returns the configuration value or values (depending on context) for key.
80 The optional agent number selects an agent specific value instead of the
81 global default if one is present.
86 my ($self, $method) = (shift, shift);
87 warn "NO CONFIGURATION RECORDS FOUND -- USING COMPATIBILITY MODE"
89 my $compat = new FS::Conf_compat17 ("$base_dir/conf." . datasrc);
94 my($self,$name,$agentnum)=@_;
95 my $hashref = { 'name' => $name };
96 $hashref->{agentnum} = $agentnum;
97 local $FS::Record::conf = undef; # XXX evil hack prevents recursion
98 my $cv = FS::Record::qsearchs('conf', $hashref);
99 if (!$cv && defined($agentnum)) {
100 $hashref->{agentnum} = '';
101 $cv = FS::Record::qsearchs('conf', $hashref);
108 return $self->_usecompat('config', @_) if use_confcompat;
110 my($name,$agentnum)=@_;
111 my $cv = $self->_config($name, $agentnum) or return;
116 (split "\n", $v, -1);
118 (split("\n", $cv->value))[0];
122 =item config_binary KEY [ AGENTNUM ]
124 Returns the exact scalar value for key.
130 return $self->_usecompat('config_binary', @_) if use_confcompat;
132 my($name,$agentnum)=@_;
133 my $cv = $self->_config($name, $agentnum) or return;
134 decode_base64($cv->value);
137 =item exists KEY [ AGENTNUM ]
139 Returns true if the specified key exists, even if the corresponding value
146 return $self->_usecompat('exists', @_) if use_confcompat;
148 my($name,$agentnum)=@_;
149 defined($self->_config($name, $agentnum));
152 #=item config_orbase KEY SUFFIX
154 #Returns the configuration value or values (depending on context) for
155 #KEY_SUFFIX, if it exists, otherwise for KEY
159 # outmoded as soon as we shift to agentnum based config values
160 # well, mostly. still useful for e.g. late notices, etc. in that we want
161 # these to fall back to standard values
164 return $self->_usecompat('config_orbase', @_) if use_confcompat;
166 my( $name, $suffix ) = @_;
167 if ( $self->exists("${name}_$suffix") ) {
168 $self->config("${name}_$suffix");
170 $self->config($name);
174 =item invoice_templatenames
176 Returns all possible invoice template names.
180 sub invoice_templatenames {
183 my %templatenames = ();
184 foreach my $item ( $self->config_items ) {
185 foreach my $base ( @base_items ) {
186 my( $main, $ext) = split(/\./, $base);
187 $ext = ".$ext" if $ext;
188 if ( $item->key =~ /^${main}_(.+)$ext$/ ) {
189 $templatenames{$1}++;
194 sort keys %templatenames;
198 =item touch KEY [ AGENT ];
200 Creates the specified configuration key if it does not exist.
206 return $self->_usecompat('touch', @_) if use_confcompat;
208 my($name, $agentnum) = @_;
209 unless ( $self->exists($name, $agentnum) ) {
210 $self->set($name, '', $agentnum);
214 =item set KEY VALUE [ AGENTNUM ];
216 Sets the specified configuration key to the given value.
222 return $self->_usecompat('set', @_) if use_confcompat;
224 my($name, $value, $agentnum) = @_;
228 warn "[FS::Conf] SET $name\n" if $DEBUG;
230 my $old = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum});
231 my $new = new FS::conf { $old ? $old->hash
232 : ('name' => $name, 'agentnum' => $agentnum)
238 $error = $new->replace($old);
240 $error = $new->insert;
243 die "error setting configuration value: $error \n"
248 =item set_binary KEY VALUE [ AGENTNUM ]
250 Sets the specified configuration key to an exact scalar value which
251 can be retrieved with config_binary.
257 return if use_confcompat;
259 my($name, $value, $agentnum)=@_;
260 $self->set($name, encode_base64($value), $agentnum);
263 =item delete KEY [ AGENTNUM ];
265 Deletes the specified configuration key.
271 return $self->_usecompat('delete', @_) if use_confcompat;
273 my($name, $agentnum) = @_;
274 if ( my $cv = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum}) ) {
275 warn "[FS::Conf] DELETE $name\n";
277 my $oldAutoCommit = $FS::UID::AutoCommit;
278 local $FS::UID::AutoCommit = 0;
281 my $error = $cv->delete;
284 $dbh->rollback if $oldAutoCommit;
285 die "error setting configuration value: $error \n"
288 $dbh->commit or die $dbh->errstr if $oldAutoCommit;
293 =item import_config_item CONFITEM DIR
295 Imports the item specified by the CONFITEM (see L<FS::ConfItem>) into
296 the database as a conf record (see L<FS::conf>). Imports from the file
297 in the directory DIR.
301 sub import_config_item {
302 my ($self,$item,$dir) = @_;
303 my $key = $item->key;
304 if ( -e "$dir/$key" && ! use_confcompat ) {
305 warn "Inserting $key\n" if $DEBUG;
307 my $value = readline(new IO::File "$dir/$key");
308 if ($item->type eq 'binary') {
309 $self->set_binary($key, $value);
311 $self->set($key, $value);
314 warn "Not inserting $key\n" if $DEBUG;
318 =item verify_config_item CONFITEM DIR
320 Compares the item specified by the CONFITEM (see L<FS::ConfItem>) in
321 the database to the legacy file value in DIR.
325 sub verify_config_item {
326 return '' if use_confcompat;
327 my ($self,$item,$dir) = @_;
328 my $key = $item->key;
329 my $type = $item->type;
331 my $compat = new FS::Conf_compat17 $dir;
334 $error .= "$key fails existential comparison; "
335 if $self->exists($key) xor $compat->exists($key);
337 unless ($type eq 'binary') {
340 $error .= "$key fails scalar comparison; "
341 unless scalar($self->config($key)) eq scalar($compat->config($key));
344 my (@new) = $self->config($key);
345 my (@old) = $compat->config($key);
346 unless ( scalar(@new) == scalar(@old)) {
347 $error .= "$key fails list comparison; ";
350 foreach (@old) { $r=0 if ($_ cmp shift(@new)); }
351 $error .= "$key fails list comparison; "
356 if ($type eq 'binary') {
357 $error .= "$key fails binary comparison; "
358 unless scalar($self->config_binary($key)) eq scalar($compat->config_binary($key));
361 if ($error =~ /existential comparison/ && $item->section eq 'deprecated') {
363 for ( @config_items ) { $proto = $_; last if $proto->key eq $key; }
364 unless ($proto->key eq $key) {
365 warn "removed config item $error\n" if $DEBUG;
373 #item _orbase_items OPTIONS
375 #Returns all of the possible extensible config items as FS::ConfItem objects.
376 #See #L<FS::ConfItem>. OPTIONS consists of name value pairs. Possible
379 # dir - the directory to search for configuration option files instead
380 # of using the conf records in the database
386 my ($self, %opt) = @_;
388 my $listmaker = sub { my $v = shift;
390 if ( $v =~ /\.(png|eps)$/ ) {
396 FS::Record::qsearch( 'conf',
399 "WHERE name LIKE '$v' ESCAPE '!'"
403 if (exists($opt{dir}) && $opt{dir}) {
404 $listmaker = sub { my $v = shift;
405 if ( $v =~ /\.(png|eps)$/ ) {
410 map { basename $_ } glob($opt{dir}. "/$v" );
417 for ( @config_items ) { $proto = $_; last if $proto->key eq $base; }
418 die "don't know about $base items" unless $proto->key eq $base;
420 map { new FS::ConfItem {
422 'section' => $proto->section,
423 'description' => 'Alternate ' . $proto->description . ' See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
424 'type' => $proto->type,
426 } &$listmaker($base);
433 Returns all of the possible global/default configuration items as
434 FS::ConfItem objects. See L<FS::ConfItem>.
440 return $self->_usecompat('config_items', @_) if use_confcompat;
442 ( @config_items, $self->_orbase_items(@_) );
451 =item init-config DIR
453 Imports the non-deprecated configuration items from DIR (1.7 compatible)
454 to conf records in the database.
462 local $FS::UID::use_confcompat = 0;
463 my $conf = new FS::Conf;
464 foreach my $item ( $conf->config_items(dir => $dir) ) {
465 $conf->import_config_item($item, $dir);
466 my $error = $conf->verify_config_item($item, $dir);
467 return $error if $error;
470 my $compat = new FS::Conf_compat17 $dir;
471 foreach my $item ( $compat->config_items ) {
472 my $error = $conf->verify_config_item($item, $dir);
473 return $error if $error;
477 $FS::UID::use_confcompat = 0;
485 If this was more than just crud that will never be useful outside Freeside I'd
486 worry that config_items is freeside-specific and icky.
490 "Configuration" in the web interface (config/config.cgi).
494 #Business::CreditCard
499 "American Express card",
500 "Diner's Club/Carte Blanche",
511 invoice_latexreturnaddress
513 invoice_latexsmallfooter
516 invoice_htmlreturnaddress
526 invoice_latexreturnaddress
528 invoice_latexsmallfooter
531 invoice_htmlreturnaddress
538 @config_items = map { new FS::ConfItem $_ } (
542 'section' => 'deprecated',
543 'description' => 'This configuration option is no longer used. See <a href="#invoice_template">invoice_template</a> instead.',
548 'key' => 'alerter_template',
549 'section' => 'billing',
550 'description' => 'Template file for billing method expiration alerts. See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Credit_cards_and_Electronic_checks">billing documentation</a> for details.',
551 'type' => 'textarea',
556 'section' => 'deprecated',
557 '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',
562 'key' => 'encryption',
563 'section' => 'billing',
564 'description' => 'Enable encryption of credit cards.',
565 'type' => 'checkbox',
569 'key' => 'encryptionmodule',
570 'section' => 'billing',
571 'description' => 'Use which module for encryption?',
576 'key' => 'encryptionpublickey',
577 'section' => 'billing',
578 'description' => 'Your RSA Public Key - Required if Encryption is turned on.',
579 'type' => 'textarea',
583 'key' => 'encryptionprivatekey',
584 'section' => 'billing',
585 '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.',
586 'type' => 'textarea',
590 'key' => 'business-onlinepayment',
591 'section' => 'billing',
592 '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.',
593 'type' => 'textarea',
597 'key' => 'business-onlinepayment-ach',
598 'section' => 'billing',
599 '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.',
600 'type' => 'textarea',
604 'key' => 'business-onlinepayment-description',
605 'section' => 'billing',
606 '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)',
611 'key' => 'business-onlinepayment-email-override',
612 'section' => 'billing',
613 'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
618 'key' => 'business-onlinepayment-email_customer',
619 'section' => 'billing',
620 'description' => 'Controls the "email_customer" flag used by some Business::OnlinePayment processors to enable customer receipts.',
621 'type' => 'checkbox',
625 'key' => 'countrydefault',
627 'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
632 'key' => 'date_format',
634 'description' => 'Format for displaying dates',
637 '%m/%d/%Y' => 'MM/DD/YYYY',
638 '%Y/%m/%d' => 'YYYY/MM/DD',
643 'key' => 'deletecustomers',
645 '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.',
646 'type' => 'checkbox',
650 'key' => 'deletepayments',
651 'section' => 'billing',
652 '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.',
653 'type' => [qw( checkbox text )],
657 'key' => 'deletecredits',
658 'section' => 'deprecated',
659 '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.',
660 'type' => [qw( checkbox text )],
664 'key' => 'deleterefunds',
665 'section' => 'billing',
666 'description' => 'Enable deletion of unclosed refunds. Be very careful! Only delete refunds that were data-entry errors, not adjustments.',
667 'type' => 'checkbox',
672 'section' => 'shell',
673 '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>',
678 'key' => 'disable_customer_referrals',
680 'description' => 'Disable new customer-to-customer referrals in the web interface',
681 'type' => 'checkbox',
685 'key' => 'editreferrals',
687 'description' => 'Enable advertising source modification for existing customers',
688 'type' => 'checkbox',
692 'key' => 'emailinvoiceonly',
693 'section' => 'billing',
694 'description' => 'Disables postal mail invoices',
695 'type' => 'checkbox',
699 'key' => 'disablepostalinvoicedefault',
700 'section' => 'billing',
701 '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>.',
702 'type' => 'checkbox',
706 'key' => 'emailinvoiceauto',
707 'section' => 'billing',
708 'description' => 'Automatically adds new accounts to the email invoice list',
709 'type' => 'checkbox',
713 'key' => 'emailinvoiceautoalways',
714 'section' => 'billing',
715 'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses',
716 'type' => 'checkbox',
720 'key' => 'exclude_ip_addr',
722 'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
723 'type' => 'textarea',
727 'key' => 'hidecancelledpackages',
729 'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
730 'type' => 'checkbox',
734 'key' => 'hidecancelledcustomers',
736 'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
737 'type' => 'checkbox',
742 'section' => 'shell',
743 'description' => 'For new users, prefixed to username to create a directory name. Should have a leading but not a trailing slash.',
748 'key' => 'invoice_from',
749 'section' => 'required',
750 'description' => 'Return address on email invoices',
755 'key' => 'invoice_template',
756 'section' => 'billing',
757 'description' => 'Text template file for invoices. Used if no invoice_html template is defined, and also seen by users using non-HTML capable mail clients. See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Plaintext_invoice_templates">billing documentation</a> for details.',
758 'type' => 'textarea',
762 'key' => 'invoice_html',
763 'section' => 'billing',
764 'description' => 'Optional HTML template for invoices. See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#HTML_invoice_templates">billing documentation</a> for details.',
766 'type' => 'textarea',
770 'key' => 'invoice_htmlnotes',
771 'section' => 'billing',
772 'description' => 'Notes section for HTML invoices. Defaults to the same data in invoice_latexnotes if not specified.',
773 'type' => 'textarea',
777 'key' => 'invoice_htmlfooter',
778 'section' => 'billing',
779 'description' => 'Footer for HTML invoices. Defaults to the same data in invoice_latexfooter if not specified.',
780 'type' => 'textarea',
784 'key' => 'invoice_htmlreturnaddress',
785 'section' => 'billing',
786 'description' => 'Return address for HTML invoices. Defaults to the same data in invoice_latexreturnaddress if not specified.',
787 'type' => 'textarea',
791 'key' => 'invoice_latex',
792 'section' => 'billing',
793 'description' => 'Optional LaTeX template for typeset PostScript invoices. See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Typeset_.28LaTeX.29_invoice_templates">billing documentation</a> for details.',
794 'type' => 'textarea',
798 'key' => 'invoice_latexnotes',
799 'section' => 'billing',
800 'description' => 'Notes section for LaTeX typeset PostScript invoices.',
801 'type' => 'textarea',
805 'key' => 'invoice_latexfooter',
806 'section' => 'billing',
807 'description' => 'Footer for LaTeX typeset PostScript invoices.',
808 'type' => 'textarea',
812 'key' => 'invoice_latexreturnaddress',
813 'section' => 'billing',
814 'description' => 'Return address for LaTeX typeset PostScript invoices.',
815 'type' => 'textarea',
819 'key' => 'invoice_latexsmallfooter',
820 'section' => 'billing',
821 'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
822 'type' => 'textarea',
826 'key' => 'invoice_email_pdf',
827 'section' => 'billing',
828 '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.',
833 'key' => 'invoice_email_pdf_note',
834 'section' => 'billing',
835 'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.',
841 'key' => 'invoice_default_terms',
842 'section' => 'billing',
843 'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
845 'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 30', 'Net 45', 'Net 60' ],
849 'key' => 'payment_receipt_email',
850 'section' => 'billing',
851 '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>',
852 'type' => [qw( checkbox textarea )],
857 'section' => 'required',
858 'description' => 'Print command for paper invoices, for example `lpr -h\'',
863 'key' => 'lpr-postscript_prefix',
864 'section' => 'billing',
865 'description' => 'Raw printer commands prepended to the beginning of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
870 'key' => 'lpr-postscript_suffix',
871 'section' => 'billing',
872 'description' => 'Raw printer commands added to the end of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
877 'key' => 'money_char',
879 'description' => 'Currency symbol - defaults to `$\'',
884 'key' => 'defaultrecords',
886 'description' => 'DNS entries to add automatically when creating a domain',
887 'type' => 'editlist',
888 'editlist_parts' => [ { type=>'text' },
889 { type=>'immutable', value=>'IN' },
891 select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS TXT)} },
892 { type=> 'text' }, ],
896 'key' => 'passwordmin',
897 'section' => 'password',
898 'description' => 'Minimum password length (default 6)',
903 'key' => 'passwordmax',
904 'section' => 'password',
905 'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
910 'key' => 'password-noampersand',
911 'section' => 'password',
912 'description' => 'Disallow ampersands in passwords',
913 'type' => 'checkbox',
917 'key' => 'password-noexclamation',
918 'section' => 'password',
919 'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
920 'type' => 'checkbox',
924 'key' => 'referraldefault',
926 'description' => 'Default referral, specified by refnum',
931 # 'key' => 'registries',
932 # 'section' => 'required',
933 # 'description' => 'Directory which contains domain registry information. Each registry is a directory.',
937 'key' => 'maxsearchrecordsperpage',
939 'description' => 'If set, number of search records to return per page.',
944 'key' => 'session-start',
945 'section' => 'session',
946 '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.',
951 'key' => 'session-stop',
952 'section' => 'session',
953 '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.',
959 'section' => 'shell',
960 '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.',
961 'type' => 'textarea',
965 'key' => 'showpasswords',
967 'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
968 'type' => 'checkbox',
972 'key' => 'signupurl',
974 'description' => 'if you are using customer-to-customer referrals, and you enter the URL of your <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Self-Service_Installation">signup server CGI</a>, the customer view screen will display a customized link to the signup server with the appropriate customer as referral',
979 'key' => 'smtpmachine',
980 'section' => 'required',
981 'description' => 'SMTP relay for Freeside\'s outgoing mail',
986 'key' => 'soadefaultttl',
988 'description' => 'SOA default TTL for new domains.',
995 'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
1000 'key' => 'soaexpire',
1001 'section' => 'BIND',
1002 'description' => 'SOA expire for new domains',
1007 'key' => 'soamachine',
1008 'section' => 'BIND',
1009 'description' => 'SOA machine for new domains, with trailing `.\'',
1014 'key' => 'soarefresh',
1015 'section' => 'BIND',
1016 'description' => 'SOA refresh for new domains',
1021 'key' => 'soaretry',
1022 'section' => 'BIND',
1023 'description' => 'SOA retry for new domains',
1028 'key' => 'statedefault',
1030 'description' => 'Default state or province (if not supplied, the default is `CA\')',
1035 'key' => 'unsuspendauto',
1036 'section' => 'billing',
1037 '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',
1038 'type' => 'checkbox',
1042 'key' => 'unsuspend-always_adjust_next_bill_date',
1043 'section' => 'billing',
1044 '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.',
1045 'type' => 'checkbox',
1049 'key' => 'usernamemin',
1050 'section' => 'username',
1051 'description' => 'Minimum username length (default 2)',
1056 'key' => 'usernamemax',
1057 'section' => 'username',
1058 'description' => 'Maximum username length',
1063 'key' => 'username-ampersand',
1064 'section' => 'username',
1065 '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.',
1066 'type' => 'checkbox',
1070 'key' => 'username-letter',
1071 'section' => 'username',
1072 'description' => 'Usernames must contain at least one letter',
1073 'type' => 'checkbox',
1077 'key' => 'username-letterfirst',
1078 'section' => 'username',
1079 'description' => 'Usernames must start with a letter',
1080 'type' => 'checkbox',
1084 'key' => 'username-noperiod',
1085 'section' => 'username',
1086 'description' => 'Disallow periods in usernames',
1087 'type' => 'checkbox',
1091 'key' => 'username-nounderscore',
1092 'section' => 'username',
1093 'description' => 'Disallow underscores in usernames',
1094 'type' => 'checkbox',
1098 'key' => 'username-nodash',
1099 'section' => 'username',
1100 'description' => 'Disallow dashes in usernames',
1101 'type' => 'checkbox',
1105 'key' => 'username-uppercase',
1106 'section' => 'username',
1107 'description' => 'Allow uppercase characters in usernames. Not recommended for use with FreeRADIUS with MySQL backend, which is case-insensitive by default.',
1108 'type' => 'checkbox',
1112 'key' => 'username-percent',
1113 'section' => 'username',
1114 'description' => 'Allow the percent character (%) in usernames.',
1115 'type' => 'checkbox',
1119 'key' => 'safe-part_bill_event',
1121 'description' => 'Validates invoice event expressions against a preset list. Useful for webdemos, annoying to powerusers.',
1122 'type' => 'checkbox',
1128 'description' => 'Turns on display/collection of social security numbers in the web interface. Sometimes required by electronic check (ACH) processors.',
1129 'type' => 'checkbox',
1133 'key' => 'show_stateid',
1135 'description' => "Turns on display/collection of driver's license/state issued id numbers in the web interface. Sometimes required by electronic check (ACH) processors.",
1136 'type' => 'checkbox',
1140 'key' => 'show_bankstate',
1142 'description' => "Turns on display/collection of state for bank accounts in the web interface. Sometimes required by electronic check (ACH) processors.",
1143 'type' => 'checkbox',
1147 'key' => 'agent_defaultpkg',
1149 'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
1150 'type' => 'checkbox',
1154 'key' => 'legacy_link',
1156 'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
1157 'type' => 'checkbox',
1161 'key' => 'legacy_link-steal',
1163 'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
1164 'type' => 'checkbox',
1168 'key' => 'queue_dangerous_controls',
1170 '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.',
1171 'type' => 'checkbox',
1175 'key' => 'security_phrase',
1176 'section' => 'password',
1177 'description' => 'Enable the tracking of a "security phrase" with each account. Not recommended, as it is vulnerable to social engineering.',
1178 'type' => 'checkbox',
1184 'description' => 'Message locale',
1186 'select_enum' => [ qw(en_US) ],
1190 'key' => 'signup_server-payby',
1192 'description' => 'Acceptable payment types for the signup server',
1193 'type' => 'selectmultiple',
1194 'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
1198 'key' => 'signup_server-default_agentnum',
1200 'description' => 'Default agent for the signup server',
1201 'type' => 'select-sub',
1202 'options_sub' => sub { require FS::Record;
1204 map { $_->agentnum => $_->agent }
1205 FS::Record::qsearch('agent', { disabled=>'' } );
1207 'option_sub' => sub { require FS::Record;
1209 my $agent = FS::Record::qsearchs(
1210 'agent', { 'agentnum'=>shift }
1212 $agent ? $agent->agent : '';
1217 'key' => 'signup_server-default_refnum',
1219 'description' => 'Default advertising source for the signup server',
1220 'type' => 'select-sub',
1221 'options_sub' => sub { require FS::Record;
1222 require FS::part_referral;
1223 map { $_->refnum => $_->referral }
1224 FS::Record::qsearch( 'part_referral',
1225 { 'disabled' => '' }
1228 'option_sub' => sub { require FS::Record;
1229 require FS::part_referral;
1230 my $part_referral = FS::Record::qsearchs(
1231 'part_referral', { 'refnum'=>shift } );
1232 $part_referral ? $part_referral->referral : '';
1237 'key' => 'signup_server-default_pkgpart',
1239 'description' => 'Default pakcage for the signup server',
1240 'type' => 'select-sub',
1241 'options_sub' => sub { require FS::Record;
1242 require FS::part_pkg;
1243 map { $_->pkgpart => $_->pkg.' - '.$_->comment }
1244 FS::Record::qsearch( 'part_pkg',
1248 'option_sub' => sub { require FS::Record;
1249 require FS::part_pkg;
1250 my $part_pkg = FS::Record::qsearchs(
1251 'part_pkg', { 'pkgpart'=>shift }
1254 ? $part_pkg->pkg.' - '.$part_pkg->comment
1260 'key' => 'show-msgcat-codes',
1262 'description' => 'Show msgcat codes in error messages. Turn this option on before reporting errors to the mailing list.',
1263 'type' => 'checkbox',
1267 'key' => 'signup_server-realtime',
1269 'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
1270 'type' => 'checkbox',
1273 'key' => 'signup_server-classnum2',
1275 'description' => 'Package Class for first optional purchase',
1276 'type' => 'select-sub',
1277 'options_sub' => sub { require FS::Record;
1278 require FS::pkg_class;
1279 map { $_->classnum => $_->classname }
1280 FS::Record::qsearch('pkg_class', {} );
1282 'option_sub' => sub { require FS::Record;
1283 require FS::pkg_class;
1284 my $pkg_class = FS::Record::qsearchs(
1285 'pkg_class', { 'classnum'=>shift }
1287 $pkg_class ? $pkg_class->classname : '';
1292 'key' => 'signup_server-classnum3',
1294 'description' => 'Package Class for second optional purchase',
1295 'type' => 'select-sub',
1296 'options_sub' => sub { require FS::Record;
1297 require FS::pkg_class;
1298 map { $_->classnum => $_->classname }
1299 FS::Record::qsearch('pkg_class', {} );
1301 'option_sub' => sub { require FS::Record;
1302 require FS::pkg_class;
1303 my $pkg_class = FS::Record::qsearchs(
1304 'pkg_class', { 'classnum'=>shift }
1306 $pkg_class ? $pkg_class->classname : '';
1311 'key' => 'backend-realtime',
1313 'description' => 'Run billing for backend signups immediately.',
1314 'type' => 'checkbox',
1318 'key' => 'declinetemplate',
1319 'section' => 'billing',
1320 'description' => 'Template file for credit card decline emails.',
1321 'type' => 'textarea',
1325 'key' => 'emaildecline',
1326 'section' => 'billing',
1327 'description' => 'Enable emailing of credit card decline notices.',
1328 'type' => 'checkbox',
1332 'key' => 'emaildecline-exclude',
1333 'section' => 'billing',
1334 'description' => 'List of error messages that should not trigger email decline notices, one per line.',
1335 'type' => 'textarea',
1339 'key' => 'cancelmessage',
1340 'section' => 'billing',
1341 'description' => 'Template file for cancellation emails.',
1342 'type' => 'textarea',
1346 'key' => 'cancelsubject',
1347 'section' => 'billing',
1348 'description' => 'Subject line for cancellation emails.',
1353 'key' => 'emailcancel',
1354 'section' => 'billing',
1355 'description' => 'Enable emailing of cancellation notices. Make sure to fill in the cancelmessage and cancelsubject configuration values as well.',
1356 'type' => 'checkbox',
1360 'key' => 'require_cardname',
1361 'section' => 'billing',
1362 'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
1363 'type' => 'checkbox',
1367 'key' => 'enable_taxclasses',
1368 'section' => 'billing',
1369 'description' => 'Enable per-package tax classes',
1370 'type' => 'checkbox',
1374 'key' => 'require_taxclasses',
1375 'section' => 'billing',
1376 'description' => 'Require a taxclass to be entered for every package',
1377 'type' => 'checkbox',
1381 'key' => 'welcome_email',
1383 '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>',
1384 'type' => 'textarea',
1389 'key' => 'welcome_email-from',
1391 'description' => 'From: address header for welcome email',
1397 'key' => 'welcome_email-subject',
1399 'description' => 'Subject: header for welcome email',
1405 'key' => 'welcome_email-mimetype',
1407 'description' => 'MIME type for welcome email',
1409 'select_enum' => [ 'text/plain', 'text/html' ],
1414 'key' => 'welcome_letter',
1416 '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>',
1417 'type' => 'textarea',
1421 'key' => 'warning_email',
1423 '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>',
1424 'type' => 'textarea',
1428 'key' => 'warning_email-from',
1430 'description' => 'From: address header for warning email',
1435 'key' => 'warning_email-cc',
1437 'description' => 'Additional recipient(s) (comma separated) for warning email when remaining usage reaches zero.',
1442 'key' => 'warning_email-subject',
1444 'description' => 'Subject: header for warning email',
1449 'key' => 'warning_email-mimetype',
1451 'description' => 'MIME type for warning email',
1453 'select_enum' => [ 'text/plain', 'text/html' ],
1458 'section' => 'billing',
1459 'description' => 'Available payment types.',
1460 'type' => 'selectmultiple',
1461 'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP) ],
1465 'key' => 'payby-default',
1467 'description' => 'Default payment type. HIDE disables display of billing information and sets customers to BILL.',
1469 'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP HIDE) ],
1473 'key' => 'paymentforcedtobatch',
1475 'description' => 'Causes per customer payment entry to be forced to a batch processor rather than performed realtime.',
1476 'type' => 'checkbox',
1480 'key' => 'svc_acct-notes',
1482 'description' => 'Extra HTML to be displayed on the Account View screen.',
1483 'type' => 'textarea',
1487 'key' => 'radius-password',
1489 'description' => 'RADIUS attribute for plain-text passwords.',
1491 'select_enum' => [ 'Password', 'User-Password' ],
1495 'key' => 'radius-ip',
1497 'description' => 'RADIUS attribute for IP addresses.',
1499 'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
1503 'key' => 'svc_acct-alldomains',
1505 '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.',
1506 'type' => 'checkbox',
1510 'key' => 'dump-scpdest',
1512 'description' => 'destination for scp database dumps: user@host:/path',
1517 'key' => 'dump-pgpid',
1519 '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.",
1524 'key' => 'cvv-save',
1525 'section' => 'billing',
1526 '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.',
1527 'type' => 'selectmultiple',
1528 'select_enum' => \@card_types,
1532 'key' => 'allow_negative_charges',
1533 'section' => 'billing',
1534 'description' => 'Allow negative charges. Normally not used unless importing data from a legacy system that requires this.',
1535 'type' => 'checkbox',
1538 'key' => 'auto_unset_catchall',
1540 '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.',
1541 'type' => 'checkbox',
1545 'key' => 'system_usernames',
1546 'section' => 'username',
1547 '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.',
1548 'type' => 'textarea',
1552 'key' => 'cust_pkg-change_svcpart',
1554 'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
1555 'type' => 'checkbox',
1559 'key' => 'disable_autoreverse',
1560 'section' => 'BIND',
1561 'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
1562 'type' => 'checkbox',
1566 'key' => 'svc_www-enable_subdomains',
1568 'description' => 'Enable selection of specific subdomains for virtual host creation.',
1569 'type' => 'checkbox',
1573 'key' => 'svc_www-usersvc_svcpart',
1575 'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
1576 'type' => 'textarea',
1580 'key' => 'selfservice_server-primary_only',
1582 'description' => 'Only allow primary accounts to access self-service functionality.',
1583 'type' => 'checkbox',
1587 'key' => 'card_refund-days',
1588 'section' => 'billing',
1589 'description' => 'After a payment, the number of days a refund link will be available for that payment. Defaults to 120.',
1594 'key' => 'agent-showpasswords',
1596 'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
1597 'type' => 'checkbox',
1601 'key' => 'global_unique-username',
1602 'section' => 'username',
1603 '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.',
1605 'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
1609 'key' => 'svc_external-skip_manual',
1611 '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).',
1612 'type' => 'checkbox',
1616 'key' => 'svc_external-display_type',
1618 'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
1620 'select_enum' => [ 'generic', 'artera_turbo', ],
1624 'key' => 'ticket_system',
1626 'description' => 'Ticketing system integration. <b>RT_Internal</b> uses the built-in RT ticketing system (see the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:RT_Installation">integrated ticketing installation instructions</a>). <b>RT_External</b> accesses an external RT installation in a separate database (local or remote).',
1628 #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
1629 'select_enum' => [ '', qw(RT_Internal RT_External) ],
1633 'key' => 'ticket_system-default_queueid',
1635 'description' => 'Default queue used when creating new customer tickets.',
1636 'type' => 'select-sub',
1637 'options_sub' => sub {
1638 my $conf = new FS::Conf;
1639 if ( $conf->config('ticket_system') ) {
1640 eval "use FS::TicketSystem;";
1642 FS::TicketSystem->queues();
1647 'option_sub' => sub {
1648 my $conf = new FS::Conf;
1649 if ( $conf->config('ticket_system') ) {
1650 eval "use FS::TicketSystem;";
1652 FS::TicketSystem->queue(shift);
1660 'key' => 'ticket_system-priority_reverse',
1662 'description' => 'Enable this to consider lower numbered priorities more important. A bad habit we picked up somewhere. You probably want to avoid it and use the default.',
1663 'type' => 'checkbox',
1667 'key' => 'ticket_system-custom_priority_field',
1669 'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
1674 'key' => 'ticket_system-custom_priority_field-values',
1676 'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
1677 'type' => 'textarea',
1681 'key' => 'ticket_system-custom_priority_field_queue',
1683 'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
1688 'key' => 'ticket_system-rt_external_datasrc',
1690 '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>',
1696 'key' => 'ticket_system-rt_external_url',
1698 'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
1703 'key' => 'company_name',
1704 'section' => 'required',
1705 'description' => 'Your company name',
1710 'key' => 'company_address',
1711 'section' => 'required',
1712 'description' => 'Your company address',
1713 'type' => 'textarea',
1717 'key' => 'address2-search',
1719 'description' => 'Enable a "Unit" search box which searches the second address field',
1720 'type' => 'checkbox',
1723 { 'key' => 'referral_credit',
1724 'section' => 'billing',
1725 'description' => "Enables one-time referral credits in the amount of one month <i>referred</i> customer's recurring fee (irregardless of frequency).",
1726 'type' => 'checkbox',
1729 { 'key' => 'selfservice_server-cache_module',
1731 '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.',
1733 'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
1739 '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).',
1740 'type' => [qw( checkbox textarea )],
1744 'key' => 'svc_acct-usage_suspend',
1745 'section' => 'billing',
1746 '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.',
1747 'type' => 'checkbox',
1751 'key' => 'svc_acct-usage_unsuspend',
1752 'section' => 'billing',
1753 '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.',
1754 'type' => 'checkbox',
1758 'key' => 'svc_acct-usage_threshold',
1759 'section' => 'billing',
1760 '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.',
1765 'key' => 'cust-fields',
1767 'description' => 'Which customer fields to display on reports by default',
1769 'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
1773 'key' => 'cust_pkg-display_times',
1775 'description' => 'Display full timestamps (not just dates) for customer packages. Useful if you are doing real-time things like hourly prepaid.',
1776 'type' => 'checkbox',
1780 'key' => 'svc_acct-edit_uid',
1781 'section' => 'shell',
1782 'description' => 'Allow UID editing.',
1783 'type' => 'checkbox',
1787 'key' => 'svc_acct-edit_gid',
1788 'section' => 'shell',
1789 'description' => 'Allow GID editing.',
1790 'type' => 'checkbox',
1794 'key' => 'zone-underscore',
1795 'section' => 'BIND',
1796 'description' => 'Allow underscores in zone names. As underscores are illegal characters in zone names, this option is not recommended.',
1797 'type' => 'checkbox',
1801 'key' => 'echeck-nonus',
1802 'section' => 'billing',
1803 'description' => 'Disable ABA-format account checking for Electronic Check payment info',
1804 'type' => 'checkbox',
1808 'key' => 'voip-cust_cdr_spools',
1810 'description' => 'Enable the per-customer option for individual CDR spools.',
1811 'type' => 'checkbox',
1815 'key' => 'svc_forward-arbitrary_dst',
1817 '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.",
1818 'type' => 'checkbox',
1822 'key' => 'tax-ship_address',
1823 'section' => 'billing',
1824 '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.',
1825 'type' => 'checkbox',
1829 'key' => 'batch-enable',
1830 'section' => 'billing',
1831 'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
1832 'type' => 'checkbox',
1836 'key' => 'batch-default_format',
1837 'section' => 'billing',
1838 'description' => 'Default format for batches.',
1840 'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch',
1841 'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
1847 'key' => 'batch-fixed_format-CARD',
1848 'section' => 'billing',
1849 'description' => 'Fixed (unchangeable) format for credit card batches.',
1851 'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
1852 'csv-chase_canada-E-xactBatch', 'BoM', 'PAP' ]
1856 'key' => 'batch-fixed_format-CHEK',
1857 'section' => 'billing',
1858 'description' => 'Fixed (unchangeable) format for electronic check batches.',
1860 'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP',
1866 'key' => 'batch-increment_expiration',
1867 'section' => 'billing',
1868 'description' => 'Increment expiration date years in batches until cards are current. Make sure this is acceptable to your batching provider before enabling.',
1869 'type' => 'checkbox'
1873 'key' => 'batchconfig-BoM',
1874 'section' => 'billing',
1875 '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',
1876 'type' => 'textarea',
1880 'key' => 'batchconfig-PAP',
1881 'section' => 'billing',
1882 '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',
1883 'type' => 'textarea',
1887 'key' => 'batchconfig-csv-chase_canada-E-xactBatch',
1888 'section' => 'billing',
1889 'description' => 'Gateway ID for Chase Canada E-xact batching',
1894 'key' => 'payment_history-years',
1896 'description' => 'Number of years of payment history to show by default. Currently defaults to 2.',
1901 'key' => 'cust_main-use_comments',
1903 'description' => 'Display free form comments on the customer edit screen. Useful as a scratch pad.',
1904 'type' => 'checkbox',
1908 'key' => 'cust_main-disable_notes',
1910 'description' => 'Disable new style customer notes - timestamped and user identified customer notes. Useful in tracking who did what.',
1911 'type' => 'checkbox',
1915 'key' => 'cust_main_note-display_times',
1917 'description' => 'Display full timestamps (not just dates) for customer notes.',
1918 'type' => 'checkbox',
1922 'key' => 'cust_main-ticket_statuses',
1924 'description' => 'Show tickets with these statuses on the customer view page.',
1925 'type' => 'selectmultiple',
1926 'select_enum' => [qw( new open stalled resolved rejected deleted )],
1930 'key' => 'cust_main-max_tickets',
1932 'description' => 'Maximum number of tickets to show on the customer view page.',
1937 'key' => 'cust_main-skeleton_tables',
1939 '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.',
1940 'type' => 'textarea',
1944 'key' => 'cust_main-skeleton_custnum',
1946 'description' => 'Customer number specifying the source data to copy into skeleton tables for new customers.',
1951 'key' => 'cust_main-enable_birthdate',
1953 'descritpion' => 'Enable tracking of a birth date with each customer record',
1954 'type' => 'checkbox',
1958 'key' => 'support-key',
1960 '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.',
1965 'key' => 'card-types',
1966 'section' => 'billing',
1967 'description' => 'Select one or more card types to enable only those card types. If no card types are selected, all card types are available.',
1968 'type' => 'selectmultiple',
1969 'select_enum' => \@card_types,
1973 'key' => 'disable-fuzzy',
1975 'description' => 'Disable fuzzy searching. Speeds up searching for large sites, but only shows exact matches.',
1976 'type' => 'checkbox',
1979 { 'key' => 'pkg_referral',
1981 'description' => 'Enable package-specific advertising sources.',
1982 'type' => 'checkbox',
1985 { 'key' => 'pkg_referral-multiple',
1987 'description' => 'In addition, allow multiple advertising sources to be associated with a single package.',
1988 'type' => 'checkbox',
1992 'key' => 'dashboard-toplist',
1994 'description' => 'List of items to display on the top of the front page',
1995 'type' => 'textarea',
1999 'key' => 'impending_recur_template',
2000 'section' => 'billing',
2001 '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>',
2002 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
2003 'type' => 'textarea',
2007 'key' => 'logo.png',
2008 'section' => 'billing', #?
2009 'description' => 'An image to include in some types of invoices',
2014 'key' => 'logo.eps',
2015 'section' => 'billing', #?
2016 'description' => 'An image to include in some types of invoices',
2021 'key' => 'selfservice-ignore_quantity',
2023 'description' => 'Ignores service quantity restrictions in self-service context. Strongly not recommended - just set your quantities correctly in the first place.',
2024 'type' => 'checkbox',
2028 'key' => 'selfservice-session_timeout',
2030 'description' => 'Self-service session timeout. Defaults to 1 hour.',
2032 'select_enum' => [ '1 hour', '2 hours', '4 hours', '8 hours', '1 day', '1 week', ],
2036 'key' => 'disable_setup_suspended_pkgs',
2037 'section' => 'billing',
2038 'description' => 'Disables charging of setup fees for suspended packages.',
2039 'type' => 'checkbox',
2043 'key' => 'password-generated-allcaps',
2044 'section' => 'password',
2045 'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
2046 'type' => 'checkbox',
2050 'key' => 'datavolume-forcemegabytes',
2052 'description' => 'All data volumes are expressed in megabytes',
2053 'type' => 'checkbox',
2057 'key' => 'datavolume-significantdigits',
2059 'description' => 'number of significant digits to use to represent data volumes',
2064 'key' => 'disable_void_after',
2065 'section' => 'billing',
2066 'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
2071 'key' => 'disable_line_item_date_ranges',
2072 'section' => 'billing',
2073 'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
2074 'type' => 'checkbox',
2078 'key' => 'support_packages',
2080 'description' => 'A list of packages eligible for RT ticket time transfer, one pkgpart per line.', #this should really be a select multiple, or specified in the packages themselves...
2081 'type' => 'textarea',
2085 'key' => 'cust_main-require_phone',
2087 'description' => 'Require daytime or night for all customer records.',
2088 'type' => 'checkbox',
2092 'key' => 'cust_main-require_invoicing_list_email',
2094 'description' => 'Require at least one invoicing email address for all customer records.',
2095 'type' => 'checkbox',
2099 'key' => 'svc_acct-display_paid_time_remaining',
2101 'description' => 'Show paid time remaining in addition to time remaining.',
2102 'type' => 'checkbox',