X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=fs_signup%2Ffs_signupd;fp=fs_signup%2Ffs_signupd;h=71fd1540df8267e2d04397b489743f2f39a2a970;hp=582e13ccdfeba90ba4e0ae60b8c9622c2a40733c;hb=453f8ffb1b1b54998c208ec49a8284394b2727bf;hpb=fde6e8e3367ffca17bff1451d1d6bd78c87c092d diff --git a/fs_signup/fs_signupd b/fs_signup/fs_signupd index 582e13ccd..71fd1540d 100755 --- a/fs_signup/fs_signupd +++ b/fs_signup/fs_signupd @@ -1,17 +1,16 @@ #!/usr/bin/perl -Tw # -# fs_passwdd +# fs_signupd # -# This is run REMOTELY over ssh by fs_passwd_server. +# This is run REMOTELY over ssh by fs_signup_server. # -# ivan@sisd.com 98-mar-9 use strict; use Socket; -my($fs_passwdd_socket)="/usr/local/freeside/fs_passwdd_socket"; +my($fs_passwdd_socket)="/usr/local/freeside/fs_signupd_socket"; -$ENV{'PATH'} ='/usr/bin:/usr/ucb:/bin'; +$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin'; $ENV{'SHELL'} = '/bin/sh'; $ENV{'IFS'} = " \t\n"; $ENV{'CDPATH'} = ''; @@ -20,6 +19,46 @@ $ENV{'BASH_ENV'} = ''; $|=1; +chomp( my $n_cust_main_county = ); +my @cust_main_county = map { + chomp( my $taxnum = ); + chomp( my $state = ); + chomp( my $county = ); + chomp( my $country = ); + { + 'taxnum' => $taxnum, + 'state' => $state, + 'county' => $county, + 'country' => $country, + }; +} ( 1 .. $n_cust_main_county ); + +chomp( my $n_part_pkg = ); +my @part_pkg = map { + chomp( my $pkgpart = ); + chomp( my $pkg = ); + { + 'pkgpart' => $pkgpart, + 'pkg' => $pkg, + }; +} ( 1 .. $n_part_pkg ); + +chomp( my $n_svc_acct_pop = ); +my @svc_acct_pop = map { + chomp( my $popnum = ); + chomp( my $city = ); + chomp( my $state = ); + chomp( my $ac = ); + chomp( my $exch = ); + { + 'popnum' => $popnum, + 'city' => $city, + 'state' => $state, + 'ac' => $ac, + 'exch' => $exch, + }; +} ( 1 .. $n_svc_acct_pop ); + my $uaddr = sockaddr_un($fs_passwdd_socket); my $proto = getprotobyname('tcp'); @@ -28,22 +67,63 @@ unlink($fs_passwdd_socket); bind(Server, $uaddr) or die "bind: $!"; listen(Server,SOMAXCONN) or die "listen: $!"; -my($paddr); +my $paddr; + for ( ; $paddr = accept(Client,Server); close Client) { - my($me,$old_password,$new_password,$new_gecos,$new_shell); - $me=; - $old_password=; - $new_password=; - $new_gecos=; - $new_shell=; + chop( my $command = ); + + if ( $command eq "signup_info" ) { + + print Client join("\n", $n_cust_main_county, + map { + $_->{taxnum}, + $_->{state}, + $_->{county}, + $_->{country}, + } @cust_main_county + ), "\n"; + + print Client join("\n", $n_part_pkg, + map { + $_->{pkgpart}, + $_->{pkg}, + } @part_pkg + ), "\n"; + + print Client join("\n", $n_svc_acct_pop, + map { + $_->{popnum}, + $_->{city}, + $_->{state}, + $_->{ac}, + $_->{exch}, + } @svc_acct_pop + ), "\n"; + + } elsif ( $operation eq "new_customer" ) { + + my( + $first, $last, $ss, $company, $address1, $address2, $city, $county, + $state, $zip, $country, $daytime, $night, $fax, $payby, $payinfo, + $paydate, $payname, $invoicing_list, $pkgpart, $username, $password, + $popnum, + ) = ; + + print + $first, $last, $ss, $company, $address1, $address2, $city, $county, + $state, $zip, $country, $daytime, $night, $fax, $payby, $payinfo, + $paydate, $payname, $invoicing_list, $pkgpart, $username, $password, + $popnum, + ; + + my $error = ; + + print Client $error; - print $me,$old_password,$new_password,$new_gecos,$new_shell; - my($error); + } else { + die "unexpected command from client: $command"; + } - $error=; - - print Client $error; - close Client; }