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