From 09a1086ecc936117027e8fb6f015dbc038449316 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 20 Aug 1998 04:42:04 +0000 Subject: Initial revision --- eg/TEMPLATE_cust_main.import | 189 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100755 eg/TEMPLATE_cust_main.import (limited to 'eg') diff --git a/eg/TEMPLATE_cust_main.import b/eg/TEMPLATE_cust_main.import new file mode 100755 index 000000000..39a5785db --- /dev/null +++ b/eg/TEMPLATE_cust_main.import @@ -0,0 +1,189 @@ +#!/usr/bin/perl -w + +# Template for importing legacy customer data +# +# ivan@sisd.com 98-aug-17 - 20 + +use strict; +use FS::UID qw(adminsuidsetup datasrc); +use FS::Record qw(fields qsearch qsearchs); +use FS::cust_main; +use FS::cust_pkg; +use Date::Parse; + +adminsuidsetup; + +# use these for the imported cust_main records (unless you have these in legacy +# data) +my($agentnum)=4; +my($refnum)=5; + +# map from legacy billing data to pkgpart, maps imported field +# LegacyBillingData to pkgpart. your names and pkgparts will be different +my(%pkgpart)=( + 'Employee' => 10, + 'Business' => 11, + 'Individual' => 12, + 'Basic PPP' => 13, + 'Slave' => 14, + 'Co-Located Server' => 15, + 'Virtual Web' => 16, + 'Perk Mail' => 17, + 'Credit Hold' => 18, +); + +my($file)="legacy_file"; + +open(CLIENT,$file) + or die "Can't open $file: $!"; + +# put a tab-separated header atop the file, or define @fields +# (use these names or change them below) +# +# for cust_main +# custnum - unique +# last - (name) +# first - (name) +# company +# address1 +# address2 +# city +# state +# zip +# country +# daytime - (phone) +# night - (phone) +# fax +# payby - CARD, BILL or COMP +# payinfo - Credit card #, P.O. # or COMP authorization +# paydate - Expiration +# tax - 'Y' for tax exempt +# for cust_pkg +# LegacyBillingData - maps via %pkgpart above to a pkgpart +# for svc_acct +# username + +my($header); +$header=; +chop $header; +my(@fields)=map { /^\s*(.*[^\s]+)\s*$/; $1 } split(/\t/,$header); +#print join("\n",@fields); + +my($error); +my($link,$line)=(0,0); +while () { + chop; + next if /^[\s\t]*$/; #skip any blank lines + + #define %svc hash for this record + my(@record)=split(/\t/); + my(%svc); + foreach (@fields) { + $svc{$_}=shift @record; + } + + # might need to massage some data like this + $svc{'payby'} =~ s/^Credit Card$/CARD/io; + $svc{'payby'} =~ s/^Check$/BILL/io; + $svc{'payby'} =~ s/^Cash$/BILL/io; + $svc{'payby'} =~ s/^$/BILL/o; + $svc{'First'} =~ s/&/and/go; + $svc{'Zip'} =~ s/\s+$//go; + + my($cust_main) = create FS::cust_main ( { + 'custnum' => $svc{'custnum'}, + 'agentnum' => $agentnum, + 'last' => $svc{'last'}, + 'first' => $svc{'first'}, + 'company' => $svc{'company'}, + 'address1' => $svc{'address1'}, + 'address2' => $svc{'address2'}, + 'city' => $svc{'city'}, + 'state' => $svc{'state'}, + 'zip' => $svc{'zip'}, + 'country' => $svc{'country'}, + 'daytime' => $svc{'daytime'}, + 'night' => $svc{'night'}, + 'fax' => $svc{'fax'}, + 'payby' => $svc{'payby'}, + 'payinfo' => $svc{'payinfo'}, + 'paydate' => $svc{'paydate'}, + 'payname' => $svc{'payname'}, + 'tax' => $svc{'tax'}, + 'refnum' => $refnum, + } ); + + $error=$cust_main->insert; + + if ( $error ) { + warn $cust_main->_dump; + warn map "$_: ". $svc{$_}. "|\n", keys %svc; + die $error; + } + + my($cust_pkg)=create FS::cust_pkg ( { + 'custnum' => $svc{'custnum'}, + 'pkgpart' => $pkgpart{$svc{'LegacyBillingData'}}, + 'setup' => '', + 'bill' => '', + 'susp' => '', + 'expire' => '', + 'cancel' => '', + } ); + + $error=$cust_pkg->insert; + if ( $error ) { + warn $svc{'LegacyBillingData'}; + die $error; + } + + unless ( $svc{'username'} ) { + warn "Empty login"; + } else { + #find svc_acct record (imported with bin/svc_acct.import) for this username + my($svc_acct)=qsearchs('svc_acct',{'username'=>$svc{'username'}}); + unless ( $svc_acct ) { + warn "username ", $svc{'username'}, " not found\n"; + } else { + #link to the cust_pkg record we created above + + #find cust_svc record for this svc_acct record + my($o_cust_svc)=qsearchs('cust_svc',{ + 'svcnum' => $svc_acct->svcnum, + 'pkgnum' => '', + } ); + unless ( $o_cust_svc ) { + warn "No unlinked cust_svc for svcnum ", $svc_acct->svcnum; + } else { + + #make sure this svcpart is in pkgpart + my($pkg_svc)=qsearchs('pkg_svc',{ + 'pkgpart' => $pkgpart{$svc{'LegacyBillingData'}}, + 'svcpart' => $o_cust_svc->svcpart, + 'quantity' => 1, + }); + unless ( $pkg_svc ) { + warn "login ", $svc{'username'}, ": No svcpart ", $o_cust_svc->svcpart, + " for pkgpart ", $pkgpart{$svc{'Acct. Type'}}, "\n" ; + } else { + + #create new cust_svc record linked to cust_pkg record + my($n_cust_svc) = create FS::cust_svc ({ + 'svcnum' => $o_cust_svc->svcnum, + 'pkgnum' => $cust_pkg->pkgnum, + 'svcpart' => $pkg_svc->svcpart, + }); + my($error) = $n_cust_svc->replace($o_cust_svc); + die $error if $error; + $link++; + } + } + } + } + + $line++; + +} + +warn "\n$link of $line lines linked\n"; + -- cgit v1.2.1 From c0552e0f27038eb05002e224fa3c88afeadbc39f Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 16 Dec 1998 05:29:45 +0000 Subject: adminsuidsetup now need user --- eg/TEMPLATE_cust_main.import | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'eg') diff --git a/eg/TEMPLATE_cust_main.import b/eg/TEMPLATE_cust_main.import index 39a5785db..4ac7efdc7 100755 --- a/eg/TEMPLATE_cust_main.import +++ b/eg/TEMPLATE_cust_main.import @@ -2,7 +2,14 @@ # Template for importing legacy customer data # +# $Id: TEMPLATE_cust_main.import,v 1.2 1998-12-16 05:29:45 ivan Exp $ +# # ivan@sisd.com 98-aug-17 - 20 +# +# $Log: TEMPLATE_cust_main.import,v $ +# Revision 1.2 1998-12-16 05:29:45 ivan +# adminsuidsetup now need user +# use strict; use FS::UID qw(adminsuidsetup datasrc); @@ -11,7 +18,8 @@ use FS::cust_main; use FS::cust_pkg; use Date::Parse; -adminsuidsetup; +my $user = shift or die &usage; +adminsuidsetup $user; # use these for the imported cust_main records (unless you have these in legacy # data) @@ -187,3 +195,8 @@ while () { warn "\n$link of $line lines linked\n"; +# --- + +sub usage { + die "Usage:\n\n cust_main.import user\n"; +} -- cgit v1.2.1 From b5a96aa7ba534b919e74d4e9451bce945232019a Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 26 Mar 1999 13:15:56 +0000 Subject: s/create/new/, use all necessary FS::table_names to avoid warnings --- eg/TEMPLATE_cust_main.import | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'eg') diff --git a/eg/TEMPLATE_cust_main.import b/eg/TEMPLATE_cust_main.import index 4ac7efdc7..448186991 100755 --- a/eg/TEMPLATE_cust_main.import +++ b/eg/TEMPLATE_cust_main.import @@ -2,21 +2,27 @@ # Template for importing legacy customer data # -# $Id: TEMPLATE_cust_main.import,v 1.2 1998-12-16 05:29:45 ivan Exp $ +# $Id: TEMPLATE_cust_main.import,v 1.3 1999-03-26 13:15:56 ivan Exp $ # # ivan@sisd.com 98-aug-17 - 20 # # $Log: TEMPLATE_cust_main.import,v $ -# Revision 1.2 1998-12-16 05:29:45 ivan +# Revision 1.3 1999-03-26 13:15:56 ivan +# s/create/new/, use all necessary FS::table_names to avoid warnings +# +# Revision 1.2 1998/12/16 05:29:45 ivan # adminsuidsetup now need user # use strict; +use Date::Parse; use FS::UID qw(adminsuidsetup datasrc); use FS::Record qw(fields qsearch qsearchs); use FS::cust_main; use FS::cust_pkg; -use Date::Parse; +use FS::cust_svc; +use FS::svc_acct; +use FS::pkg_svc; my $user = shift or die &usage; adminsuidsetup $user; @@ -98,7 +104,7 @@ while () { $svc{'First'} =~ s/&/and/go; $svc{'Zip'} =~ s/\s+$//go; - my($cust_main) = create FS::cust_main ( { + my($cust_main) = new FS::cust_main ( { 'custnum' => $svc{'custnum'}, 'agentnum' => $agentnum, 'last' => $svc{'last'}, @@ -129,7 +135,7 @@ while () { die $error; } - my($cust_pkg)=create FS::cust_pkg ( { + my($cust_pkg)=new FS::cust_pkg ( { 'custnum' => $svc{'custnum'}, 'pkgpart' => $pkgpart{$svc{'LegacyBillingData'}}, 'setup' => '', @@ -176,7 +182,7 @@ while () { } else { #create new cust_svc record linked to cust_pkg record - my($n_cust_svc) = create FS::cust_svc ({ + my($n_cust_svc) = new FS::cust_svc ({ 'svcnum' => $o_cust_svc->svcnum, 'pkgnum' => $cust_pkg->pkgnum, 'svcpart' => $pkg_svc->svcpart, -- cgit v1.2.1 From 6981a417a49264fd4e03dc0167e070f7a4c128e1 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 4 Aug 1999 08:03:03 +0000 Subject: move table subclass examples out of production directory --- eg/table_template-svc.pm | 180 +++++++++++++++++++++++++++++++++++++++++++++++ eg/table_template.pm | 137 ++++++++++++++++++++++++++++++++++++ 2 files changed, 317 insertions(+) create mode 100644 eg/table_template-svc.pm create mode 100644 eg/table_template.pm (limited to 'eg') diff --git a/eg/table_template-svc.pm b/eg/table_template-svc.pm new file mode 100644 index 000000000..a4f5028f5 --- /dev/null +++ b/eg/table_template-svc.pm @@ -0,0 +1,180 @@ +package FS::svc_table; + +use strict; +use vars qw(@ISA); +#use FS::Record qw( qsearch qsearchs ); +use FS::svc_Common; +use FS::cust_svc; + +@ISA = qw(svc_Common); + +=head1 NAME + +FS::table_name - Object methods for table_name records + +=head1 SYNOPSIS + + use FS::table_name; + + $record = new FS::table_name \%hash; + $record = new FS::table_name { 'column' => 'value' }; + + $error = $record->insert; + + $error = $new_record->replace($old_record); + + $error = $record->delete; + + $error = $record->check; + + $error = $record->suspend; + + $error = $record->unsuspend; + + $error = $record->cancel; + +=head1 DESCRIPTION + +An FS::table_name object represents an example. FS::table_name inherits from +FS::svc_Common. The following fields are currently supported: + +=over 4 + +=item field - description + +=back + +=head1 METHODS + +=over 4 + +=item new HASHREF + +Creates a new example. To add the example to the database, see L<"insert">. + +Note that this stores the hash reference, not a distinct copy of the hash it +points to. You can ask the object for a copy with the I method. + +=cut + +sub table { 'table_name'; } + +=item insert + +Adds this record to the database. If there is an error, returns the error, +otherwise returns false. + +The additional fields pkgnum and svcpart (see L) should be +defined. An FS::cust_svc record will be created and inserted. + +=cut + +sub insert { + my $self = shift; + my $error; + + $error = $self->SUPER::insert; + return $error if $error; + + ''; +} + +=item delete + +Delete this record from the database. + +=cut + +sub delete { + my $self = shift; + my $error; + + $error = $self->SUPER::delete; + return $error if $error; + + ''; +} + + +=item replace OLD_RECORD + +Replaces the OLD_RECORD with this one in the database. If there is an error, +returns the error, otherwise returns false. + +=cut + +sub replace { + my ( $new, $old ) = ( shift, shift ); + my $error; + + $error = $new->SUPER::replace($old); + return $error if $error; + + ''; +} + +=item suspend + +Called by the suspend method of FS::cust_pkg (see L). + +=item unsuspend + +Called by the unsuspend method of FS::cust_pkg (see L). + +=item cancel + +Called by the cancel method of FS::cust_pkg (see L). + +=item check + +Checks all fields to make sure this is a valid example. If there is +an error, returns the error, otherwise returns false. Called by the insert +and repalce methods. + +=cut + +sub check { + my $self = shift; + + my $x = $self->setfixed; + return $x unless ref($x); + my $part_svc = $x; + + + ''; #no error +} + +=back + +=head1 VERSION + +$Id: table_template-svc.pm,v 1.1 1999-08-04 08:03:03 ivan Exp $ + +=head1 BUGS + +The author forgot to customize this manpage. + +=head1 SEE ALSO + +L, L, L, L, +L, schema.html from the base documentation. + +=head1 HISTORY + +ivan@voicenet.com 97-jul-21 + +$Log: table_template-svc.pm,v $ +Revision 1.1 1999-08-04 08:03:03 ivan +move table subclass examples out of production directory + +Revision 1.4 1998/12/30 00:30:48 ivan +svc_ stuff is more properly OO - has a common superclass FS::svc_Common + +Revision 1.2 1998/11/15 04:33:01 ivan +updates for newest versoin + + +=cut + +1; + diff --git a/eg/table_template.pm b/eg/table_template.pm new file mode 100644 index 000000000..7f74ac342 --- /dev/null +++ b/eg/table_template.pm @@ -0,0 +1,137 @@ +package FS::table_name; + +use strict; +use vars qw( @ISA ); +use FS::Record qw( qsearch qsearchs ); + +@ISA = qw(FS::Record); + +=head1 NAME + +FS::table_name - Object methods for table_name records + +=head1 SYNOPSIS + + use FS::table_name; + + $record = new FS::table_name \%hash; + $record = new FS::table_name { 'column' => 'value' }; + + $error = $record->insert; + + $error = $new_record->replace($old_record); + + $error = $record->delete; + + $error = $record->check; + +=head1 DESCRIPTION + +An FS::table_name object represents an example. FS::table_name inherits from +FS::Record. The following fields are currently supported: + +=over 4 + +=item field - description + +=back + +=head1 METHODS + +=over 4 + +=item new HASHREF + +Creates a new example. To add the example to the database, see L<"insert">. + +Note that this stores the hash reference, not a distinct copy of the hash it +points to. You can ask the object for a copy with the I method. + +=cut + +# the new method can be inherited from FS::Record, if a table method is defined + +sub table { 'table_name'; } + +=item insert + +Adds this record to the database. If there is an error, returns the error, +otherwise returns false. + +=cut + +# the insert method can be inherited from FS::Record + +=item delete + +Delete this record from the database. + +=cut + +# the delete method can be inherited from FS::Record + +=item replace OLD_RECORD + +Replaces the OLD_RECORD with this one in the database. If there is an error, +returns the error, otherwise returns false. + +=cut + +# the replace method can be inherited from FS::Record + +=item check + +Checks all fields to make sure this is a valid example. If there is +an error, returns the error, otherwise returns false. Called by the insert +and replace methods. + +=cut + +# the check method should currently be supplied - FS::Record contains some +# data checking routines + +sub check { + my $self = shift; + + ''; #no error +} + +=back + +=head1 VERSION + +$Id: table_template.pm,v 1.1 1999-08-04 08:03:03 ivan Exp $ + +=head1 BUGS + +The author forgot to customize this manpage. + +=head1 SEE ALSO + +L, schema.html from the base documentation. + +=head1 HISTORY + +ivan@voicenet.com 97-jul-1 + +added hfields +ivan@sisd.com 97-nov-13 + +$Log: table_template.pm,v $ +Revision 1.1 1999-08-04 08:03:03 ivan +move table subclass examples out of production directory + +Revision 1.4 1998/12/29 11:59:57 ivan +mostly properly OO, some work still to be done with svc_ stuff + +Revision 1.3 1998/11/15 04:33:00 ivan +updates for newest versoin + +Revision 1.2 1998/11/15 03:48:49 ivan +update for current version + + +=cut + +1; + -- cgit v1.2.1 From 52b07e8abd3946578a6c2701ec9e5195ec6b17e6 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 27 Oct 2000 20:15:50 +0000 Subject: session monitor --- eg/table_template.pm | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'eg') diff --git a/eg/table_template.pm b/eg/table_template.pm index 7f74ac342..2cc1e1d6e 100644 --- a/eg/table_template.pm +++ b/eg/table_template.pm @@ -100,7 +100,7 @@ sub check { =head1 VERSION -$Id: table_template.pm,v 1.1 1999-08-04 08:03:03 ivan Exp $ +$Id: table_template.pm,v 1.2 2000-10-27 20:15:50 ivan Exp $ =head1 BUGS @@ -110,27 +110,6 @@ The author forgot to customize this manpage. L, schema.html from the base documentation. -=head1 HISTORY - -ivan@voicenet.com 97-jul-1 - -added hfields -ivan@sisd.com 97-nov-13 - -$Log: table_template.pm,v $ -Revision 1.1 1999-08-04 08:03:03 ivan -move table subclass examples out of production directory - -Revision 1.4 1998/12/29 11:59:57 ivan -mostly properly OO, some work still to be done with svc_ stuff - -Revision 1.3 1998/11/15 04:33:00 ivan -updates for newest versoin - -Revision 1.2 1998/11/15 03:48:49 ivan -update for current version - - =cut 1; -- cgit v1.2.1 From 1da2eb3c205a088809fb8b72b42a454b94b74c43 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 21 Aug 2001 02:44:47 +0000 Subject: remove $Log$ --- eg/TEMPLATE_cust_main.import | 14 ++------------ eg/table_template-svc.pm | 17 +---------------- 2 files changed, 3 insertions(+), 28 deletions(-) (limited to 'eg') diff --git a/eg/TEMPLATE_cust_main.import b/eg/TEMPLATE_cust_main.import index 448186991..e91a2f1d2 100755 --- a/eg/TEMPLATE_cust_main.import +++ b/eg/TEMPLATE_cust_main.import @@ -1,18 +1,8 @@ #!/usr/bin/perl -w - -# Template for importing legacy customer data -# -# $Id: TEMPLATE_cust_main.import,v 1.3 1999-03-26 13:15:56 ivan Exp $ # -# ivan@sisd.com 98-aug-17 - 20 -# -# $Log: TEMPLATE_cust_main.import,v $ -# Revision 1.3 1999-03-26 13:15:56 ivan -# s/create/new/, use all necessary FS::table_names to avoid warnings -# -# Revision 1.2 1998/12/16 05:29:45 ivan -# adminsuidsetup now need user +# Template for importing legacy customer data # +# $Id: TEMPLATE_cust_main.import,v 1.4 2001-08-21 02:44:47 ivan Exp $ use strict; use Date::Parse; diff --git a/eg/table_template-svc.pm b/eg/table_template-svc.pm index a4f5028f5..c5e8f9670 100644 --- a/eg/table_template-svc.pm +++ b/eg/table_template-svc.pm @@ -148,7 +148,7 @@ sub check { =head1 VERSION -$Id: table_template-svc.pm,v 1.1 1999-08-04 08:03:03 ivan Exp $ +$Id: table_template-svc.pm,v 1.2 2001-08-21 02:44:47 ivan Exp $ =head1 BUGS @@ -159,21 +159,6 @@ The author forgot to customize this manpage. L, L, L, L, L, schema.html from the base documentation. -=head1 HISTORY - -ivan@voicenet.com 97-jul-21 - -$Log: table_template-svc.pm,v $ -Revision 1.1 1999-08-04 08:03:03 ivan -move table subclass examples out of production directory - -Revision 1.4 1998/12/30 00:30:48 ivan -svc_ stuff is more properly OO - has a common superclass FS::svc_Common - -Revision 1.2 1998/11/15 04:33:01 ivan -updates for newest versoin - - =cut 1; -- cgit v1.2.1 From b35b650a6078d645d6f97620f3c79ae941915dd9 Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 18 Feb 2002 00:13:58 +0000 Subject: trading in tar for rsync for improved vpopmail support --- eg/vpopmailrestart | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 eg/vpopmailrestart (limited to 'eg') diff --git a/eg/vpopmailrestart b/eg/vpopmailrestart new file mode 100755 index 000000000..c716e2e2b --- /dev/null +++ b/eg/vpopmailrestart @@ -0,0 +1,11 @@ +#!/bin/sh + +for domain in /home/vpopmail/domains/* +do + /home/vpopmail/bin/vmkpasswd `/bin/basename $domain` +done + +/var/qmail/bin/qmail-newu + +killall -HUP qmail-send + -- cgit v1.2.1 From 20d1b5c39c3674f3fdf5c0f784697a4442658648 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 5 Apr 2002 16:37:42 +0000 Subject: oops forgot these from working on the road --- eg/export_template.pm | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 eg/export_template.pm (limited to 'eg') diff --git a/eg/export_template.pm b/eg/export_template.pm new file mode 100644 index 000000000..11e1c3b14 --- /dev/null +++ b/eg/export_template.pm @@ -0,0 +1,47 @@ +package FS::part_export::myexport; + +use vars qw(@ISA); +use FS::part_export; + +@ISA = qw(FS::part_export); + +sub rebless { shift; } + +sub _export_insert { + my($self, $svc_something) = (shift, shift); + $self->myexport_queue( $svc_acct->svcnum, 'insert', + $svc_something->username, $svc_something->password ); +} + +sub _export_replace { + my( $self, $new, $old ) = (shift, shift, shift); + #return "can't change username with myexport" + # if $old->username ne $new->username; + #return '' unless $old->_password ne $new->_password; + $self->myexport_queue( $new->svcnum, + 'replace', $new->username, $new->password ); +} + +sub _export_delete { + my( $self, $svc_something ) = (shift, shift); + $self->myexport_queue( $svc_acct->svcnum, + 'delete', $svc_something->username ); +} + +#a good idea to queue anything that could fail or take any time +sub myexport_queue { + my( $self, $svcnum, $method ) = (shift, shift, shift); + my $queue = new FS::queue { + 'svcnum' => $svcnum, + 'job' => "FS::part_export::myexport::myexport_$method", + }; + $queue->insert( @_ ); +} + +sub myexport_insert { #subroutine, not method +} +sub myexport_replace { #subroutine, not method +} +sub myexport_delete { #subroutine, not method +} + -- cgit v1.2.1 From 87af741da0dd5f6a76bbb566b4d6c54cd5b15315 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 5 Apr 2002 23:51:18 +0000 Subject: - add message catalog table & beginning of web interface - add security_phrase and conf option to svc_acct.pm - random other stuff --- eg/table_template-svc.pm | 4 ---- eg/table_template.pm | 4 ---- 2 files changed, 8 deletions(-) (limited to 'eg') diff --git a/eg/table_template-svc.pm b/eg/table_template-svc.pm index c5e8f9670..ebf7299d2 100644 --- a/eg/table_template-svc.pm +++ b/eg/table_template-svc.pm @@ -146,10 +146,6 @@ sub check { =back -=head1 VERSION - -$Id: table_template-svc.pm,v 1.2 2001-08-21 02:44:47 ivan Exp $ - =head1 BUGS The author forgot to customize this manpage. diff --git a/eg/table_template.pm b/eg/table_template.pm index 2cc1e1d6e..d609bd544 100644 --- a/eg/table_template.pm +++ b/eg/table_template.pm @@ -98,10 +98,6 @@ sub check { =back -=head1 VERSION - -$Id: table_template.pm,v 1.2 2000-10-27 20:15:50 ivan Exp $ - =head1 BUGS The author forgot to customize this manpage. -- cgit v1.2.1 From 9bf26ed4b065b12826fc2980ff277a2f3be25c1d Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 14 Apr 2002 09:11:22 +0000 Subject: - move cyrus, shellcommands, CP exports exports to new-style - skeleton files for vpopmail exports - documentation updates - add big schema diagram to docs --- eg/export_template.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'eg') diff --git a/eg/export_template.pm b/eg/export_template.pm index 11e1c3b14..f2a5a19f7 100644 --- a/eg/export_template.pm +++ b/eg/export_template.pm @@ -10,7 +10,7 @@ sub rebless { shift; } sub _export_insert { my($self, $svc_something) = (shift, shift); $self->myexport_queue( $svc_acct->svcnum, 'insert', - $svc_something->username, $svc_something->password ); + $svc_something->username, $svc_something->_password ); } sub _export_replace { @@ -19,7 +19,7 @@ sub _export_replace { # if $old->username ne $new->username; #return '' unless $old->_password ne $new->_password; $self->myexport_queue( $new->svcnum, - 'replace', $new->username, $new->password ); + 'replace', $new->username, $new->_password ); } sub _export_delete { -- cgit v1.2.1 From eb7c552dd8290d6b33a4e026c5dc21ebf01105cf Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 15 May 2002 13:24:26 +0000 Subject: queue dependancies --- eg/export_template.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'eg') diff --git a/eg/export_template.pm b/eg/export_template.pm index f2a5a19f7..1d441bda1 100644 --- a/eg/export_template.pm +++ b/eg/export_template.pm @@ -9,8 +9,9 @@ sub rebless { shift; } sub _export_insert { my($self, $svc_something) = (shift, shift); - $self->myexport_queue( $svc_acct->svcnum, 'insert', + $err_or_queue = $self->myexport_queue( $svc_acct->svcnum, 'insert', $svc_something->username, $svc_something->_password ); + ref($err_or_queue) ? '' : $err_or_queue; } sub _export_replace { @@ -18,14 +19,16 @@ sub _export_replace { #return "can't change username with myexport" # if $old->username ne $new->username; #return '' unless $old->_password ne $new->_password; - $self->myexport_queue( $new->svcnum, + $err_or_queue = $self->myexport_queue( $new->svcnum, 'replace', $new->username, $new->_password ); + ref($err_or_queue) ? '' : $err_or_queue; } sub _export_delete { my( $self, $svc_something ) = (shift, shift); - $self->myexport_queue( $svc_acct->svcnum, + $err_or_queue = $self->myexport_queue( $svc_acct->svcnum, 'delete', $svc_something->username ); + ref($err_or_queue) ? '' : $err_or_queue; } #a good idea to queue anything that could fail or take any time @@ -35,7 +38,7 @@ sub myexport_queue { 'svcnum' => $svcnum, 'job' => "FS::part_export::myexport::myexport_$method", }; - $queue->insert( @_ ); + $queue->insert( @_ ) or $queue; } sub myexport_insert { #subroutine, not method -- cgit v1.2.1 From da311364707d64a2188cb959b3779178563d0ac8 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 16 May 2002 14:27:58 +0000 Subject: add (stub) bsdshell and textradius exports --- eg/export_template.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'eg') diff --git a/eg/export_template.pm b/eg/export_template.pm index 1d441bda1..00942fd12 100644 --- a/eg/export_template.pm +++ b/eg/export_template.pm @@ -9,7 +9,7 @@ sub rebless { shift; } sub _export_insert { my($self, $svc_something) = (shift, shift); - $err_or_queue = $self->myexport_queue( $svc_acct->svcnum, 'insert', + $err_or_queue = $self->myexport_queue( $svc_something->svcnum, 'insert', $svc_something->username, $svc_something->_password ); ref($err_or_queue) ? '' : $err_or_queue; } @@ -26,7 +26,7 @@ sub _export_replace { sub _export_delete { my( $self, $svc_something ) = (shift, shift); - $err_or_queue = $self->myexport_queue( $svc_acct->svcnum, + $err_or_queue = $self->myexport_queue( $svc_something->svcnum, 'delete', $svc_something->username ); ref($err_or_queue) ? '' : $err_or_queue; } -- cgit v1.2.1 From 2a2fa626446a69e7e1a5953b8bb693b5e4274d8b Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 8 Oct 2002 10:50:43 +0000 Subject: slightly less sucky --- eg/export_template.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'eg') diff --git a/eg/export_template.pm b/eg/export_template.pm index 00942fd12..ca58d4bed 100644 --- a/eg/export_template.pm +++ b/eg/export_template.pm @@ -42,9 +42,15 @@ sub myexport_queue { } sub myexport_insert { #subroutine, not method + my( $username, $password ) = @_; + #do things with $username and $password } + sub myexport_replace { #subroutine, not method } + sub myexport_delete { #subroutine, not method + my( $username ) = @_; + #do things with $username } -- cgit v1.2.1 From e6f6f496883b8e8be42f4d92f01b61dbc2c590be Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 20 Oct 2002 03:28:23 +0000 Subject: vpopmail restart export option --- eg/vpopmailrestart | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100755 eg/vpopmailrestart (limited to 'eg') diff --git a/eg/vpopmailrestart b/eg/vpopmailrestart deleted file mode 100755 index c716e2e2b..000000000 --- a/eg/vpopmailrestart +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -for domain in /home/vpopmail/domains/* -do - /home/vpopmail/bin/vmkpasswd `/bin/basename $domain` -done - -/var/qmail/bin/qmail-newu - -killall -HUP qmail-send - -- cgit v1.2.1 From 8db0e6f5d34786bfd93ce21f43126a5fab441ade Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 23 Dec 2003 01:06:10 +0000 Subject: fix path to svc_Common in example table --- eg/table_template-svc.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'eg') diff --git a/eg/table_template-svc.pm b/eg/table_template-svc.pm index ebf7299d2..66d17e34a 100644 --- a/eg/table_template-svc.pm +++ b/eg/table_template-svc.pm @@ -6,7 +6,7 @@ use vars qw(@ISA); use FS::svc_Common; use FS::cust_svc; -@ISA = qw(svc_Common); +@ISA = qw(FS::svc_Common); =head1 NAME -- cgit v1.2.1 From 869a43742a9bcba4d2dd117b76e759ff6c81d371 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 23 Dec 2003 01:10:50 +0000 Subject: update svc template for 1.5 --- eg/table_template-svc.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'eg') diff --git a/eg/table_template-svc.pm b/eg/table_template-svc.pm index 66d17e34a..7f7ef4b68 100644 --- a/eg/table_template-svc.pm +++ b/eg/table_template-svc.pm @@ -141,7 +141,7 @@ sub check { my $part_svc = $x; - ''; #no error + $self->SUPER::check; } =back -- cgit v1.2.1 From 39829996e06feb07cc5c59f6c0a30b807c98a0c4 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 24 Mar 2004 14:17:29 +0000 Subject: update example export for the new world of export data in themodule files --- eg/export_template.pm | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'eg') diff --git a/eg/export_template.pm b/eg/export_template.pm index ca58d4bed..2c199db85 100644 --- a/eg/export_template.pm +++ b/eg/export_template.pm @@ -1,10 +1,35 @@ package FS::part_export::myexport; -use vars qw(@ISA); +use vars qw(@ISA %info); +use Tie::IxHash; use FS::part_export; @ISA = qw(FS::part_export); +tie my %options, 'Tie::IxHash', + 'regular_option' => { label => 'Option description', default => 'value' }, + 'select_option' => { label => 'Select option description', + type => 'select', options=>[qw(chocolate vanilla)], + default => 'vanilla', + }, + 'textarea_option' => { label => 'Textarea option description', + type => 'textarea', + default => 'Default text.', + }, + 'checkbox_option' => { label => 'Checkbox label', type => 'checkbox' }, +; + +%info = ( + 'svc' => 'svc_acct', + #'svc' => [qw( svc_acct svc_forward )], + 'desc' => + 'Export short description', + 'options' => \%options, + 'nodomain' => 'Y', + 'notes' => <<'END' +HTML notes about this export. +END + sub rebless { shift; } sub _export_insert { -- cgit v1.2.1