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