working message catalogs (not used for enough yet)
[freeside.git] / fs_signup / FS-SignupClient / cgi / signup.cgi
1 #!/usr/bin/perl -Tw
2 #
3 # $Id: signup.cgi,v 1.19 2002-04-07 05:56:08 ivan Exp $
4
5 use strict;
6 use vars qw( @payby $cgi $locales $packages $pops $init_data $error
7              $last $first $ss $company $address1 $address2 $city $state $county
8              $country $zip $daytime $night $fax $invoicing_list $payby $payinfo
9              $paydate $payname $referral_custnum
10              $pkgpart $username $password $password2 $sec_phrase $popnum
11              $ieak_file $ieak_template $cck_file $cck_template
12              $signup_html $signup_template $success_html $success_template
13              $ac $exch $loc
14              $self_url
15            );
16 use subs qw( print_form print_okay expselect signup_default success_default );
17 use CGI;
18 use CGI::Carp qw(fatalsToBrowser);
19 use Text::Template;
20 use Business::CreditCard;
21 use HTTP::Headers::UserAgent 2.00;
22 use FS::SignupClient 0.03 qw( signup_info new_customer );
23
24 #acceptable payment methods
25 #
26 #@payby = qw( CARD BILL COMP );
27 #@payby = qw( CARD BILL );
28 #@payby = qw( CARD );
29 @payby = qw( CARD PREPAY );
30
31 $ieak_file = '/usr/local/freeside/ieak.template';
32 $cck_file = '/usr/local/freeside/cck.template';
33 $signup_html = '/usr/local/freeside/signup.html';
34 $success_html = '/usr/local/freeside/success.html';
35
36 if ( -e $ieak_file ) {
37   my $ieak_txt = Text::Template::_load_text($ieak_file)
38     or die $Text::Template::ERROR;
39   $ieak_txt =~ /^(.*)$/s; #untaint the template source - it's trusted
40   $ieak_txt = $1;
41   $ieak_template = new Text::Template ( TYPE => 'STRING', SOURCE => $ieak_txt )
42     or die $Text::Template::ERROR;
43 } else {
44   $ieak_template = '';
45 }
46
47 if ( -e $cck_file ) {
48   my $cck_txt = Text::Template::_load_text($cck_file)
49     or die $Text::Template::ERROR;
50   $cck_txt =~ /^(.*)$/s; #untaint the template source - it's trusted
51   $cck_txt = $1;
52   $cck_template = new Text::Template ( TYPE => 'STRING', SOURCE => $cck_txt )
53     or die $Text::Template::ERROR;
54 } else {
55   $cck_template = '';
56 }
57
58 if ( -e $signup_html ) {
59   my $signup_txt = Text::Template::_load_text($signup_html)
60     or die $Text::Template::ERROR;
61   $signup_txt =~ /^(.*)$/s; #untaint the template source - it's trusted
62   $signup_txt = $1;
63   $signup_template = new Text::Template ( TYPE => 'STRING',
64                                           SOURCE => $signup_txt,
65                                           DELIMITERS => [ '<%=', '%>' ]
66                                         )
67     or die $Text::Template::ERROR;
68 } else {
69   $signup_template = new Text::Template ( TYPE => 'STRING',
70                                           SOURCE => &signup_default,
71                                           DELIMITERS => [ '<%=', '%>' ]
72                                         )
73     or die $Text::Template::ERROR;
74 }
75
76 if ( -e $success_html ) {
77   my $success_txt = Text::Template::_load_text($success_html)
78     or die $Text::Template::ERROR;
79   $success_txt =~ /^(.*)$/s; #untaint the template source - it's trusted
80   $success_txt = $1;
81   $success_template = new Text::Template ( TYPE => 'STRING',
82                                            SOURCE => $success_txt,
83                                            DELIMITERS => [ '<%=', '%>' ],
84                                          )
85     or die $Text::Template::ERROR;
86 } else {
87   $success_template = new Text::Template ( TYPE => 'STRING',
88                                            SOURCE => &success_default,
89                                            DELIMITERS => [ '<%=', '%>' ],
90                                          )
91     or die $Text::Template::ERROR;
92 }
93
94 ( $locales, $packages, $pops, $init_data ) = signup_info();
95 @payby = @{$init_data->{'payby'}} if @{$init_data->{'payby'}};
96
97 $cgi = new CGI;
98
99 if ( defined $cgi->param('magic') ) {
100   if ( $cgi->param('magic') eq 'process' ) {
101
102     $cgi->param('state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/
103       or die "Oops, illegal \"state\" param: ". $cgi->param('state');
104     $state = $1;
105     $county = $3 || '';
106     $country = $4;
107
108     $payby = $cgi->param('payby');
109     $payinfo = $cgi->param( $payby. '_payinfo' );
110     $paydate =
111       $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' );
112     $payname = $cgi->param( $payby. '_payname' );
113
114     if ( $invoicing_list = $cgi->param('invoicing_list') ) {
115       $invoicing_list .= ', POST' if $cgi->param('invoicing_list_POST');
116     } else {
117       $invoicing_list = 'POST';
118     }
119
120     $error = '';
121
122     if ( $cgi->param('_password') ne $cgi->param('_password2') ) {
123       $error = $init_data->{msgcat}{passwords_dont_match}; #msgcat
124       $password  = '';
125       $password2 = '';
126     } else {
127       $password2 = $cgi->param('_password2');
128
129       if ( $payby eq 'CARD' && $cgi->param('CARD_type') ) {
130         $payinfo =~ s/\D//g;
131
132         $payinfo =~ /^(\d{13,16})$/
133           or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo;
134         $payinfo = $1;
135         validate($payinfo)
136           or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo;
137         cardtype($payinfo) eq $cgi->param('CARD_type')
138           or $error ||= $init_data->{msgcat}{not_a}. $cgi->param('CARD_type');
139       }
140
141       $error ||= new_customer ( {
142         'last'             => $last             = $cgi->param('last'),
143         'first'            => $first            = $cgi->param('first'),
144         'ss'               => $ss               = $cgi->param('ss'),
145         'company'          => $company          = $cgi->param('company'),
146         'address1'         => $address1         = $cgi->param('address1'),
147         'address2'         => $address2         = $cgi->param('address2'),
148         'city'             => $city             = $cgi->param('city'),
149         'county'           => $county,
150         'state'            => $state,
151         'zip'              => $zip              = $cgi->param('zip'),
152         'country'          => $country,
153         'daytime'          => $daytime          = $cgi->param('daytime'),
154         'night'            => $night            = $cgi->param('night'),
155         'fax'              => $fax              = $cgi->param('fax'),
156         'payby'            => $payby,
157         'payinfo'          => $payinfo,
158         'paydate'          => $paydate,
159         'payname'          => $payname,
160         'invoicing_list'   => $invoicing_list,
161         'referral_custnum' => $referral_custnum = $cgi->param('ref'),
162         'pkgpart'          => $pkgpart          = $cgi->param('pkgpart'),
163         'username'         => $username         = $cgi->param('username'),
164         'sec_phrase'       => $sec_phrase       = $cgi->param('sec_phrase'),
165         '_password'        => $password         = $cgi->param('_password'),
166         'popnum'           => $popnum           = $cgi->param('popnum'),
167       } );
168
169     }
170     
171     if ( $error ) {
172       print_form();
173     } else {
174       print_okay();
175     }
176
177   } else {
178     die "unrecognized magic: ". $cgi->param('magic');
179   }
180 } else {
181   $error = '';
182   $last = '';
183   $first = '';
184   $ss = '';
185   $company = '';
186   $address1 = '';
187   $address2 = '';
188   $city = '';
189   $state = '';
190   $county = '';
191   $country = '';
192   $zip = '';
193   $daytime = '';
194   $night = '';
195   $fax = '';
196   $invoicing_list = '';
197   $payby = '';
198   $payinfo = '';
199   $paydate = '';
200   $payname = '';
201   $pkgpart = '';
202   $username = '';
203   $password = '';
204   $password2 = '';
205   $sec_phrase = '';
206   $popnum = '';
207   $referral_custnum = $cgi->param('ref') || '';
208   print_form;
209 }
210
211 sub print_form {
212
213   $cgi->delete('ref');
214   $self_url = $cgi->self_url;
215
216   $error = "Error: $error" if $error;
217
218   print $cgi->header( '-expires' => 'now' ),
219         $signup_template->fill_in();
220
221 }
222
223 sub print_okay {
224   my $user_agent = new HTTP::Headers::UserAgent $ENV{HTTP_USER_AGENT};
225
226   $cgi->param('username') =~ /^(.+)$/
227     or die "fatal: invalid username got past FS::SignupClient::new_customer";
228   my $username = $1;
229   $cgi->param('_password') =~ /^(.+)$/
230     or die "fatal: invalid password got past FS::SignupClient::new_customer";
231   my $password = $1;
232   ( $cgi->param('first'). ' '. $cgi->param('last') ) =~ /^(.*)$/
233     or die "fatal: invalid email_name got past FS::SignupCLient::new_customer";
234   my $email_name = $1;
235
236   my $pop = pop_info($cgi->param('popnum'))
237     or die "fatal: invalid popnum got past FS::SignupClient::new_customer";
238   ( $ac, $exch, $loc ) = ( $pop->{'ac'}, $pop->{'exch'}, $pop->{'loc'} );
239
240   if ( $ieak_template
241        && $user_agent->platform eq 'ia32'
242        && $user_agent->os =~ /^win/
243        && ($user_agent->browser)[0] eq 'IE'
244      )
245   { #send an IEAK config
246     print $cgi->header('application/x-Internet-signup'),
247           $ieak_template->fill_in();
248   } elsif ( $cck_template
249             && $user_agent->platform eq 'ia32'
250             && $user_agent->os =~ /^win/
251             && ($user_agent->browser)[0] eq 'Netscape'
252           )
253   { #send a Netscape config
254     my $cck_data = $cck_template->fill_in();
255     print $cgi->header('application/x-netscape-autoconfigure-dialer-v2'),
256           map {
257             m/(.*)\s+(.*)$/;
258             pack("N", length($1)). $1. pack("N", length($2)). $2;
259           } split(/\n/, $cck_data);
260
261   } else { #send a simple confirmation
262     print $cgi->header( '-expires' => 'now' ),
263           $success_template->fill_in();
264   }
265 }
266
267 sub pop_info {
268   my $popnum = shift;
269   my $pop;
270   foreach $pop ( @{$pops} ) {
271     if ( $pop->{'popnum'} == $popnum ) { return $pop; }
272   }
273   '';
274 }
275
276 #horrible false laziness with FS/FS/svc_acct_pop.pm::popselector
277 sub popselector {
278   my( $popnum, $state ) = @_;
279
280   my %pop = ();
281   push @{ $pop{$_->{state}} }, $_ foreach @$pops;
282
283   my $text = <<END;
284     <SCRIPT>
285     function opt(what,href,text) {
286       var optionName = new Option(text, href, false, false)
287       var length = what.length;
288       what.options[length] = optionName;
289     }
290     
291     function popstate_changed(what) {
292       state = what.options[what.selectedIndex].text;
293       for (var i = what.form.popnum.length;i > 0;i--)
294                 what.form.popnum.options[i] = null;
295       what.form.popnum.options[0] = new Option("", "", false, true);
296 END
297
298   foreach my $popstate ( sort { $a cmp $b } keys %pop ) {
299     $text .= "\nif ( state == \"$popstate\" ) {\n";
300
301     foreach my $pop ( @{$pop{$popstate}}) {
302       my $o_popnum = $pop->{popnum};
303       my $poptext =  $pop->{city}. ', '. $pop->{state}.
304                      ' ('. $pop->{ac}. ')/'. $pop->{exch};
305
306       $text .= "opt(what.form.popnum, \"$o_popnum\", \"$poptext\");\n"
307     }
308     $text .= "}\n";
309   }
310
311   $text .= "}\n</SCRIPT>\n";
312
313   $text .=
314     qq!<SELECT NAME="popstate" SIZE=1 onChange="popstate_changed(this)">!.
315     qq!<OPTION> !;
316   $text .= "<OPTION>$_" foreach sort { $a cmp $b } keys %pop;
317   $text .= '</SELECT>'; #callback? return 3 html pieces?  #'</TD><TD>';
318
319   $text .= qq!<SELECT NAME="popnum" SIZE=1><OPTION> !;
320   foreach my $pop ( @$pops ) {
321     $text .= qq!<OPTION VALUE="!. $pop->{popnum}. '"'.
322              ( ( $popnum && $pop->{popnum} == $popnum ) ? ' SELECTED' : '' ). ">".
323              $pop->{city}. ', '. $pop->{state}.
324                ' ('. $pop->{ac}. ')/'. $pop->{exch};
325   }
326   $text .= '</SELECT>';
327
328   $text;
329 }
330
331 sub expselect {
332   my $prefix = shift;
333   my $date = shift || '';
334   my( $m, $y ) = ( 0, 0 );
335   if ( $date  =~ /^(\d{4})-(\d{2})-\d{2}$/ ) { #PostgreSQL date format
336     ( $m, $y ) = ( $2, $1 );
337   } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
338     ( $m, $y ) = ( $1, $3 );
339   }
340   my $return = qq!<SELECT NAME="$prefix!. qq!_month" SIZE="1">!;
341   for ( 1 .. 12 ) {
342     $return .= "<OPTION";
343     $return .= " SELECTED" if $_ == $m;
344     $return .= ">$_";
345   }
346   $return .= qq!</SELECT>/<SELECT NAME="$prefix!. qq!_year" SIZE="1">!;
347   for ( 2001 .. 2037 ) {
348     $return .= "<OPTION";
349     $return .= " SELECTED" if $_ == $y;
350     $return .= ">$_";
351   }
352   $return .= "</SELECT>";
353
354   $return;
355 }
356
357 sub success_default { #html to use if you don't specify a success file
358   <<'END';
359 <HTML><HEAD><TITLE>Signup successful</TITLE></HEAD>
360 <BODY BGCOLOR="#e8e8e8"><FONT SIZE=7>Signup successful</FONT><BR><BR>
361 Thanks for signing up!
362 </BODY></HTML>
363 END
364 }
365
366 sub signup_default { #html to use if you don't specify a template file
367   <<'END';
368 <HTML><HEAD><TITLE>ISP Signup form</TITLE></HEAD>
369 <BODY BGCOLOR="#e8e8e8"><FONT SIZE=7>ISP Signup form</FONT><BR><BR>
370 <FONT SIZE="+1" COLOR="#ff0000"><%= $error %></FONT>
371 <FORM ACTION="<%= $self_url %>" METHOD=POST>
372 <INPUT TYPE="hidden" NAME="magic" VALUE="process">
373 <INPUT TYPE="hidden" NAME="ref" VALUE="<%= $referral_custnum %>">
374 <INPUT TYPE="hidden" NAME="ss" VALUE="">
375 Contact Information
376 <TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=0 WIDTH="100%">
377 <TR>
378   <TH ALIGN="right"><font color="#ff0000">*</font>Contact name<BR>(last, first)</TH>
379   <TD COLSPAN=5><INPUT TYPE="text" NAME="last" VALUE="<%= $last %>">,
380                 <INPUT TYPE="text" NAME="first" VALUE="<%= $first %>"></TD>
381 </TR>
382 <TR>
383   <TD ALIGN="right">Company</TD>
384   <TD COLSPAN=5><INPUT TYPE="text" NAME="company" SIZE=70 VALUE="<%= $company %>"></TD>
385 </TR>
386 <TR>
387   <TH ALIGN="right"><font color="#ff0000">*</font>Address</TH>
388   <TD COLSPAN=5><INPUT TYPE="text" NAME="address1" SIZE=70 VALUE="<%= $address1 %>"></TD>
389 </TR>
390 <TR>
391   <TD ALIGN="right">&nbsp;</TD>
392   <TD COLSPAN=5><INPUT TYPE="text" NAME="address2" SIZE=70 VALUE="<%= $address2 %>"></TD>
393 </TR>
394 <TR>
395   <TH ALIGN="right"><font color="#ff0000">*</font>City</TH>
396   <TD><INPUT TYPE="text" NAME="city" VALUE="<%= $city %>"></TD>
397   <TH ALIGN="right"><font color="#ff0000">*</font>State/Country</TH>
398   <TD><SELECT NAME="state" SIZE="1">
399
400   <%=
401     foreach ( @{$locales} ) {
402       $OUT .= '<OPTION';
403       $OUT .= ' SELECTED' if ( $state eq $_->{'state'}
404                                && $county eq $_->{'county'}
405                                && $country eq $_->{'country'}
406                              );
407       $OUT .= '>'. $_->{'state'};
408       $OUT .= ' ('. $_->{'county'}. ')' if $_->{'county'};
409       $OUT .= ' / '. $_->{'country'};
410     }
411   %>
412
413   </SELECT></TD>
414   <TH><font color="#ff0000">*</font>Zip</TH>
415   <TD><INPUT TYPE="text" NAME="zip" SIZE=10 VALUE="<%= $zip %>"></TD>
416 </TR>
417 <TR>
418   <TD ALIGN="right">Day Phone</TD>
419   <TD COLSPAN=5><INPUT TYPE="text" NAME="daytime" VALUE="<%= $daytime %>" SIZE=18></TD>
420 </TR>
421 <TR>
422   <TD ALIGN="right">Night Phone</TD>
423   <TD COLSPAN=5><INPUT TYPE="text" NAME="night" VALUE="<%= $night %>" SIZE=18></TD>
424 </TR>
425 <TR>
426   <TD ALIGN="right">Fax</TD>
427   <TD COLSPAN=5><INPUT TYPE="text" NAME="fax" VALUE="<%= $fax %>" SIZE=12></TD>
428 </TR>
429 </TABLE><font color="#ff0000">*</font> required fields<BR>
430 <BR>Billing information<TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=0 WIDTH="100%">
431 <TR><TD>
432
433   <%=
434     $OUT .= '<INPUT TYPE="checkbox" NAME="invoicing_list_POST" VALUE="POST"';
435     my @invoicing_list = split(', ', $invoicing_list );
436     $OUT .= ' CHECKED'
437       if ! @invoicing_list || grep { $_ eq 'POST' } @invoicing_list;
438     $OUT .= '>';
439   %>
440
441   Postal mail invoice
442 </TD></TR>
443 <TR><TD>Email invoice <INPUT TYPE="text" NAME="invoicing_list" VALUE="<%= join(', ', grep { $_ ne 'POST' } split(', ', $invoicing_list ) ) %>">
444 </TD></TR>
445 <%= scalar(@payby) > 1 ? '<TR><TD>Billing type</TD></TR>' : '' %>
446 </TABLE>
447 <TABLE BGCOLOR="#c0c0c0" BORDER=1 WIDTH="100%">
448 <TR>
449
450   <%=
451
452     my $cardselect = '<SELECT NAME="CARD_type"><OPTION></OPTION>';
453     my %types = (
454                   'VISA' => 'VISA card',
455                   'MasterCard' => 'MasterCard',
456                   'Discover' => 'Discover card',
457                   'American Express' => 'American Express card',
458                 );
459     foreach ( keys %types ) {
460       $selected = $cgi->param('CARD_type') eq $types{$_} ? 'SELECTED' : '';
461       $cardselect .= qq!<OPTION $selected VALUE="$types{$_}">$_</OPTION>!;
462     }
463     $cardselect .= '</SELECT>';
464   
465     my %payby = (
466       'CARD' => qq!Credit card<BR><font color="#ff0000">*</font>$cardselect<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="" MAXLENGTH=19><BR><font color="#ff0000">*</font>Exp !. expselect("CARD"). qq!<BR><font color="#ff0000">*</font>Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="">!,
467       'BILL' => qq!Billing<BR>P.O. <INPUT TYPE="text" NAME="BILL_payinfo" VALUE=""><BR><font color="#ff0000">*</font>Exp !. expselect("BILL", "12-2037"). qq!<BR><font color="#ff0000">*</font>Attention<BR><INPUT TYPE="text" NAME="BILL_payname" VALUE="Accounts Payable">!,
468       'COMP' => qq!Complimentary<BR><font color="#ff0000">*</font>Approved by<INPUT TYPE="text" NAME="COMP_payinfo" VALUE=""><BR><font color="#ff0000">*</font>Exp !. expselect("COMP"),
469       'PREPAY' => qq!Prepaid card<BR><font color="#ff0000">*</font><INPUT TYPE="text" NAME="PREPAY_payinfo" VALUE="" MAXLENGTH=80>!,
470     );
471
472     my %paybychecked = (
473       'CARD' => qq!Credit card<BR><font color="#ff0000">*</font>$cardselect<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="$payinfo" MAXLENGTH=19><BR><font color="#ff0000">*</font>Exp !. expselect("CARD", $paydate). qq!<BR><font color="#ff0000">*</font>Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="$payname">!,
474       'BILL' => qq!Billing<BR>P.O. <INPUT TYPE="text" NAME="BILL_payinfo" VALUE="$payinfo"><BR><font color="#ff0000">*</font>Exp !. expselect("BILL", $paydate). qq!<BR><font color="#ff0000">*</font>Attention<BR><INPUT TYPE="text" NAME="BILL_payname" VALUE="$payname">!,
475       'COMP' => qq!Complimentary<BR><font color="#ff0000">*</font>Approved by<INPUT TYPE="text" NAME="COMP_payinfo" VALUE="$payinfo"><BR><font color="#ff0000">*</font>Exp !. expselect("COMP", $paydate),
476       'PREPAY' => qq!Prepaid card<BR><font color="#ff0000">*</font><INPUT TYPE="text" NAME="PREPAY_payinfo" VALUE="$payinfo" MAXLENGTH=80>!,
477     );
478
479     for (@payby) {
480       if ( scalar(@payby) == 1) {
481         $OUT .= '<TD VALIGN=TOP>'.
482                 qq!<INPUT TYPE="hidden" NAME="payby" VALUE="$_">!.
483                 "$paybychecked{$_}</TD>";
484       } else {
485         $OUT .= qq!<TD VALIGN=TOP><INPUT TYPE="radio" NAME="payby" VALUE="$_"!;
486         if ($payby eq $_) {
487           $OUT .= qq! CHECKED> $paybychecked{$_}</TD>!;
488         } else {
489           $OUT .= qq!> $payby{$_}</TD>!;
490         }
491
492       }
493     }
494   %>
495
496 </TR></TABLE><font color="#ff0000">*</font> required fields for each billing type
497 <BR><BR>First package
498 <TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=0 WIDTH="100%">
499 <TR>
500   <TD COLSPAN=2><SELECT NAME="pkgpart"><OPTION VALUE="">(none)
501
502   <%=
503     foreach my $package ( @{$packages} ) {
504       $OUT .= '<OPTION VALUE="'. $package->{'pkgpart'}. '"';
505       $OUT .= ' SELECTED' if $pkgpart && $package->{'pkgpart'} == $pkgpart;
506       $OUT .= '>'. $package->{'pkg'};
507     }
508   %>
509
510   </SELECT></TD>
511 </TR>
512 <TR>
513   <TD ALIGN="right">Username</TD>
514   <TD><INPUT TYPE="text" NAME="username" VALUE="<%= $username %>"></TD>
515 </TR>
516 <TR>
517   <TD ALIGN="right">Password</TD>
518   <TD><INPUT TYPE="password" NAME="_password" VALUE="<%= $password %>">
519   (blank to generate)</TD>
520 </TR>
521 <TR>
522   <TD ALIGN="right">Re-enter Password</TD>
523   <TD><INPUT TYPE="password" NAME="_password2" VALUE="<%= $password2 %>">
524   </TD>
525 </TR>
526 <%=
527   if ( $init_data->{'security_phrase'} ) {
528     $OUT .= <<ENDOUT;
529 <TR>
530   <TD ALIGN="right">Security Phrase</TD>
531   <TD><INPUT TYPE="text" NAME="sec_phrase" VALUE="$sec_phrase">
532   </TD>
533 </TR>
534 ENDOUT
535   } else {
536     $OUT .= '<INPUT TYPE="hidden" NAME="sec_phrase" VALUE="">';
537   }
538 %>
539 <TR>
540   <TD ALIGN="right">Access number</TD>
541   <TD><%= popselector($popnum) %></TD>
542 </TR>
543 </TABLE>
544 <BR><BR><INPUT TYPE="submit" VALUE="Signup">
545 </FORM></BODY></HTML>
546 END
547 }