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