e1384bd4ce961c7e04834f11d5863fda7ca55c9a
[freeside.git] / FS / FS / Conf.pm
1 package FS::Conf;
2
3 use vars qw($default_dir @config_items $DEBUG );
4 use IO::File;
5 use File::Basename;
6 use FS::ConfItem;
7
8 $DEBUG = 0;
9
10 =head1 NAME
11
12 FS::Conf - Freeside configuration values
13
14 =head1 SYNOPSIS
15
16   use FS::Conf;
17
18   $conf = new FS::Conf "/config/directory";
19
20   $FS::Conf::default_dir = "/config/directory";
21   $conf = new FS::Conf;
22
23   $dir = $conf->dir;
24
25   $value = $conf->config('key');
26   @list  = $conf->config('key');
27   $bool  = $conf->exists('key');
28
29   $conf->touch('key');
30   $conf->set('key' => 'value');
31   $conf->delete('key');
32
33   @config_items = $conf->config_items;
34
35 =head1 DESCRIPTION
36
37 Read and write Freeside configuration values.  Keys currently map to filenames,
38 but this may change in the future.
39
40 =head1 METHODS
41
42 =over 4
43
44 =item new [ DIRECTORY ]
45
46 Create a new configuration object.  A directory arguement is required if
47 $FS::Conf::default_dir has not been set.
48
49 =cut
50
51 sub new {
52   my($proto,$dir) = @_;
53   my($class) = ref($proto) || $proto;
54   my($self) = { 'dir' => $dir || $default_dir } ;
55   bless ($self, $class);
56 }
57
58 =item dir
59
60 Returns the directory.
61
62 =cut
63
64 sub dir {
65   my($self) = @_;
66   my $dir = $self->{dir};
67   -e $dir or die "FATAL: $dir doesn't exist!";
68   -d $dir or die "FATAL: $dir isn't a directory!";
69   -r $dir or die "FATAL: Can't read $dir!";
70   -x $dir or die "FATAL: $dir not searchable (executable)!";
71   $dir =~ /^(.*)$/;
72   $1;
73 }
74
75 =item config KEY
76
77 Returns the configuration value or values (depending on context) for key.
78
79 =cut
80
81 sub config {
82   my($self,$file)=@_;
83   my($dir)=$self->dir;
84   my $fh = new IO::File "<$dir/$file" or return;
85   if ( wantarray ) {
86     map {
87       /^(.*)$/
88         or die "Illegal line (array context) in $dir/$file:\n$_\n";
89       $1;
90     } <$fh>;
91   } else {
92     <$fh> =~ /^(.*)$/
93       or die "Illegal line (scalar context) in $dir/$file:\n$_\n";
94     $1;
95   }
96 }
97
98 =item exists KEY
99
100 Returns true if the specified key exists, even if the corresponding value
101 is undefined.
102
103 =cut
104
105 sub exists {
106   my($self,$file)=@_;
107   my($dir) = $self->dir;
108   -e "$dir/$file";
109 }
110
111 =item touch KEY
112
113 Creates the specified configuration key if it does not exist.
114
115 =cut
116
117 sub touch {
118   my($self, $file) = @_;
119   my $dir = $self->dir;
120   unless ( $self->exists($file) ) {
121     warn "[FS::Conf] TOUCH $file\n" if $DEBUG;
122     system('touch', "$dir/$file");
123   }
124 }
125
126 =item set KEY VALUE
127
128 Sets the specified configuration key to the given value.
129
130 =cut
131
132 sub set {
133   my($self, $file, $value) = @_;
134   my $dir = $self->dir;
135   $value =~ /^(.*)$/s;
136   $value = $1;
137   unless ( $self->config($file) eq $value ) {
138     warn "[FS::Conf] SET $file\n" if $DEBUG;
139 #    warn "$dir" if is_tainted($dir);
140 #    warn "$dir" if is_tainted($file);
141     chmod 0644, "$dir/$file";
142     my $fh = new IO::File ">$dir/$file" or return;
143     chmod 0644, "$dir/$file";
144     print $fh "$value\n";
145   }
146 }
147 #sub is_tainted {
148 #             return ! eval { join('',@_), kill 0; 1; };
149 #         }
150
151 =item delete KEY
152
153 Deletes the specified configuration key.
154
155 =cut
156
157 sub delete {
158   my($self, $file) = @_;
159   my $dir = $self->dir;
160   if ( $self->exists($file) ) {
161     warn "[FS::Conf] DELETE $file\n";
162     unlink "$dir/$file";
163   }
164 }
165
166 =item config_items
167
168 Returns all of the possible configuration items as FS::ConfItem objects.  See
169 L<FS::ConfItem>.
170
171 =cut
172
173 sub config_items {
174   my $self = shift; 
175   #quelle kludge
176   @config_items,
177   map { new FS::ConfItem {
178                            'key'         => basename($_),
179                            'section'     => 'billing',
180                            'description' => 'Alternate template file for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
181                            'type'        => 'textarea',
182                          }
183       } glob($self->dir. '/invoice_template_*')
184   ;
185 }
186
187 =back
188
189 =head1 BUGS
190
191 If this was more than just crud that will never be useful outside Freeside I'd
192 worry that config_items is freeside-specific and icky.
193
194 =head1 SEE ALSO
195
196 "Configuration" in the web interface (config/config.cgi).
197
198 httemplate/docs/config.html
199
200 =cut
201
202 @config_items = map { new FS::ConfItem $_ } (
203
204   {
205     'key'         => 'address',
206     'section'     => 'deprecated',
207     'description' => 'This configuration option is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.',
208     'type'        => 'text',
209   },
210
211   {
212     'key'         => 'alerter_template',
213     'section'     => 'billing',
214     'description' => 'Template file for billing method expiration alerts.  See the <a href="../docs/billing.html#invoice_template">billing documentation</a> for details.',
215     'type'        => 'textarea',
216   },
217
218   {
219     'key'         => 'apacheroot',
220     'section'     => 'apache',
221     'description' => 'The directory containing Apache virtual hosts',
222     'type'        => 'text',
223   },
224
225   {
226     'key'         => 'apacheip',
227     'section'     => 'apache',
228     'description' => 'The current IP address to assign to new virtual hosts',
229     'type'        => 'text',
230   },
231
232   {
233     'key'         => 'apachemachine',
234     'section'     => 'apache',
235     'description' => '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.',
236     'type'        => 'text',
237   },
238
239   {
240     'key'         => 'apachemachines',
241     'section'     => 'apache',
242     'description' => 'Your 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.',
243     'type'        => 'textarea',
244   },
245
246   {
247     'key'         => 'bindprimary',
248     'section'     => 'BIND',
249     'description' => 'Your BIND primary nameserver.  This enables export of /var/named/named.conf and zone files into /var/named',
250     'type'        => 'text',
251   },
252
253   {
254     'key'         => 'bindsecondaries',
255     'section'     => 'BIND',
256     'description' => 'Your BIND secondary nameservers, one per line.  This enables export of /var/named/named.conf',
257     'type'        => 'textarea',
258   },
259
260   {
261     'key'         => 'business-onlinepayment',
262     'section'     => 'billing',
263     '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.',
264     'type'        => 'textarea',
265   },
266
267   {
268     'key'         => 'bsdshellmachines',
269     'section'     => 'shell',
270     'description' => 'Your BSD flavored shell (and mail) machines, one per line.  This enables export of `/etc/passwd\' and `/etc/master.passwd\'.',
271     'type'        => 'textarea',
272   },
273
274   {
275     'key'         => 'countrydefault',
276     'section'     => 'UI',
277     'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
278     'type'        => 'text',
279   },
280
281   {
282     'key'         => 'cybercash3.2',
283     'section'     => 'billing',
284     'description' => '<a href="http://www.cybercash.com/cashregister/">CyberCash Cashregister v3.2</a> support.  Two lines: the full path and name of your merchant_conf file, and the transaction type (`mauthonly\' or `mauthcapture\').',
285     'type'        => 'textarea',
286   },
287
288   {
289     'key'         => 'cyrus',
290     'section'     => 'mail',
291     'description' => 'Integration 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.',
292     'type'        => 'textarea',
293   },
294
295   {
296     'key'         => 'cp_app',
297     'section'     => 'mail',
298     'description' => 'Integration with <a href="http://www.cp.net/">Critial Path Account Provisioning Protocol</a>, four lines: "host:port", username, password, and workgroup (for new users).',
299     'type'        => 'textarea',
300   },
301
302   {
303     'key'         => 'deletecustomers',
304     'section'     => 'UI',
305     '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.',
306     'type'        => 'checkbox',
307   },
308
309   {
310     'key'         => 'deletepayments',
311     'section'     => 'UI',
312     'description' => 'Enable deletion of unclosed payments.  Be very careful!  Only delete payments that were data-entry errors, not adjustments. Optionally specify one or more comma-separated email addresses to be notified when a payment is deleted.',
313     'type'        => [qw( checkbox text )],
314   },
315
316   {
317     'key'         => 'dirhash',
318     'section'     => 'shell',
319     '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>',
320     'type'        => 'text',
321   },
322
323   {
324     'key'         => 'disable_customer_referrals',
325     'section'     => 'UI',
326     'description' => 'Disable new customer-to-customer referrals in the web interface',
327     'type'        => 'checkbox',
328   },
329
330   {
331     'key'         => 'domain',
332     'section'     => 'deprecated',
333     'description' => 'Your domain name.',
334     'type'        => 'text',
335   },
336
337   {
338     'key'         => 'editreferrals',
339     'section'     => 'UI',
340     'description' => 'Enable referral modification for existing customers',
341     'type'       => 'checkbox',
342   },
343
344   {
345     'key'         => 'emailinvoiceonly',
346     'section'     => 'billing',
347     'description' => 'Disables postal mail invoices',
348     'type'       => 'checkbox',
349   },
350
351   {
352     'key'         => 'disablepostalinvoicedefault',
353     'section'     => 'billing',
354     '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>.',
355     'type'       => 'checkbox',
356   },
357
358   {
359     'key'         => 'emailinvoiceauto',
360     'section'     => 'billing',
361     'description' => 'Automatically adds new accounts to the email invoice list upon customer creation',
362     'type'       => 'checkbox',
363   },
364
365   {
366     'key'         => 'erpcdmachines',
367     'section'     => '',
368     'description' => 'Your ERPCD authenticaion machines, one per line.  This enables export of `/usr/annex/acp_passwd\' and `/usr/annex/acp_dialup\'',
369     'type'        => 'textarea',
370   },
371
372   {
373     'key'         => 'hidecancelledpackages',
374     'section'     => 'UI',
375     'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
376     'type'        => 'checkbox',
377   },
378
379   {
380     'key'         => 'hidecancelledcustomers',
381     'section'     => 'UI',
382     'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
383     'type'        => 'checkbox',
384   },
385
386   {
387     'key'         => 'home',
388     'section'     => 'required',
389     'description' => 'For new users, prefixed to username to create a directory name.  Should have a leading but not a trailing slash.',
390     'type'        => 'text',
391   },
392
393   {
394     'key'         => 'icradiusmachines',
395     'section'     => 'radius',
396     'description' => 'Turn this option on to enable radcheck and radreply table population - by default in the Freeside database, or in the database specified by the <a href="http://rootwood.haze.st/aspside/config/config-view.cgi#icradius_secrets">icradius_secrets</a> config option (the radcheck and radreply tables needs to be created manually).  You do not need to use MySQL for your Freeside database to export to an ICRADIUS/FreeRADIUS MySQL database with this option.  <blockquote><b>ADDITIONAL DEPRECATED FUNCTIONALITY</b> (instead use <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Replication">MySQL replication</a> or point icradius_secrets to the external database) - your <a href="ftp://ftp.cheapnet.net/pub/icradius">ICRADIUS</a> machines or <a href="http://www.freeradius.org/">FreeRADIUS</a> (with MySQL authentication) machines, one per line.  Machines listed in this file will have the radcheck table exported to them.  Each line should contain four items, separted by whitespace: machine name, MySQL database name, MySQL username, and MySQL password.  For example: <CODE>"radius.isp.tld&nbsp;radius_db&nbsp;radius_user&nbsp;passw0rd"</CODE></blockquote>',
397     'type'        => [qw( checkbox textarea )],
398   },
399
400   {
401     'key'         => 'icradius_mysqldest',
402     'section'     => 'radius',
403     'description' => '<b>DEPRECATED</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) - Destination directory for the MySQL databases, on the ICRADIUS/FreeRADIUS machines.  Defaults to "/usr/local/var/".',
404     'type'        => 'text',
405   },
406
407   {
408     'key'         => 'icradius_mysqlsource',
409     'section'     => 'radius',
410     'description' => '<b>DEPRECATED</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) - Source directory for for the MySQL radcheck table files, on the Freeside machine.  Defaults to "/usr/local/var/freeside".',
411     'type'        => 'text',
412   },
413
414   {
415     'key'         => 'icradius_secrets',
416     'section'     => 'radius',
417     'description' => 'Optionally specifies a database for ICRADIUS/FreeRADIUS export.  Three lines: DBI data source, username and password.',
418     'type'        => 'textarea',
419   },
420
421   {
422     'key'         => 'invoice_from',
423     'section'     => 'required',
424     'description' => 'Return address on email invoices',
425     'type'        => 'text',
426   },
427
428   {
429     'key'         => 'invoice_template',
430     'section'     => 'required',
431     'description' => 'Required template file for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
432     'type'        => 'textarea',
433   },
434
435   {
436     'key'         => 'lpr',
437     'section'     => 'required',
438     'description' => 'Print command for paper invoices, for example `lpr -h\'',
439     'type'        => 'text',
440   },
441
442   {
443     'key'         => 'maildisablecatchall',
444     'section'     => 'deprecated',
445     '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.',
446     'type'        => 'checkbox',
447   },
448
449   {
450     'key'         => 'money_char',
451     'section'     => '',
452     'description' => 'Currency symbol - defaults to `$\'',
453     'type'        => 'text',
454   },
455
456   {
457     'key'         => 'mxmachines',
458     'section'     => 'deprecated',
459     'description' => 'MX entries for new domains, weight and machine, one per line, with trailing `.\'',
460     'type'        => 'textarea',
461   },
462
463   {
464     'key'         => 'nsmachines',
465     'section'     => 'deprecated',
466     'description' => 'NS nameservers for new domains, one per line, with trailing `.\'',
467     'type'        => 'textarea',
468   },
469
470   {
471     'key'         => 'defaultrecords',
472     'section'     => 'BIND',
473     'description' => 'DNS entries add automatically when creating a domain',
474     'type'        => 'editlist',
475     'editlist_parts' => [ { type=>'text' },
476                           { type=>'immutable', value=>'IN' },
477                           { type=>'select',
478                             select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS)} },
479                           { type=> 'text' }, ],
480   },
481
482   {
483     'key'         => 'arecords',
484     'section'     => 'deprecated',
485     'description' => 'A list of tab seperated CNAME records to add automatically when creating a domain',
486     'type'        => 'textarea',
487   },
488
489   {
490     'key'         => 'cnamerecords',
491     'section'     => 'deprecated',
492     'description' => 'A list of tab seperated CNAME records to add automatically when creating a domain',
493     'type'        => 'textarea',
494   },
495
496   {
497     'key'         => 'nismachines',
498     'section'     => 'shell',
499     'description' => 'Your NIS master (not slave master) machines, one per line.  This enables export of `/etc/global/passwd\' and `/etc/global/shadow\'.',
500     'type'        => 'textarea',
501   },
502
503   {
504     'key'         => 'passwordmin',
505     'section'     => 'password',
506     'description' => 'Minimum password length (default 6)',
507     'type'        => 'text',
508   },
509
510   {
511     'key'         => 'passwordmax',
512     'section'     => 'password',
513     'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
514     'type'        => 'text',
515   },
516
517   {
518     'key'         => 'qmailmachines',
519     'section'     => 'mail',
520     'description' => 'Your qmail machines, one per line.  This enables export of `/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.',
521     'type'        => [qw( checkbox textarea )],
522   },
523
524   {
525     'key'         => 'radiusmachines',
526     'section'     => 'radius',
527     'description' => 'Your RADIUS authentication machines, one per line.  This enables export of `/etc/raddb/users\'.',
528     'type'        => 'textarea',
529   },
530
531   {
532     'key'         => 'referraldefault',
533     'section'     => 'UI',
534     'description' => 'Default referral, specified by refnum',
535     'type'        => 'text',
536   },
537
538 #  {
539 #    'key'         => 'registries',
540 #    'section'     => 'required',
541 #    'description' => 'Directory which contains domain registry information.  Each registry is a directory.',
542 #  },
543
544   {
545     'key'         => 'report_template',
546     'section'     => 'required',
547     'description' => 'Required template file for reports.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
548     'type'        => 'textarea',
549   },
550
551
552   {
553     'key'         => 'maxsearchrecordsperpage',
554     'section'     => 'UI',
555     'description' => 'If set, number of search records to return per page.',
556     'type'        => 'text',
557   },
558
559   {
560     'key'         => 'sendmailconfigpath',
561     'section'     => 'mail',
562     'description' => 'Sendmail configuration file path.  Defaults to `/etc\'.  Many newer distributions use `/etc/mail\'.',
563     'type'        => 'text',
564   },
565
566   {
567     'key'         => 'sendmailmachines',
568     'section'     => 'mail',
569     'description' => 'Your sendmail machines, one per line.  This enables export of `/etc/virtusertable\' and `/etc/sendmail.cw\'.',
570     'type'        => 'textarea',
571   },
572
573   {
574     'key'         => 'sendmailrestart',
575     'section'     => 'mail',
576     'description' => 'If defined, the command which is run on sendmail machines after files are copied.',
577     'type'        => 'text',
578   },
579
580   {
581     'key'         => 'session-start',
582     'section'     => 'session',
583     '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.',
584     'type'        => 'text',
585   },
586
587   {
588     'key'         => 'session-stop',
589     'section'     => 'session',
590     '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.',
591     'type'        => 'text',
592   },
593
594   {
595     'key'         => 'shellmachine',
596     'section'     => 'shell',
597     'description' => '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.',
598     'type'        => 'text',
599   },
600
601   {
602     'key'         => 'shellmachine-useradd',
603     'section'     => 'shell',
604     'description' => 'The 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>.',
605     'type'        => [qw( checkbox text )],
606   },
607
608   {
609     'key'         => 'shellmachine-userdel',
610     'section'     => 'shell',
611     'description' => 'The 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>.',
612     'type'        => [qw( checkbox text )],
613   },
614
615   {
616     'key'         => 'shellmachine-usermod',
617     'section'     => 'shell',
618     'description' => 'The command(s) to run on shellmachine when an account is modified.  If the <b>shellmachine</b> option is set but this option is empty, <code>[ -d $old_dir ] &amp;&amp; mv $old_dir $new_dir || ( chmod u+t $old_dir; mkdir $new_dir; cd $old_dir; find . -depth -print | cpio -pdm $new_dir; chmod u-t $new_dir; chown -R $uid.$gid $new_dir; rm -rf $old_dir )</code> is the default.  Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$old_dir</code>, <code>$new_dir</code>, <code>$uid</code> and <code>$gid</code>.',
619     #'type'        => [qw( checkbox text )],
620     'type'        => 'text',
621   },
622
623   {
624     'key'         => 'shellmachines',
625     'section'     => 'shell',
626     'description' => 'Your Linux and System V flavored shell (and mail) machines, one per line.  This enables export of `/etc/passwd\' and `/etc/shadow\' files.',
627      'type'        => 'textarea',
628  },
629
630   {
631     'key'         => 'shells',
632     'section'     => 'required',
633     '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.',
634     'type'        => 'textarea',
635   },
636
637   {
638     'key'         => 'showpasswords',
639     'section'     => 'UI',
640     'description' => 'Display unencrypted user passwords in the web interface',
641     'type'        => 'checkbox',
642   },
643
644   {
645     'key'         => 'signupurl',
646     'section'     => 'UI',
647     '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',
648     'type'        => 'text',
649   },
650
651   {
652     'key'         => 'smtpmachine',
653     'section'     => 'required',
654     'description' => 'SMTP relay for Freeside\'s outgoing mail',
655     'type'        => 'text',
656   },
657
658   {
659     'key'         => 'soadefaultttl',
660     'section'     => 'BIND',
661     'description' => 'SOA default TTL for new domains.',
662     'type'        => 'text',
663   },
664
665   {
666     'key'         => 'soaemail',
667     'section'     => 'BIND',
668     'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
669     'type'        => 'text',
670   },
671
672   {
673     'key'         => 'soaexpire',
674     'section'     => 'BIND',
675     'description' => 'SOA expire for new domains',
676     'type'        => 'text',
677   },
678
679   {
680     'key'         => 'soamachine',
681     'section'     => 'BIND',
682     'description' => 'SOA machine for new domains, with trailing `.\'',
683     'type'        => 'text',
684   },
685
686   {
687     'key'         => 'soarefresh',
688     'section'     => 'BIND',
689     'description' => 'SOA refresh for new domains',
690     'type'        => 'text',
691   },
692
693   {
694     'key'         => 'soaretry',
695     'section'     => 'BIND',
696     'description' => 'SOA retry for new domains',
697     'type'        => 'text',
698   },
699
700   {
701     'key'         => 'statedefault',
702     'section'     => 'UI',
703     'description' => 'Default state or province (if not supplied, the default is `CA\')',
704     'type'        => 'text',
705   },
706
707   {
708     'key'         => 'radiusprepend',
709     'section'     => 'radius',
710     'description' => 'The contents will be prepended to the top of the RADIUS users file (text exports only).',
711     'type'        => 'textarea',
712   },
713
714   {
715     'key'         => 'textradiusprepend',
716     'section'     => 'deprecated',
717     'description' => '<b>DEPRECATED</b>, use RADIUS check attributes instead.  This option will be removed soon.  The contents will be prepended to the first line of a user\'s RADIUS entry in text exports.',
718     'type'        => 'text',
719   },
720
721   {
722     'key'         => 'unsuspendauto',
723     'section'     => 'billing',
724     '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',
725     'type'        => 'checkbox',
726   },
727
728   {
729     'key'         => 'usernamemin',
730     'section'     => 'username',
731     'description' => 'Minimum username length (default 2)',
732     'type'        => 'text',
733   },
734
735   {
736     'key'         => 'usernamemax',
737     'section'     => 'username',
738     'description' => 'Maximum username length',
739     'type'        => 'text',
740   },
741
742   {
743     'key'         => 'username-ampersand',
744     'section'     => 'username',
745     'description' => 'Allow the ampersand character (&amp;) in usernames.  Be careful when using this option in conjunction with <a href="#shellmachine-useradd">shellmachine-useradd</a> and other configuration options which execute shell commands, as the ampersand will be interpreted by the shell if not quoted.',
746     'type'        => 'checkbox',
747   },
748
749   {
750     'key'         => 'username-letter',
751     'section'     => 'username',
752     'description' => 'Usernames must contain at least one letter',
753     'type'        => 'checkbox',
754   },
755
756   {
757     'key'         => 'username-letterfirst',
758     'section'     => 'username',
759     'description' => 'Usernames must start with a letter',
760     'type'        => 'checkbox',
761   },
762
763   {
764     'key'         => 'username-noperiod',
765     'section'     => 'username',
766     'description' => 'Disallow periods in usernames',
767     'type'        => 'checkbox',
768   },
769
770   {
771     'key'         => 'username-uppercase',
772     'section'     => 'username',
773     'description' => 'Allow uppercase characters in usernames',
774     'type'        => 'checkbox',
775   },
776
777   {
778     'key'         => 'username_policy',
779     'section'     => '',
780     '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\'',
781     'type'        => 'select',
782     'select_enum' => [ 'prepend domsvc', 'append domsvc', 'append domain', 'append @domain' ],
783     #'type'        => 'text',
784   },
785
786   {
787     'key'         => 'vpopmailmachines',
788     'section'     => 'mail',
789     'description' => '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',
790     'type'        => 'textarea',
791   },
792
793   {
794     'key'         => 'vpopmailrestart',
795     'section'     => 'mail',
796     'description' => 'If defined, the shell commands to run on vpopmail machines after files are copied.  An example can be found in eg/vpopmailrestart of the source distribution.',
797     'type'        => 'textarea',
798   },
799
800   {
801     'key'         => 'safe-part_pkg',
802     'section'     => 'UI',
803     'description' => 'Validates package definition setup and recur expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
804     'type'        => 'checkbox',
805   },
806
807   {
808     'key'         => 'safe-part_bill_event',
809     'section'     => 'UI',
810     'description' => 'Validates invoice event expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
811     'type'        => 'checkbox',
812   },
813
814   {
815     'key'         => 'show_ss',
816     'section'     => 'UI',
817     'description' => 'Turns on display/collection of SS# in the web interface.',
818     'type'        => 'checkbox',
819   },
820
821   { 
822     'key'         => 'agent_defaultpkg',
823     'section'     => 'UI',
824     'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
825     'type'        => 'checkbox',
826   },
827
828   {
829     'key'         => 'legacy_link',
830     'section'     => 'UI',
831     'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
832     'type'        => 'checkbox',
833   },
834
835 );
836
837 1;
838