873ee75a975c5f6fcb92a09cd0126ebc942756f4
[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'     => 'depreciated',
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'         => 'apacheroot',
195     'section'     => 'apache',
196     'description' => 'The directory containing Apache virtual hosts',
197     'type'        => 'text',
198   },
199
200   {
201     'key'         => 'apachemachine',
202     'section'     => 'apache',
203     '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.',
204     'type'        => 'text',
205   },
206
207   {
208     'key'         => 'apachemachines',
209     'section'     => 'apache',
210     '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.',
211     'type'        => 'textarea',
212   },
213
214   {
215     'key'         => 'bindprimary',
216     'section'     => 'BIND',
217     'description' => 'Your BIND primary nameserver.  This enables export of /var/named/named.conf and zone files into /var/named',
218     'type'        => 'text',
219   },
220
221   {
222     'key'         => 'bindsecondaries',
223     'section'     => 'BIND',
224     'description' => 'Your BIND secondary nameservers, one per line.  This enables export of /var/named/named.conf',
225     'type'        => 'textarea',
226   },
227
228   {
229     'key'         => 'business-onlinepayment',
230     'section'     => 'billing',
231     '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.',
232     'type'        => 'textarea',
233   },
234
235   {
236     'key'         => 'bsdshellmachines',
237     'section'     => 'shell',
238     'description' => 'Your BSD flavored shell (and mail) machines, one per line.  This enables export of `/etc/passwd\' and `/etc/master.passwd\'.',
239     'type'        => 'textarea',
240   },
241
242   {
243     'key'         => 'countrydefault',
244     'section'     => 'UI',
245     'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
246     'type'        => 'text',
247   },
248
249   {
250     'key'         => 'cybercash3.2',
251     'section'     => 'billing',
252     '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\').',
253     'type'        => 'textarea',
254   },
255
256   {
257     'key'         => 'cyrus',
258     'section'     => 'mail',
259     '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.',
260     'type'        => 'textarea',
261   },
262
263   {
264     'key'         => 'deletecustomers',
265     'section'     => 'UI',
266     '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.',
267     'type'        => 'checkbox',
268   },
269
270   {
271     'key'         => 'deletepayments',
272     'section'     => 'UI',
273     'description' => 'Enable deletion of unclosed payments.  Be very careful!  Only delete payments that were data-entry errors, not adjustments.',
274     'type'        => 'checkbox',
275   },
276
277   {
278     'key'         => 'dirhash',
279     'section'     => 'shell',
280     '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>',
281     'type'        => 'text',
282   },
283
284   {
285     'key'         => 'disable_customer_referrals',
286     'section'     => 'UI',
287     'description' => 'Disable new customer-to-customer referrals in the web interface',
288     'type'        => 'checkbox',
289   },
290
291   {
292     'key'         => 'domain',
293     'section'     => 'depreciated',
294     'description' => 'Your domain name.',
295     'type'        => 'text',
296   },
297
298   {
299     'key'         => 'editreferrals',
300     'section'     => 'UI',
301     'description' => 'Enable referral modification for existing customers',
302     'type'       => 'checkbox',
303   },
304
305   {
306     'key'         => 'emailinvoiceonly',
307     'section'     => 'billing',
308     'description' => 'Disables postal mail invoices',
309     'type'       => 'checkbox',
310   },
311
312   {
313     'key'         => 'disablepostalinvoicedefault',
314     'section'     => 'billing',
315     '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>.',
316     'type'       => 'checkbox',
317   },
318
319   {
320     'key'         => 'emailinvoiceauto',
321     'section'     => 'billing',
322     'description' => 'Automatically adds new accounts to the email invoice list upon customer creation',
323     'type'       => 'checkbox',
324   },
325
326   {
327     'key'         => 'erpcdmachines',
328     'section'     => '',
329     'description' => 'Your ERPCD authenticaion machines, one per line.  This enables export of `/usr/annex/acp_passwd\' and `/usr/annex/acp_dialup\'',
330     'type'        => 'textarea',
331   },
332
333   {
334     'key'         => 'hidecancelledpackages',
335     'section'     => 'UI',
336     'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
337     'type'        => 'checkbox',
338   },
339
340   {
341     'key'         => 'hidecancelledcustomers',
342     'section'     => 'UI',
343     'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
344     'type'        => 'checkbox',
345   },
346
347   {
348     'key'         => 'home',
349     'section'     => 'required',
350     'description' => 'For new users, prefixed to username to create a directory name.  Should have a leading but not a trailing slash.',
351     'type'        => 'text',
352   },
353
354   {
355     'key'         => 'icradiusmachines',
356     'section'     => 'radius',
357     '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>',
358     'type'        => [qw( checkbox textarea )],
359   },
360
361   {
362     'key'         => 'icradius_mysqldest',
363     'section'     => 'radius',
364     '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/".',
365     'type'        => 'text',
366   },
367
368   {
369     'key'         => 'icradius_mysqlsource',
370     'section'     => 'radius',
371     '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".',
372     'type'        => 'text',
373   },
374
375   {
376     'key'         => 'icradius_secrets',
377     'section'     => 'radius',
378     'description' => 'Optionally specifies a database for ICRADIUS/FreeRADIUS export.  Three lines: DBI data source, username and password.',
379     'type'        => 'textarea',
380   },
381
382   {
383     'key'         => 'invoice_from',
384     'section'     => 'required',
385     'description' => 'Return address on email invoices',
386     'type'        => 'text',
387   },
388
389   {
390     'key'         => 'invoice_template',
391     'section'     => 'required',
392     'description' => 'Required template file for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
393     'type'        => 'textarea',
394   },
395
396   {
397     'key'         => 'lpr',
398     'section'     => 'required',
399     'description' => 'Print command for paper invoices, for example `lpr -h\'',
400     'type'        => 'text',
401   },
402
403   {
404     'key'         => 'maildisablecatchall',
405     'section'     => 'depreciated',
406     'description' => '<b>DEPRECIATED</b>, now the default.  Turning this option on used to disable the requirement that each virtual domain have a catch-all mailbox.',
407     'type'        => 'checkbox',
408   },
409
410   {
411     'key'         => 'money_char',
412     'section'     => '',
413     'description' => 'Currency symbol - defaults to `$\'',
414     'type'        => 'text',
415   },
416
417   {
418     'key'         => 'mxmachines',
419     'section'     => 'BIND',
420     'description' => 'MX entries for new domains, weight and machine, one per line, with trailing `.\'',
421     'type'        => 'textarea',
422   },
423
424   {
425     'key'         => 'nsmachines',
426     'section'     => 'BIND',
427     'description' => 'NS nameservers for new domains, one per line, with trailing `.\'',
428     'type'        => 'textarea',
429   },
430
431   {
432     'key'         => 'nismachines',
433     'section'     => 'shell',
434     'description' => 'Your NIS master (not slave master) machines, one per line.  This enables export of `/etc/global/passwd\' and `/etc/global/shadow\'.',
435     'type'        => 'textarea',
436   },
437
438   {
439     'key'         => 'passwordmin',
440     'section'     => 'password',
441     'description' => 'Minimum password length (default 6)',
442     'type'        => 'text',
443   },
444
445   {
446     'key'         => 'passwordmax',
447     'section'     => 'password',
448     'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
449     'type'        => 'text',
450   },
451
452   {
453     'key'         => 'qmailmachines',
454     'section'     => 'mail',
455     '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.',
456     'type'        => [qw( checkbox textarea )],
457   },
458
459   {
460     'key'         => 'radiusmachines',
461     'section'     => 'radius',
462     'description' => 'Your RADIUS authentication machines, one per line.  This enables export of `/etc/raddb/users\'.',
463     'type'        => 'textarea',
464   },
465
466   {
467     'key'         => 'referraldefault',
468     'section'     => 'UI',
469     'description' => 'Default referral, specified by refnum',
470     'type'        => 'text',
471   },
472
473 #  {
474 #    'key'         => 'registries',
475 #    'section'     => 'required',
476 #    'description' => 'Directory which contains domain registry information.  Each registry is a directory.',
477 #  },
478
479   {
480     'key'         => 'maxsearchrecordsperpage',
481     'section'     => 'UI',
482     'description' => 'If set, number of search records to return per page.',
483     'type'        => 'text',
484   },
485
486   {
487     'key'         => 'sendmailconfigpath',
488     'section'     => 'mail',
489     'description' => 'Sendmail configuration file path.  Defaults to `/etc\'.  Many newer distributions use `/etc/mail\'.',
490     'type'        => 'text',
491   },
492
493   {
494     'key'         => 'sendmailmachines',
495     'section'     => 'mail',
496     'description' => 'Your sendmail machines, one per line.  This enables export of `/etc/virtusertable\' and `/etc/sendmail.cw\'.',
497     'type'        => 'textarea',
498   },
499
500   {
501     'key'         => 'sendmailrestart',
502     'section'     => 'mail',
503     'description' => 'If defined, the command which is run on sendmail machines after files are copied.',
504     'type'        => 'text',
505   },
506
507   {
508     'key'         => 'session-start',
509     'section'     => 'session',
510     '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.',
511     'type'        => 'text',
512   },
513
514   {
515     'key'         => 'session-stop',
516     'section'     => 'session',
517     '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.',
518     'type'        => 'text',
519   },
520
521   {
522     'key'         => 'shellmachine',
523     'section'     => 'shell',
524     '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.',
525     'type'        => 'text',
526   },
527
528   {
529     'key'         => 'shellmachine-useradd',
530     'section'     => 'shell',
531     '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>.',
532     'type'        => [qw( checkbox text )],
533   },
534
535   {
536     'key'         => 'shellmachine-userdel',
537     'section'     => 'shell',
538     '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>.',
539     'type'        => [qw( checkbox text )],
540   },
541
542   {
543     'key'         => 'shellmachine-usermod',
544     'section'     => 'shell',
545     '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>.',
546     #'type'        => [qw( checkbox text )],
547     'type'        => 'text',
548   },
549
550   {
551     'key'         => 'shellmachines',
552     'section'     => 'shell',
553     'description' => 'Your Linux and System V flavored shell (and mail) machines, one per line.  This enables export of `/etc/passwd\' and `/etc/shadow\' files.',
554      'type'        => 'textarea',
555  },
556
557   {
558     'key'         => 'shells',
559     'section'     => 'required',
560     '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.',
561     'type'        => 'textarea',
562   },
563
564   {
565     'key'         => 'showpasswords',
566     'section'     => 'UI',
567     'description' => 'Display unencrypted user passwords in the web interface',
568     'type'        => 'checkbox',
569   },
570
571   {
572     'key'         => 'signupurl',
573     'section'     => 'UI',
574     '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',
575     'type'        => 'text',
576   },
577
578   {
579     'key'         => 'smtpmachine',
580     'section'     => 'required',
581     'description' => 'SMTP relay for Freeside\'s outgoing mail',
582     'type'        => 'text',
583   },
584
585   {
586     'key'         => 'soadefaultttl',
587     'section'     => 'BIND',
588     'description' => 'SOA default TTL for new domains.',
589     'type'        => 'text',
590   },
591
592   {
593     'key'         => 'soaemail',
594     'section'     => 'BIND',
595     'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
596     'type'        => 'text',
597   },
598
599   {
600     'key'         => 'soaexpire',
601     'section'     => 'BIND',
602     'description' => 'SOA expire for new domains',
603     'type'        => 'text',
604   },
605
606   {
607     'key'         => 'soamachine',
608     'section'     => 'BIND',
609     'description' => 'SOA machine for new domains, with trailing `.\'',
610     'type'        => 'text',
611   },
612
613   {
614     'key'         => 'soarefresh',
615     'section'     => 'BIND',
616     'description' => 'SOA refresh for new domains',
617     'type'        => 'text',
618   },
619
620   {
621     'key'         => 'soaretry',
622     'section'     => 'BIND',
623     'description' => 'SOA retry for new domains',
624     'type'        => 'text',
625   },
626
627   {
628     'key'         => 'statedefault',
629     'section'     => 'UI',
630     'description' => 'Default state or province (if not supplied, the default is `CA\')',
631     'type'        => 'text',
632   },
633
634   {
635     'key'         => 'radiusprepend',
636     'section'     => 'radius',
637     'description' => 'The contents will be prepended to the top of the RADIUS users file (text exports only).',
638     'type'        => 'textarea',
639   },
640
641   {
642     'key'         => 'textradiusprepend',
643     'section'     => 'depreciated',
644     'description' => '<b>DEPRECIATED</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.',
645     'type'        => 'text',
646   },
647
648   {
649     'key'         => 'unsuspendauto',
650     'section'     => 'billing',
651     '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',
652     'type'        => 'checkbox',
653   },
654
655   {
656     'key'         => 'usernamemin',
657     'section'     => 'username',
658     'description' => 'Minimum username length (default 2)',
659     'type'        => 'text',
660   },
661
662   {
663     'key'         => 'usernamemax',
664     'section'     => 'username',
665     'description' => 'Maximum username length',
666     'type'        => 'text',
667   },
668
669   {
670     'key'         => 'username-ampersand',
671     'section'     => 'username',
672     '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.',
673     'type'        => 'checkbox',
674   },
675
676   {
677     'key'         => 'username-letter',
678     'section'     => 'username',
679     'description' => 'Usernames must contain at least one letter',
680     'type'        => 'checkbox',
681   },
682
683   {
684     'key'         => 'username-letterfirst',
685     'section'     => 'username',
686     'description' => 'Usernames must start with a letter',
687     'type'        => 'checkbox',
688   },
689
690   {
691     'key'         => 'username-noperiod',
692     'section'     => 'username',
693     'description' => 'Disallow periods in usernames',
694     'type'        => 'checkbox',
695   },
696
697   {
698     'key'         => 'username-uppercase',
699     'section'     => 'username',
700     'description' => 'Allow uppercase characters in usernames',
701     'type'        => 'checkbox',
702   },
703
704   {
705     'key'         => 'username_policy',
706     'section'     => '',
707     '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\' or \'append domain\'',
708 #    'type'        => 'select',
709     'type'        => 'text',
710   },
711
712   {
713     'key'         => 'vpopmailmachines',
714     'section'     => 'mail',
715     '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',
716     'type'        => 'textarea',
717   },
718
719 );
720
721 1;
722