MiniVend 4.02 minivend-4.02
Mike Heins [Thu, 9 Mar 2000 05:00:00 +0000 (00:00 -0500)]
41 files changed:
MANIFEST
Makefile.PL
WHATSNEW
dist/basic/products/shipping.asc
dist/build/makecat.redhat
dist/simple/etc/profiles.login
dist/simple/pages/config/report_def/New.html [new file with mode: 0644]
dist/simple/pages/config/report_def/Orders%20by%20SKU%20-%20Short.html [new file with mode: 0644]
dist/simple/pages/config/report_def/Orders%20by%20SKU.html [new file with mode: 0644]
dist/simple/pages/config/report_def/Orders%20by%20amount.html [new file with mode: 0644]
dist/simple/pages/config/report_def/Products%20by%20category.html [new file with mode: 0644]
dist/simple/pages/config/report_def/Products%20to%20edit.html [new file with mode: 0644]
dist/simple/pages/config/reports/.html [new file with mode: 0644]
dist/simple/pages/config/reports/Orders%20by%20SKU%20-%20Short.html [new file with mode: 0644]
dist/simple/pages/config/reports/Orders%20by%20SKU.html [new file with mode: 0644]
dist/simple/pages/config/reports/Orders%20by%20amount.html [new file with mode: 0644]
dist/simple/pages/config/reports/Products%20by%20category.html [new file with mode: 0644]
dist/simple/pages/config/reports/Products%20to%20edit.html [new file with mode: 0644]
dist/simple/pages/multi/basket.html
dist/simple/pages/ord/basket.html
dist/simple/products/shipping.asc
dist/src/mod_perl_tlink.pl [new file with mode: 0755]
lib/Vend/Config.pm
lib/Vend/Interpolate.pm
lib/Vend/Parse.pm
lib/Vend/Server.pm
lib/Vend/Session.pm
lib/Vend/Util.pm
pod/mvdocs.pod
pod/mvfaq.pod
scripts/compile_link.PL
scripts/config_prog.PL
scripts/dump.PL
scripts/expire.PL
scripts/expireall.PL
scripts/localize.PL
scripts/makecat.PL
scripts/minivend.PL
scripts/offline.PL
scripts/restart.PL
scripts/update.PL

index fcd325e..e0be179 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -221,6 +221,18 @@ dist/simple/pages/action/get_password.html
 dist/simple/pages/browse.html
 dist/simple/pages/browse1.html
 dist/simple/pages/canceled.html
+dist/simple/pages/config/report_def/New.html
+dist/simple/pages/config/report_def/Orders%20by%20SKU%20-%20Short.html
+dist/simple/pages/config/report_def/Orders%20by%20SKU.html
+dist/simple/pages/config/report_def/Orders%20by%20amount.html
+dist/simple/pages/config/report_def/Products%20by%20category.html
+dist/simple/pages/config/report_def/Products%20to%20edit.html
+dist/simple/pages/config/reports/.html
+dist/simple/pages/config/reports/Orders%20by%20SKU%20-%20Short.html
+dist/simple/pages/config/reports/Orders%20by%20SKU.html
+dist/simple/pages/config/reports/Orders%20by%20amount.html
+dist/simple/pages/config/reports/Products%20by%20category.html
+dist/simple/pages/config/reports/Products%20to%20edit.html
 dist/simple/pages/deliver.html
 dist/simple/pages/examples/test_banner.html
 dist/simple/pages/feedback.html
@@ -316,6 +328,7 @@ dist/simple/upload/.empty
 dist/src/compile.pl
 dist/src/config.h.in
 dist/src/configure
+dist/src/mod_perl_tlink.pl
 dist/src/mvctl.c
 dist/src/syscfg.in
 dist/src/testcgi
index 909e7ad..eb33656 100644 (file)
@@ -26,7 +26,7 @@ my $Prompt_sub;
 my @mods_to_get;
 my $Lock_troubles;
 
-$VERSION = '4.01';
+$VERSION = '4.02';
 
 # See if we have the CPAN module
 my $Cpan = 0;
@@ -382,7 +382,8 @@ sub initialize {
                }
                chdir '..';
                my (@minimate) = sort grep -d $_, glob '../MiniMate-4*';
-               if(my $minimate = pop @minimate) {
+               my $minimate = pop @minimate;
+               if( $minimate and ! $ENV{RPM_BUILD_ROOT} ) {
                        my $dir = $realdir;
                        $dir = "$X{RPMBUILDDIR}/$dir"
                                if $X{RPMBUILDDIR};
index fa8ebe1..ca6896c 100644 (file)
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -1,11 +1,11 @@
 
+Minivend-4.02 changes:
 
-                  W H A T ' S   N E W 
-
-Everything. Well, not completely -- many MiniVend 3.x catalogs can
-run with few changes, but there will be changes.
-
-MiniVend 4.x is a major rewrite that restructures many things.
+* Report generator for Minimate, with MV support.
+* Additional Filter entries. 
+* Updated "expire" and "expireall" to work with file-based sessions.
+* Fixed bugs in Internal HTTP server headers.
+* Fixed "Next" problem in [more-list].
 
 Minivend-4.01 introduces the following:
 
@@ -37,13 +37,14 @@ Minivend-4.01 introduces the following:
 * Bug in build procedure found, should prevent binaries and man
   pages ending up in strange places.
 
-Minivend-4.00 is the initial release version.
+Everything. Well, not completely -- many MiniVend 3.x catalogs can
+run with few changes, but there will be changes.
+
+                  W H A T ' S   N E W 
 
-Minivend-4.0alpha12: 
+Minivend-4.00 is the initial release version.
 
-        -- added [banner ...]  tag to replace random/rotate,
-           includes complete documentation
-        -- Glimpse works again.
+MiniVend 4.x is a major rewrite that restructures many things.
 
 Major new features are almost too many to mention, read the documentation
 for the most complete description. Some highlights:
index 32f300c..795ef4d 100644 (file)
@@ -3,7 +3,7 @@ code    description     criteria        min     max     formula query   opt
 default        No shipping     weight  0       99999999        g PriceDivide           
                                                        
 upsg   UPS Ground      weight  0       0       e Nothing to ship!              
-upsg   UPS Ground      weight  0       150     u Ground [default zip 98366] 3.00               
+upsg   UPS Ground      weight  0       150     u Ground [value name=zip filter=digits default=45056] __MVC_UPSADDER__
 upsg   UPS Ground      weight  150     999999  e @@TOTAL@@ lbs too heavy for UPS               
                                                        
 upsb: UPS Two Day                                                      
@@ -18,15 +18,15 @@ upsb: UPS Two Day
        zone    450
        table   2ndDayAir
        geo     zip
-       default_zip 98366
-       adder   3
+       default_zip 45056
+       adder   __MVC_UPSADDER__
                                                        
        min             150                             
        max             999999                          
        cost    e @@TOTAL@@ lbs too heavy for UPS                                       
-                                                       
+
 upsr   UPS Next Day    weight  0       0       e Nothing to ship!              
-upsr   UPS Next Day    weight  0       150     u NextDayAir [default zip 98366] 3.00           
+upsr   UPS Next Day    weight  0       150     u NextDayAir [value name=zip filter=digits default=45056] __MVC_UPSADDER__
 upsr   UPS Next Day    weight  150     999999  e @@TOTAL@@ lbs too heavy for UPS               
                                                        
 surf_A Int'l Surface A weight  0       0       e Nothing to ship!              
index 15272e4..19735c4 100644 (file)
@@ -12,7 +12,7 @@ elif test -d /usr/local/minivend -a -w /usr/local/minivend
 then 
        VENDROOT=/usr/local/minivend
        BASEDIR=/var/lib/minivend
-elif -d /usr/local/minivend -a -w /usr/local/minivend
+elif test -d /usr/local/minivend -a -w /usr/local/minivend
 then
        VENDROOT=$HOME/mvend
 else
@@ -69,6 +69,7 @@ do
                   --basedir=$BASEDIR \
                   --documentroot=$DOCROOT \
                   --minivenduser=minivend \
+                  --minivendgroup=minivend \
                   --serverconf=$SERVERCONF \
                   --vendroot=$VENDROOT \
                   --catroot=$BASEDIR/$i \
@@ -79,6 +80,7 @@ do
                   --demotype=$i \
                   --mailorderto=minivend@$HOST \
                   --catuser=minivend \
+                  --permtype=user \
                   --samplehtml=$DOCROOT/$i \
                   --imagedir=$DOCROOT/$i/images \
                   --imageurl=/$i/images \
index 3d12fc8..6b7b7dd 100644 (file)
@@ -14,6 +14,13 @@ __NAME__ Login
 
 [if type=explicit compare="[userdb login]"]
 mv_nextpage=[either][cgi mv_successpage][or][cgi mv_nextpage][/either]
+[perl minimate]
+       $Session->{mm_username} = tag_data( '__MINIMATE_TABLE__',
+                                                                               'username',
+                                                                               $Session->{username},
+                                                                               );
+       return;
+[/perl]
 [else]
 mv_nextpage=[either][cgi mv_failpage][or][cgi mv_nextpage][/either]
 [/else]
diff --git a/dist/simple/pages/config/report_def/New.html b/dist/simple/pages/config/report_def/New.html
new file mode 100644 (file)
index 0000000..5d42035
--- /dev/null
@@ -0,0 +1,5 @@
+[perl]
+       $Values->{saved_report} = {
+       };
+       return;
+[/perl][bounce href='[area config/report]']
diff --git a/dist/simple/pages/config/report_def/Orders%20by%20SKU%20-%20Short.html b/dist/simple/pages/config/report_def/Orders%20by%20SKU%20-%20Short.html
new file mode 100644 (file)
index 0000000..1868fae
--- /dev/null
@@ -0,0 +1,32 @@
+[perl]
+       $Values->{saved_report} = {
+'column2' => "subtotal",
+'summary2' => "subtotal",
+'report_table' => "orderline",
+'summary_only' => "0",
+'sort_option0' => "x",
+'sort_option1' => "x",
+'sort_option2' => "x",
+'edit0' => "products",
+'filter2' => "currency",
+'table0' => "orderline",
+'table1' => "products",
+'table2' => "orderline",
+'report_title' => "Orders by SKU - Short",
+'generate_page' => "Generate definition",
+'num_columns' => "3",
+'mv_session_id' => "F9DMuxFH",
+'sort_order0' => "sku",
+'search_op' => "eq",
+'break0' => "1",
+'key1' => "sku",
+'align0' => "LEFT",
+'align1' => "LEFT",
+'align2' => "RIGHT",
+'column0' => "sku",
+'align3' => "LEFT",
+'mv_nextpage' => "config/report_results",
+'column1' => "title",}
+;
+       return;
+[/perl][bounce href='[area config/report]']
diff --git a/dist/simple/pages/config/report_def/Orders%20by%20SKU.html b/dist/simple/pages/config/report_def/Orders%20by%20SKU.html
new file mode 100644 (file)
index 0000000..784fd7f
--- /dev/null
@@ -0,0 +1,49 @@
+[perl]
+       $Values->{saved_report} = {
+'report_table' => "orderline",
+'edit0' => "products",
+'table0' => "orderline",
+'edit2' => "transactions",
+'table1' => "products",
+'edit4' => "orderline",
+'table2' => "orderline",
+'edit5' => "pricing",
+'table3' => "orderline",
+'table4' => "orderline",
+'table5' => "products",
+'report_title' => "Orders by SKU",
+'editkey4' => "code",
+'editkey5' => "sku",
+'sort_order0' => "sku",
+'search_op' => "eq",
+'align0' => "LEFT",
+'align1' => "LEFT",
+'align2' => "MIDDLE",
+'column0' => "sku",
+'align3' => "RIGHT",
+'mv_nextpage' => "config/report_results",
+'column1' => "title",
+'align4' => "RIGHT",
+'align5' => "RIGHT",
+'column2' => "order_number",
+'align6' => "LEFT",
+'column3' => "quantity",
+'summary3' => "subtotal",
+'column4' => "subtotal",
+'summary4' => "subtotal",
+'column5' => "price",
+'summary_only' => "0",
+'sort_option0' => "x",
+'sort_option1' => "x",
+'sort_option2' => "x",
+'filter4' => "currency",
+'filter5' => "currency",
+'generate_page' => "Generate definition",
+'num_columns' => "6",
+'mv_session_id' => "F9DMuxFH",
+'break0' => "1",
+'key1' => "sku",
+'key5' => "sku",}
+;
+       return;
+[/perl][bounce href='[area config/report]']
diff --git a/dist/simple/pages/config/report_def/Orders%20by%20amount.html b/dist/simple/pages/config/report_def/Orders%20by%20amount.html
new file mode 100644 (file)
index 0000000..3728888
--- /dev/null
@@ -0,0 +1,46 @@
+[perl]
+       $Values->{saved_report} = {
+'report_table' => "transactions",
+'edit0' => "userdb",
+'edit1' => "transactions",
+'table0' => "transactions",
+'table1' => "transactions",
+'table2' => "userdb",
+'table3' => "userdb",
+'table4' => "userdb",
+'table5' => "userdb",
+'report_title' => "Orders by amount",
+'editkey1' => "code",
+'sort_order0' => "total_cost",
+'search_op' => "eq",
+'align0' => "LEFT",
+'align1' => "RIGHT",
+'align2' => "LEFT",
+'column0' => "username",
+'align3' => "LEFT",
+'mv_nextpage' => "config/report_results",
+'summary1' => "subtotal",
+'column1' => "total_cost",
+'align4' => "MIDDLE",
+'align5' => "LEFT",
+'column2' => "lname",
+'align6' => "LEFT",
+'column3' => "city",
+'column4' => "state",
+'column5' => "email",
+'summary_only' => "0",
+'sort_option0' => "nr",
+'sort_option1' => "x",
+'sort_option2' => "x",
+'filter1' => "commify",
+'filter5' => "mailto",
+'generate_page' => "Generate definition",
+'num_columns' => "6",
+'mv_session_id' => "F9DMuxFH",
+'key2' => "username",
+'key3' => "username",
+'key4' => "username",
+'key5' => "username",}
+;
+       return;
+[/perl][bounce href='[area config/report]']
diff --git a/dist/simple/pages/config/report_def/Products%20by%20category.html b/dist/simple/pages/config/report_def/Products%20by%20category.html
new file mode 100644 (file)
index 0000000..a24db8c
--- /dev/null
@@ -0,0 +1,41 @@
+[perl]
+       $Values->{saved_report} = {
+'report_table' => "products",
+'edit0' => "products",
+'edit1' => "cat",
+'table0' => "products",
+'table1' => "products",
+'table2' => "products",
+'table3' => "products",
+'table4' => "products",
+'report_title' => "Products by category",
+'sort_order0' => "category",
+'search_op' => "eq",
+'sort_order1' => "artist",
+'align0' => "LEFT",
+'align1' => "LEFT",
+'align2' => "LEFT",
+'column0' => "sku",
+'align3' => "LEFT",
+'mv_nextpage' => "config/report_results",
+'column1' => "category",
+'align4' => "RIGHT",
+'align5' => "LEFT",
+'column2' => "artist",
+'column3' => "title",
+'column4' => "price",
+'summary4' => "subtotal",
+'summary_only' => "0",
+'sort_option0' => "x",
+'sort_option1' => "x",
+'sort_option2' => "x",
+'filter2' => "name",
+'filter4' => "currency",
+'generate_page' => "Generate definition",
+'num_columns' => "5",
+'mv_session_id' => "F9DMuxFH",
+'break0' => "1",
+'break1' => "1",}
+;
+       return;
+[/perl][bounce href='[area config/report]']
diff --git a/dist/simple/pages/config/report_def/Products%20to%20edit.html b/dist/simple/pages/config/report_def/Products%20to%20edit.html
new file mode 100644 (file)
index 0000000..ef4dc21
--- /dev/null
@@ -0,0 +1,36 @@
+[perl]
+       $Values->{saved_report} = {
+'report_table' => "products",
+'edit0' => "products",
+'table0' => "products",
+'table1' => "products",
+'edit3' => "pricing",
+'table2' => "products",
+'table3' => "products",
+'report_title' => "Products to edit",
+'editkey3' => "sku",
+'sort_order0' => "title",
+'search_op' => "eq",
+'align0' => "LEFT",
+'align1' => "LEFT",
+'align2' => "LEFT",
+'column0' => "sku",
+'align3' => "RIGHT",
+'mv_nextpage' => "config/report_results",
+'column1' => "title",
+'align4' => "LEFT",
+'column2' => "artist",
+'column3' => "price",
+'matchlimit' => "10",
+'summary_only' => "0",
+'sort_option0' => "x",
+'sort_option1' => "x",
+'sort_option2' => "x",
+'filter1' => "20",
+'filter3' => "commify.0",
+'generate_page' => "Generate definition",
+'num_columns' => "4",
+'mv_session_id' => "F9DMuxFH",}
+;
+       return;
+[/perl][bounce href='[area config/report]']
diff --git a/dist/simple/pages/config/reports/.html b/dist/simple/pages/config/reports/.html
new file mode 100644 (file)
index 0000000..2b5d3c2
--- /dev/null
@@ -0,0 +1,117 @@
+<TABLE>
+[search-region
+               search="ra=yes
+st=db
+fi=products
+tf=category
+to=r
+tf=artist
+to=x
+tf=title
+to=fr"
+               ]
+[search-list][item-change 0][condition][item-data products category][/condition]<TR><TD ALIGN=LEFT>[if scratch first_done]SUBTOTAL: [value prev_data][/if]</TD>
+<TD ALIGN=LEFT></TD>
+<TD ALIGN=RIGHT>[if scratch first_done][filter op=|'currency'|][summary name=subtotal.products.price total=1][summary name=subtotal.products.price reset=1][/filter][/if]</TD>
+</TR><TR><TD COLSPAN=3><HR></TD><TR><TH ALIGN=LEFT>category</TH>
+<TH ALIGN=LEFT>artist</TH>
+<TH ALIGN=RIGHT>price</TH>
+</TR>
+
+[/item-change 0][set first_done]1[/set]<TR><TD ALIGN=LEFT>[item-data products category]</TD>
+<TD ALIGN=LEFT>[item-data products artist]</TD>
+<TD ALIGN=RIGHT>[filter op=|'currency'|][item-data products price][/filter][summary name=total.products.price hide=1 amount="[item-data products price]"][summary name=subtotal.products.price hide=1 amount="[item-data products price]"]</TD>
+</TR>
+[value name=prev_data hide=1 set=|[item-data products category]|][/search-list]<TR><TD>
+<B>TOTAL</B></TD>
+<TD>
+</TD>
+<TD>
+[summary
+                                                               name=total.products.price
+                                                               currency=1
+                                                               total=1
+                                                               ]
+</TD>
+</TR>
+
+[/search-region
+</TABLE>
+<TABLE>
+[search-region
+               search="ra=yes
+st=db
+fi=products
+tf=category
+to=r
+tf=artist
+to=x
+tf=title
+to=fr"
+               ]
+[search-list][item-change 0][condition][item-data products category][/condition]<TR><TD ALIGN=LEFT>[if scratch first_done]SUBTOTAL: [value prev_data][/if]</TD>
+<TD ALIGN=LEFT></TD>
+<TD ALIGN=RIGHT>[if scratch first_done][filter op=|'currency'|][summary name=subtotal.products.price total=1][summary name=subtotal.products.price reset=1][/filter][/if]</TD>
+</TR><TR><TD COLSPAN=3><HR></TD><TR><TH ALIGN=LEFT>category</TH>
+<TH ALIGN=LEFT>artist</TH>
+<TH ALIGN=RIGHT>price</TH>
+</TR>
+
+[/item-change 0][set first_done]1[/set]<TR><TD ALIGN=LEFT>[item-data products category]</TD>
+<TD ALIGN=LEFT>[item-data products artist]</TD>
+<TD ALIGN=RIGHT>[filter op=|'currency'|][item-data products price][/filter][summary name=total.products.price hide=1 amount="[item-data products price]"][summary name=subtotal.products.price hide=1 amount="[item-data products price]"]</TD>
+</TR>
+[value name=prev_data hide=1 set=|[item-data products category]|][/search-list]<TR><TD>
+<B>TOTAL</B></TD>
+<TD>
+</TD>
+<TD>
+[summary
+                                                               name=total.products.price
+                                                               currency=1
+                                                               total=1
+                                                               ]
+</TD>
+</TR>
+
+[/search-region
+</TABLE>
+<TABLE>
+[search-region
+               search="ra=yes
+st=db
+fi=products
+tf=category
+to=r
+tf=artist
+to=x
+tf=title
+to=fr"
+               ]
+[search-list][item-change 0][condition][item-data products category][/condition]<TR><TD ALIGN=LEFT>[if scratch first_done]SUBTOTAL: [value prev_data][/if]</TD>
+<TD ALIGN=LEFT></TD>
+<TD ALIGN=RIGHT>[if scratch first_done][filter op=|'currency'|][summary name=subtotal.products.price total=1][summary name=subtotal.products.price reset=1][/filter][/if]</TD>
+</TR><TR><TD COLSPAN=3><HR></TD><TR><TH ALIGN=LEFT>category</TH>
+<TH ALIGN=LEFT>artist</TH>
+<TH ALIGN=RIGHT>price</TH>
+</TR>
+
+[/item-change 0][set first_done]1[/set]<TR><TD ALIGN=LEFT>[item-data products category]</TD>
+<TD ALIGN=LEFT>[item-data products artist]</TD>
+<TD ALIGN=RIGHT>[filter op=|'currency'|][item-data products price][/filter][summary name=total.products.price hide=1 amount="[item-data products price]"][summary name=subtotal.products.price hide=1 amount="[item-data products price]"]</TD>
+</TR>
+[value name=prev_data hide=1 set=|[item-data products category]|][/search-list]<TR><TD>
+<B>TOTAL</B></TD>
+<TD>
+</TD>
+<TD>
+[summary
+                                                               name=total.products.price
+                                                               currency=1
+                                                               total=1
+                                                               ]
+</TD>
+</TR>
+
+[/search-region
+</TABLE>
diff --git a/dist/simple/pages/config/reports/Orders%20by%20SKU%20-%20Short.html b/dist/simple/pages/config/reports/Orders%20by%20SKU%20-%20Short.html
new file mode 100644 (file)
index 0000000..1f11bc8
--- /dev/null
@@ -0,0 +1,60 @@
+<HTML>
+<HEAD>
+<TITLE>Orders by SKU - Short</TITLE>
+</HEAD>
+<BODY>
+<H1>Orders by SKU - Short</H1>
+<TABLE>
+[set first_done][/set]
+[search-region more=1 search="
+               ra=yes
+               st=db
+               fi=orderline
+               ml=999999
+               tf=sku
+               to=x
+               "]
+[set first_done_sku][/set]
+[search-list]
+
+[item-change 0][condition][item-data orderline sku][/condition]
+<TR>
+       <TD ALIGN=LEFT>[if scratch first_done_sku]<HR>[value prev_data_sku]<HR>[/if]</TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=RIGHT>[if scratch first_done_sku]<HR>[filter op=|'currency'| interpolate=1][summary name=subtotal.orderline.subtotal.sku total=1][summary name=subtotal.orderline.subtotal.sku reset=1][/filter]<HR>[/if]</TD>
+</TR>
+<TR>
+       <TH ALIGN=LEFT>sku</TH>
+       <TH ALIGN=LEFT>title</TH>
+       <TH ALIGN=RIGHT>subtotal</TH>
+</TR>
+
+[/item-change 0]
+
+
+[set first_done_sku]1[/set]
+<TR>
+       <TD ALIGN=LEFT>[page href="config/edit_record"
+                                                               form="
+                                                                       mv_action=return
+                                                                       mv_data_table=products
+                                                                       mv_arg=[item-data orderline sku]
+                                                                       "][item-data orderline sku]</A></TD>
+       <TD ALIGN=LEFT>[data table=products column=title key='[item-data orderline sku]']</TD>
+       <TD ALIGN=RIGHT>[filter op=|'currency'| interpolate=1][item-data orderline subtotal][/filter][summary name=total.orderline.subtotal hide=1 amount="[item-data orderline subtotal]"][summary name=subtotal.orderline.subtotal.sku hide=1 amount="[item-data orderline subtotal]"]</TD>
+</TR>
+[value name=prev_data_sku hide=1 set=|[item-data orderline sku]|]
+[/search-list]
+<TR>
+       <TD ALIGN=LEFT>[if scratch first_done_sku]<HR>[value prev_data_sku]<HR>[/if]</TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=RIGHT>[if scratch first_done_sku]<HR>[filter op=|'currency'| interpolate=1][summary name=subtotal.orderline.subtotal.sku total=1][summary name=subtotal.orderline.subtotal.sku reset=1][/filter]<HR>[/if]</TD>
+</TR><TR>
+       <TD ALIGN=LEFT><B>TOTAL</B></TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=RIGHT><B>[filter op=|'currency'| interpolate=1][summary name=total.orderline.subtotal total=1]
+[/filter]</B></TD>
+</TR>
+
+[/search-region]
+</TABLE>
diff --git a/dist/simple/pages/config/reports/Orders%20by%20SKU.html b/dist/simple/pages/config/reports/Orders%20by%20SKU.html
new file mode 100644 (file)
index 0000000..ec14a21
--- /dev/null
@@ -0,0 +1,91 @@
+<HTML>
+<HEAD>
+<TITLE>Orders by SKU</TITLE>
+</HEAD>
+<BODY>
+<H1>Orders by SKU</H1>
+<TABLE>
+[set first_done][/set]
+[search-region more=1 search="
+               ra=yes
+               st=db
+               fi=orderline
+               ml=999999
+               tf=sku
+               to=x
+               "]
+[set first_done_sku][/set]
+[search-list]
+
+[item-change 0][condition][item-data orderline sku][/condition]
+<TR>
+       <TD ALIGN=LEFT>[if scratch first_done_sku]<HR>[value prev_data_sku]<HR>[/if]</TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=MIDDLE></TD>
+       <TD ALIGN=RIGHT>[if scratch first_done_sku]<HR>[summary name=subtotal.orderline.quantity.sku total=1][summary name=subtotal.orderline.quantity.sku reset=1]<HR>[/if]</TD>
+       <TD ALIGN=RIGHT>[if scratch first_done_sku]<HR>[filter op=|'currency'| interpolate=1][summary name=subtotal.orderline.subtotal.sku total=1][summary name=subtotal.orderline.subtotal.sku reset=1][/filter]<HR>[/if]</TD>
+       <TD ALIGN=RIGHT></TD>
+</TR>
+<TR>
+       <TH ALIGN=LEFT>sku</TH>
+       <TH ALIGN=LEFT>title</TH>
+       <TH ALIGN=MIDDLE>order_number</TH>
+       <TH ALIGN=RIGHT>quantity</TH>
+       <TH ALIGN=RIGHT>subtotal</TH>
+       <TH ALIGN=RIGHT>price</TH>
+</TR>
+
+[/item-change 0]
+
+
+[set first_done_sku]1[/set]
+<TR>
+       <TD ALIGN=LEFT>[page href="config/edit_record"
+                                                               form="
+                                                                       mv_action=return
+                                                                       mv_data_table=products
+                                                                       mv_arg=[item-data orderline sku]
+                                                                       "][item-data orderline sku]</A></TD>
+       <TD ALIGN=LEFT>[data table=products column=title key='[item-data orderline sku]']</TD>
+       <TD ALIGN=MIDDLE>[page href="config/edit_record"
+                                                               form="
+                                                                       mv_action=return
+                                                                       mv_data_table=transactions
+                                                                       mv_arg=[item-data orderline order_number]
+                                                                       "][item-data orderline order_number]</A></TD>
+       <TD ALIGN=RIGHT>[item-data orderline quantity][summary name=total.orderline.quantity hide=1 amount="[item-data orderline quantity]"][summary name=subtotal.orderline.quantity.sku hide=1 amount="[item-data orderline quantity]"]</TD>
+       <TD ALIGN=RIGHT>[page href="config/edit_record"
+                                                               form="
+                                                                       mv_action=return
+                                                                       mv_data_table=orderline
+                                                                       mv_arg=[item-data orderline code]
+                                                                       "][filter op=|'currency'| interpolate=1][item-data orderline subtotal][/filter]</A>[summary name=total.orderline.subtotal hide=1 amount="[item-data orderline subtotal]"][summary name=subtotal.orderline.subtotal.sku hide=1 amount="[item-data orderline subtotal]"]</TD>
+       <TD ALIGN=RIGHT>[page href="config/edit_record"
+                                                               form="
+                                                                       mv_action=return
+                                                                       mv_data_table=pricing
+                                                                       mv_arg=[item-data products sku]
+                                                                       "][filter op=|'currency'| interpolate=1][data table=products column=price key='[item-data orderline sku]'][/filter]</A></TD>
+</TR>
+[value name=prev_data_sku hide=1 set=|[item-data orderline sku]|]
+[/search-list]
+<TR>
+       <TD ALIGN=LEFT>[if scratch first_done_sku]<HR>[value prev_data_sku]<HR>[/if]</TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=MIDDLE></TD>
+       <TD ALIGN=RIGHT>[if scratch first_done_sku]<HR>[summary name=subtotal.orderline.quantity.sku total=1][summary name=subtotal.orderline.quantity.sku reset=1]<HR>[/if]</TD>
+       <TD ALIGN=RIGHT>[if scratch first_done_sku]<HR>[filter op=|'currency'| interpolate=1][summary name=subtotal.orderline.subtotal.sku total=1][summary name=subtotal.orderline.subtotal.sku reset=1][/filter]<HR>[/if]</TD>
+       <TD ALIGN=RIGHT></TD>
+</TR><TR>
+       <TD ALIGN=LEFT><B>TOTAL</B></TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=MIDDLE></TD>
+       <TD ALIGN=RIGHT><B>[summary name=total.orderline.quantity total=1]
+</B></TD>
+       <TD ALIGN=RIGHT><B>[filter op=|'currency'| interpolate=1][summary name=total.orderline.subtotal total=1]
+[/filter]</B></TD>
+       <TD ALIGN=RIGHT></TD>
+</TR>
+
+[/search-region]
+</TABLE>
diff --git a/dist/simple/pages/config/reports/Orders%20by%20amount.html b/dist/simple/pages/config/reports/Orders%20by%20amount.html
new file mode 100644 (file)
index 0000000..fc6706d
--- /dev/null
@@ -0,0 +1,57 @@
+<HTML>
+<HEAD>
+<TITLE>Orders by amount</TITLE>
+</HEAD>
+<BODY>
+<H1>Orders by amount</H1>
+<TABLE>
+[set first_done][/set]
+[search-region more=1 search="
+               ra=yes
+               st=db
+               fi=transactions
+               ml=999999
+               tf=total_cost
+               to=nr
+               "]
+<TR>
+       <TH ALIGN=LEFT>username</TH>
+       <TH ALIGN=RIGHT>total_cost</TH>
+       <TH ALIGN=LEFT>lname</TH>
+       <TH ALIGN=LEFT>city</TH>
+       <TH ALIGN=MIDDLE>state</TH>
+       <TH ALIGN=LEFT>email</TH>
+</TR>
+[search-list]
+<TR>
+       <TD ALIGN=LEFT>[page href="config/edit_record"
+                                                               form="
+                                                                       mv_action=return
+                                                                       mv_data_table=userdb
+                                                                       mv_arg=[item-data transactions username]
+                                                                       "][item-data transactions username]</A></TD>
+       <TD ALIGN=RIGHT>[page href="config/edit_record"
+                                                               form="
+                                                                       mv_action=return
+                                                                       mv_data_table=transactions
+                                                                       mv_arg=[item-data transactions code]
+                                                                       "][filter op=|'commify'| interpolate=1][item-data transactions total_cost][/filter]</A>[summary name=total.transactions.total_cost hide=1 amount="[item-data transactions total_cost]"]</TD>
+       <TD ALIGN=LEFT>[data table=userdb column=lname key='[item-data transactions username]']</TD>
+       <TD ALIGN=LEFT>[data table=userdb column=city key='[item-data transactions username]']</TD>
+       <TD ALIGN=MIDDLE>[data table=userdb column=state key='[item-data transactions username]']</TD>
+       <TD ALIGN=LEFT>[filter op=|'mailto'| interpolate=1][data table=userdb column=email key='[item-data transactions username]'][/filter]</TD>
+</TR>
+
+[/search-list]
+<TR>
+       <TD ALIGN=LEFT><B>TOTAL</B></TD>
+       <TD ALIGN=RIGHT><B>[filter op=|'commify'| interpolate=1][summary name=total.transactions.total_cost total=1]
+[/filter]</B></TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=MIDDLE></TD>
+       <TD ALIGN=LEFT></TD>
+</TR>
+
+[/search-region]
+</TABLE>
diff --git a/dist/simple/pages/config/reports/Products%20by%20category.html b/dist/simple/pages/config/reports/Products%20by%20category.html
new file mode 100644 (file)
index 0000000..a28f137
--- /dev/null
@@ -0,0 +1,98 @@
+<HTML>
+<HEAD>
+<TITLE>Products by category</TITLE>
+</HEAD>
+<BODY>
+<H1>Products by category</H1>
+<TABLE>
+[set first_done][/set]
+[search-region more=1 search="
+               ra=yes
+               st=db
+               fi=products
+               ml=999999
+               tf=category
+               to=x
+               tf=artist
+               to=x
+               "]
+[set first_done_category][/set]
+[set first_done_artist][/set]
+[search-list]
+
+[item-change 1][condition][item-data products artist][/condition]
+<TR>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=LEFT>[if scratch first_done_artist]<HR>[value prev_data_artist]<HR>[/if]</TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=RIGHT>[if scratch first_done_artist]<HR>[filter op=|'currency'| interpolate=1][summary name=subtotal.products.price.artist total=1][summary name=subtotal.products.price.artist reset=1][/filter]<HR>[/if]</TD>
+</TR>
+
+[/item-change 1]
+
+
+[set first_done_artist]1[/set]
+
+[item-change 0][condition][item-data products category][/condition]
+<TR>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=LEFT>[if scratch first_done_category]<HR>[value prev_data_category]<HR>[/if]</TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=RIGHT>[if scratch first_done_category]<HR>[filter op=|'currency'| interpolate=1][summary name=subtotal.products.price.category total=1][summary name=subtotal.products.price.category reset=1][/filter]<HR>[/if]</TD>
+</TR>
+<TR>
+       <TH ALIGN=LEFT>sku</TH>
+       <TH ALIGN=LEFT>category</TH>
+       <TH ALIGN=LEFT>artist</TH>
+       <TH ALIGN=LEFT>title</TH>
+       <TH ALIGN=RIGHT>price</TH>
+</TR>
+
+[/item-change 0]
+
+
+[set first_done_category]1[/set]
+<TR>
+       <TD ALIGN=LEFT>[page href="config/edit_record"
+                                                               form="
+                                                                       mv_action=return
+                                                                       mv_data_table=products
+                                                                       mv_arg=[item-data products sku]
+                                                                       "][item-data products sku]</A></TD>
+       <TD ALIGN=LEFT>[page href="config/edit_record"
+                                                               form="
+                                                                       mv_action=return
+                                                                       mv_data_table=cat
+                                                                       mv_arg=[item-data products category]
+                                                                       "][item-data products category]</A></TD>
+       <TD ALIGN=LEFT>[filter op=|'name'| interpolate=1][item-data products artist][/filter]</TD>
+       <TD ALIGN=LEFT>[item-data products title]</TD>
+       <TD ALIGN=RIGHT>[filter op=|'currency'| interpolate=1][item-data products price][/filter][summary name=total.products.price hide=1 amount="[item-data products price]"][summary name=subtotal.products.price.artist hide=1 amount="[item-data products price]"][summary name=subtotal.products.price.category hide=1 amount="[item-data products price]"]</TD>
+</TR>
+[value name=prev_data_artist hide=1 set=|[item-data products artist]|][value name=prev_data_category hide=1 set=|[item-data products category]|]
+[/search-list]
+<TR>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=LEFT>[if scratch first_done_artist]<HR>[value prev_data_artist]<HR>[/if]</TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=RIGHT>[if scratch first_done_artist]<HR>[filter op=|'currency'| interpolate=1][summary name=subtotal.products.price.artist total=1][summary name=subtotal.products.price.artist reset=1][/filter]<HR>[/if]</TD>
+</TR><TR>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=LEFT>[if scratch first_done_category]<HR>[value prev_data_category]<HR>[/if]</TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=RIGHT>[if scratch first_done_category]<HR>[filter op=|'currency'| interpolate=1][summary name=subtotal.products.price.category total=1][summary name=subtotal.products.price.category reset=1][/filter]<HR>[/if]</TD>
+</TR><TR>
+       <TD ALIGN=LEFT><B>TOTAL</B></TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=LEFT></TD>
+       <TD ALIGN=RIGHT>[filter op=|'currency'| interpolate=1][summary name=total.products.price total=1]
+[/filter]</TD>
+</TR>
+
+[/search-region]
+</TABLE>
diff --git a/dist/simple/pages/config/reports/Products%20to%20edit.html b/dist/simple/pages/config/reports/Products%20to%20edit.html
new file mode 100644 (file)
index 0000000..5a55c20
--- /dev/null
@@ -0,0 +1,51 @@
+<HTML>
+<HEAD>
+<TITLE>Products to edit</TITLE>
+</HEAD>
+<BODY>
+<H1>Products to edit</H1>
+<TABLE>
+[set first_done][/set]
+[search-region more=1 search="
+               ra=yes
+               st=db
+               fi=products
+               ml=10
+               sp=config/reports/Products to edit
+               tf=title
+               to=x
+               "]
+<TR>
+       <TH ALIGN=LEFT>sku</TH>
+       <TH ALIGN=LEFT>title</TH>
+       <TH ALIGN=LEFT>artist</TH>
+       <TH ALIGN=RIGHT>price</TH>
+</TR>
+[search-list]
+<TR>
+       <TD ALIGN=LEFT>[page href="config/edit_record"
+                                                               form="
+                                                                       mv_action=return
+                                                                       mv_data_table=products
+                                                                       mv_arg=[item-data products sku]
+                                                                       "][item-data products sku]</A></TD>
+       <TD ALIGN=LEFT>[filter op=|'20'| interpolate=1][item-data products title][/filter]</TD>
+       <TD ALIGN=LEFT>[item-data products artist]</TD>
+       <TD ALIGN=RIGHT>[page href="config/edit_record"
+                                                               form="
+                                                                       mv_action=return
+                                                                       mv_data_table=pricing
+                                                                       mv_arg=[item-data products sku]
+                                                                       "][filter op=|'commify.0'| interpolate=1][item-data products price][/filter]</A></TD>
+</TR>
+
+[/search-list]
+<TR><TD COLSPAN=4><HR></TD></TR>[more-list]
+<TR>
+       <TD>More</TD>
+       <TD COLSPAN=3>[more]</TD>
+       </TR>
+[/more-list]
+
+[/search-region]
+</TABLE>
index 80a35b9..734a073 100644 (file)
@@ -67,14 +67,16 @@ lose your shopping cart.
        <TH __TABLEBG__ WIDTH="2">&nbsp;</TH>
        <TD __TABLEFG__ VALIGN=TOP MARGINWIDTH=12 MARGINHEIGHT=12>
        [page [item-code]][item-description]</A>
+       [if-item-data pricing sku]
                <BR>[page quantity [item-code]]
                        <FONT SIZE=1 COLOR=__CONTRAST__>QUANTITY PRICING</FONT>
                        </A>
-       [if-field weight]<BR>
+       [/if-item-data]
+       [if-item-field weight]<BR>
        <SMALL>WEIGHT: [summary amount=`[item-quantity] * [item-field weight]`]</SMALL>
-       [/if-field]
+       [/if-item-field]
        <BR>
-       [if-field related]
+       [if-item-field related]
        [if !ordered [item-field related]]
        <TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
        [loop arg="[item-field related]"]
@@ -94,7 +96,7 @@ lose your shopping cart.
        [/loop]
        </TABLE>
        [/if]
-       [/if-field]<FONT SIZE=1>[item-accessories size][item-accessories color]</FONT>  
+       [/if-item-field]<FONT SIZE=1>[item-accessories size][item-accessories color]</FONT>     
        </TD>
        <TD __TABLEFG__ VALIGN=TOP ALIGN=CENTER>
        <INPUT TYPE=text NAME="[quantity-name]" VALUE="[item-quantity]" SIZE=3>
index c0d2d3f..1ab6752 100644 (file)
@@ -67,14 +67,16 @@ lose your shopping cart.
        <TH __TABLEBG__ WIDTH="2">&nbsp;</TH>
        <TD __TABLEFG__ VALIGN=TOP MARGINWIDTH=12 MARGINHEIGHT=12>
        [page [item-code]][item-description]</A>
+       [if-item-data pricing sku]
                <BR>[page quantity [item-code]]
                        <FONT SIZE=1 COLOR=__CONTRAST__>QUANTITY PRICING</FONT>
                        </A>
-       [if-field weight]<BR>
+       [/if-item-data]
+       [if-item-field weight]<BR>
        <SMALL>WEIGHT: [summary amount=`[item-quantity] * [item-field weight]`]</SMALL>
-       [/if-field]
+       [/if-item-field]
        <BR>
-       [if-field related]
+       [if-item-field related]
        [if !ordered [item-field related]]
        <TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
        [loop arg="[item-field related]"]
@@ -94,7 +96,7 @@ lose your shopping cart.
        [/loop]
        </TABLE>
        [/if]
-       [/if-field]<FONT SIZE=1>[item-accessories size][item-accessories color]</FONT>  
+       [/if-item-field]<FONT SIZE=1>[item-accessories size][item-accessories color]</FONT>     
        </TD>
        <TD __TABLEFG__ VALIGN=TOP ALIGN=CENTER>
        <INPUT TYPE=text NAME="[quantity-name]" VALUE="[item-quantity]" SIZE=3>
index 32f300c..46a21e8 100644 (file)
@@ -3,7 +3,7 @@ code    description     criteria        min     max     formula query   opt
 default        No shipping     weight  0       99999999        g PriceDivide           
                                                        
 upsg   UPS Ground      weight  0       0       e Nothing to ship!              
-upsg   UPS Ground      weight  0       150     u Ground [default zip 98366] 3.00               
+upsg   UPS Ground      weight  0       150     u Ground [value name=zip filter=digits default=45056] __MVC_UPSADDER__
 upsg   UPS Ground      weight  150     999999  e @@TOTAL@@ lbs too heavy for UPS               
                                                        
 upsb: UPS Two Day                                                      
@@ -18,15 +18,15 @@ upsb: UPS Two Day
        zone    450
        table   2ndDayAir
        geo     zip
-       default_zip 98366
-       adder   3
+       default_zip 45056
+       adder   __MVC_UPSADDER__
                                                        
        min             150                             
        max             999999                          
        cost    e @@TOTAL@@ lbs too heavy for UPS                                       
                                                        
 upsr   UPS Next Day    weight  0       0       e Nothing to ship!              
-upsr   UPS Next Day    weight  0       150     u NextDayAir [default zip 98366] 3.00           
+upsr   UPS Next Day    weight  0       150     u NextDayAir [value name=zip filter=digits default=45056] __MVC_UPSADDER__
 upsr   UPS Next Day    weight  150     999999  e @@TOTAL@@ lbs too heavy for UPS               
                                                        
 surf_A Int'l Surface A weight  0       0       e Nothing to ship!              
diff --git a/dist/src/mod_perl_tlink.pl b/dist/src/mod_perl_tlink.pl
new file mode 100755 (executable)
index 0000000..7149438
--- /dev/null
@@ -0,0 +1,195 @@
+#!/usr/bin/perl
+# tlink.pl: runs as a cgi program and passes request to Vend server
+#
+#   $Id: tlink.pl,v 1.2 1998/08/16 10:26:14 mike Exp $
+#
+# Copyright 1996-1998 by Michael J. Heins <mikeh@minivend.com>
+#
+#    This program is free software; you can redistribute it and/or
+#    modify it under the terms of the GNU General Public License as
+#    published by the Free Software Foundation; either version 2 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#    General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program; if not, write to the Free Software
+#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+require 5.005;
+use strict;
+use Apache::Registry;
+use Socket;
+my @port_pool = (
+       7786,
+);
+
+my $LINK_TIMEOUT = 10;
+#my $LINK_TIMEOUT = ~_~LINK_TIMEOUT~_~;
+my $LINK_PORT    = $ENV{MINIVEND_PORT} || 7786;
+#my $LINK_PORT    = $ENV{MINIVEND_PORT} || ~_~LINK_HOST~_~;
+my $LINK_HOST    = 'localhost';
+#my $LINK_HOST    = '~_~LINK_HOST~_~';
+my $ERROR_ACTION = "-notify";
+
+# Uncomment this if you want to rotate ports....set port_pool above.
+# Will increase MV performance if you use multiple ports.
+#my $LINK_PORT    = $port_pool[ int( rand (scalar @port_pool) ) ];
+
+$ENV{PATH} = "/bin:/usr/bin";
+$ENV{IFS} = " ";
+
+my (%exclude_header) = qw/
+               SERVER_SIGNATURE    1
+               HTTP_ACCEPT_CHARSET 1
+               HTTP_ACCEPT         1
+               PATH                1
+               IFS                 1
+/;
+
+my $r = Apache->request();
+my $arg;
+my $env;
+my $ent;
+
+
+# Return this message to the browser when the server is not running.
+# Log an error log entry if set to notify
+
+sub server_not_running {
+
+       my $msg;
+
+       if($ERROR_ACTION =~ /not/i) {
+               warn "ALERT: MiniVend server not running for $ENV{SCRIPT_NAME}\n";      
+       }
+
+       $| = 1;
+       $r->content_type ("text/html");
+       $r->send_http_header("text/html");
+       $r->print (<<EOF);
+<HTML><HEAD><TITLE>MiniVend server not running</TITLE></HEAD>
+<BODY BGCOLOR="#FFFFFF">
+<H3>We're sorry, the MiniVend server was not running...</H3>
+<P>
+We are out of service or may be experiencing high system demand,
+please try again soon.
+
+<H3>This is it:</H3>
+<PRE>
+$arg
+$env
+$ent
+</PRE>
+
+</BODY></HTML>
+EOF
+
+}
+
+# Return this message to the browser when a system error occurs.
+#
+sub die_page {
+  $r->print("Content-type: text/plain\r\n\r\n");
+  $r->print("We are sorry, but the cgi-bin server is unavailable due to a\r\n");
+  $r->print("system error.\r\n\r\n");
+  $r->print(sprintf "%s: %s (%d)\r\n", $_[0], $!, $?);
+  if($ERROR_ACTION =~ /not/i) {
+       warn "ALERT: MiniVend $ENV{SCRIPT_NAME} $_[0]: $! ($?)\n";
+  }
+  Apache::exit(1);
+}
+
+
+# Read the entity from stdin if present.
+
+sub send_arguments {
+
+       my $count = @ARGV;
+       my $val = "arg $count\n";
+       for(@ARGV) {
+               $val .= length($_);
+               $val .= " $_\n";
+       }
+       return $val;
+}
+
+sub send_environment () {
+       my (@tmp) = keys %ENV;
+       my $count = @tmp;
+       my ($str);
+       my $val = "";
+       for(@tmp) {
+               ($count--, next) if defined $exclude_header{$_};
+               $str = "$_=$ENV{$_}";
+               $val .= length($str);
+               $val .= " $str\n";
+       }
+       $val = "env $count\n$val";
+       return $val;
+}
+
+sub send_entity {
+       return '' unless defined $ENV{CONTENT_LENGTH};
+       my $len = $ENV{CONTENT_LENGTH};
+       return '' unless $len > 0;
+
+       my $val = "entity\n";
+       $val .= "$len ";
+       return $val . $r->content() . "\n";
+}
+
+$arg = send_arguments();
+$env = send_environment();
+$ent = send_entity();
+
+$SIG{PIPE} = sub { die_page("signal"); };
+$SIG{ALRM} = sub { server_not_running(); exit 1; };
+
+alarm $LINK_TIMEOUT;
+
+my ($remote, $port, $iaddr, $paddr, $proto, $line);
+
+$remote = $LINK_HOST;
+$port   = $LINK_PORT;
+
+if ($port =~ /\D/) { $port = getservbyname($port, 'tcp'); }
+
+die_page("no port") unless $port;
+
+$iaddr = inet_aton($remote);
+$paddr = sockaddr_in($port,$iaddr);
+
+$proto = getprotobyname('tcp');
+
+local(*SOCK);
+socket(SOCK, PF_INET, SOCK_STREAM, $proto)     or die "socket: $!\n";
+
+my $ok;
+
+do {
+   $ok = connect(SOCK, $paddr);
+} while ( ! defined $ok and $! =~ /interrupt/i);
+
+my $def = defined $ok;
+die "ok=$ok def: $def connect port=$LINK_PORT: $!\n" if ! $ok;
+
+use vars qw/$in $l/;
+
+select SOCK;
+$| = 1;
+
+alarm 0;
+for ( $arg, $env, $ent, "end\n" ) {
+       print $_;
+}
+
+while( <SOCK> ) {
+       $r->print($_);
+}
+
+close (SOCK)                                                           or die "close: $!\n";
+Apache::exit();
index 6ccf695..afbb4c7 100644 (file)
@@ -1,6 +1,6 @@
 # Config.pm - Configure Minivend
 #
-# $Id: Config.pm,v 1.12 2000/03/02 10:32:12 mike Exp $
+# $Id: Config.pm,v 1.13 2000/03/09 13:31:26 mike Exp mike $
 #
 # Copyright 1996-2000 by Michael J. Heins <mikeh@minivend.com>
 #
@@ -101,7 +101,7 @@ BEGIN {
        };
 }
 
-$VERSION = substr(q$Revision: 1.12 $, 10);
+$VERSION = substr(q$Revision: 1.13 $, 10);
 
 for( qw(search refresh cancel return secure unsecure submit control checkout) ) {
        $Global::LegalAction{$_} = 1;
@@ -197,8 +197,13 @@ sub config_error {
                        $configfile,
                        $Vend::config_line,
        );
-    ::logGlobal({level => 'warn'}, $msg);
-    die "$msg\n";
+    if ($Vend::ExternalProgram) {
+               warn "$msg\n";
+       }
+       else {
+               ::logGlobal({level => 'warn'}, $msg);
+               die "$msg\n";
+       }
 }
 
 sub config_warn {
@@ -1184,6 +1189,8 @@ EOF
 sub parse_require {
        my($var, $val) = @_;
 
+       return if $Vend::ExternalProgram;
+
        my $require;
        my $name;
        if($val =~ s/^globalsub\s+//i) {
index 0a926d1..943aa3f 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # Interpolate.pm - Interpret MiniVend tags
 # 
-# $Id: Interpolate.pm,v 1.12 2000/03/02 10:32:26 mike Exp $
+# $Id: Interpolate.pm,v 1.13 2000/03/09 13:31:54 mike Exp mike $
 #
 # Copyright 1996-2000 by Michael J. Heins <mikeh@minivend.com>
 #
@@ -32,7 +32,7 @@ package Vend::Interpolate;
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 1.12 $, 10);
+$VERSION = substr(q$Revision: 1.13 $, 10);
 
 @EXPORT = qw (
 
@@ -531,6 +531,10 @@ sub filter_value {
        my @args;
        for (@filters) {
                @args = ();
+               if(/%/) {
+                       $value = sprintf($_, $value);
+                       next;
+               }
                while( s/\.([^.]+)$//) {
                        unshift @args, $1;
                }
@@ -691,6 +695,36 @@ sub tag_data {
        'filesafe' =>   sub {
                                                return Vend::Util::escape_chars(shift);
                                },
+       'currency' =>   sub {
+                                               my ($val, $tag, $locale) = @_;
+                                               my $convert = $locale ? 1 : 0;
+                                               return Vend::Util::currency(
+                                                               $val,
+                                                               0,
+                                                               $convert,
+                                                               { locale => $locale }
+                                                       );
+                               },
+       'mailto' =>     sub {
+                                               my ($val,$tag,@arg) = @_;
+                                               my $out = qq{<A HREF="mailto:$val">};
+                                               my $anchor = $val;
+                                               if(@arg) {
+                                                       $anchor = join " ", @arg;
+                                               }
+                                               $out .= "$anchor</A>";
+                               },
+       'bold' =>               sub { return '<B>' . shift(@_) . '</B>'; },
+       'italics' =>    sub { return '<I>' . shift(@_) . '</I>'; },
+       'strikeout' =>  sub { return '<strike>' . shift(@_) . '</strike>'; },
+       'small' =>              sub { return '<small>' . shift(@_) . '</small>'; },
+       'large' =>              sub { return '<large>' . shift(@_) . '</large>'; },
+       'commify' =>    sub {
+                                               my ($val, $tag, $places) = @_;
+                                               $places = 2 unless defined $places;
+                                               $val = sprintf("%.${places}f", $val) if $places;
+                                               return Vend::Util::commify($val);
+                               },
        'lookup' =>     sub {
                                                my ($val, $tag, $table, $column) = @_;
                                                return tag_data($table, $column, $val) || $val;
@@ -2063,6 +2097,7 @@ sub tag_value {
        }
        $::Scratch->{$var} = $value if $opt->{scratch};
        return '' if $opt->{hide};
+    return $opt->{default} if ! $value and defined $opt->{default};
     return $value;
 }
 
@@ -2093,20 +2128,9 @@ sub tag_file {
 # Returns the text of a user entered field named VAR.
 # Same as tag value except returns 'default' if not present
 sub tag_default {
-    my($var, $default, $set) = @_;
-    my($value);
-       $default = 'default' if ! length $default;
-       if(! $default and $var =~ s/\s+(.*)//s) {
-               $default = $1;
-       }
-    if (defined ($value = $::Values->{$var}) and $value) {
-               # do nothing
-    } elsif ($set) {
-               $value = $::Values->{$var} = $default;
-    } else {
-               $value = $default;
-    }
-       return $set ?  '' : $value;
+    my($var, $default, $opt) = @_;
+       $opt->{default} = !(length $default) ? 'default' : $default;
+    return tag_value($var, $opt);
 }
 
 sub esc {
@@ -2772,8 +2796,7 @@ sub more_link {
                $pa =~ s/__BORDER__/$border/e;
                $arg = "$session:$next:$last:$chunk";
                $list .= '<A HREF="';
-               #$list .= vendUrl("scan/MM=$arg/np=$page");
-               $list .= tag_area( "scan/MM=$arg", '', { form => "mv_nextpage=$page" });
+               $list .= tag_area( "scan/MM=$arg", '', { form => $form_arg });
                $list .= '">';
                $list .= $pa;
                $list .= '</A> ';
@@ -2851,7 +2874,6 @@ sub tag_more_list {
                        $arg .= $first - 1;
                        $arg .= ":$chunk";
                        $list .= '<A HREF="';
-                       #$list .= vendUrl("scan/MM=$arg/np=$page");
                        my $form_arg = "mv_nextpage=$page";
                        $form_arg .= "\npf=$prefix" if $prefix;
                        $list .= tag_area( "scan/MM=$arg", '', { form => $form_arg });
@@ -2880,11 +2902,9 @@ sub tag_more_list {
                $last = $last > ($total - 1) ? $total - 1 : $last;
                $arg = "$session:$next:$last:$chunk";
                $next_tag .= '<A HREF="';
-               #$next_tag .= vendUrl("scan/MM=$arg$pfu/np=$page");
-               $next_tag .= tag_area("scan/MM=$arg");
-               $next_tag .= $next_tag =~ /\?.+=/ ? '&' : '?';
-               $next_tag .= "mv_nextpage=$page";
-               $next_tag .= "&pf=$prefix" if $prefix;
+               my $form_arg = "mv_nextpage=$page";
+               $form_arg .= "\npf=$prefix" if $prefix;
+               $next_tag .= tag_area( "scan/MM=$arg", '', { form => $form_arg });
                $next_tag .= '">';
                $next_tag .= $next_anchor;
                $next_tag .= '</A>';
index b5a37a5..e47e529 100644 (file)
@@ -1,6 +1,6 @@
 # Parse.pm - Parse MiniVend tags
 # 
-# $Id: Parse.pm,v 1.13 2000/03/02 10:33:03 mike Exp $
+# $Id: Parse.pm,v 1.14 2000/03/09 13:32:44 mike Exp mike $
 #
 # Copyright 1996-2000 by Michael J. Heins <mikeh@minivend.com>
 #
 
 package Vend::Parse;
 
-# $Id: Parse.pm,v 1.13 2000/03/02 10:33:03 mike Exp $
+# $Id: Parse.pm,v 1.14 2000/03/09 13:32:44 mike Exp mike $
 
 require Vend::Parser;
 
 
-$VERSION = sprintf("%d.%02d", q$Revision: 1.13 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 1.14 $ =~ /(\d+)\.(\d+)/);
 
 use Safe;
 use Vend::Util;
@@ -44,7 +44,7 @@ require Exporter;
 
 @ISA = qw(Exporter Vend::Parser);
 
-$VERSION = substr(q$Revision: 1.13 $, 10);
+$VERSION = substr(q$Revision: 1.14 $, 10);
 @EXPORT = ();
 @EXPORT_OK = qw(find_matching_end);
 
@@ -141,7 +141,7 @@ my %Order = (
                                'currency'              => [qw( convert noformat )],
                                checked                 => [qw( name value multiple default)],
                                data                    => [qw( table field key )],
-                               default                 => [qw( name default set)],
+                               default                 => [qw( name default )],
                                dump                    => [qw( )],
                                description             => [qw( code base )],
                                discount                => [qw( code  )],
@@ -217,6 +217,7 @@ my %addAttr = (
                                        banner          1
                                        catch           1
                                        data                    1
+                                       default                 1
                                        ecml            1
                                        error           1
                                        export          1
index 41b998b..363f11a 100644 (file)
@@ -1,6 +1,6 @@
 # Server.pm:  listen for cgi requests as a background server
 #
-# $Id: Server.pm,v 1.8 2000/03/02 10:33:24 mike Exp $
+# $Id: Server.pm,v 1.9 2000/03/09 13:32:55 mike Exp mike $
 #
 # Copyright 1996-2000 by Michael J. Heins <mikeh@minivend.com>
 #
@@ -28,7 +28,7 @@
 package Vend::Server;
 
 use vars qw($VERSION);
-$VERSION = substr(q$Revision: 1.8 $, 10);
+$VERSION = substr(q$Revision: 1.9 $, 10);
 
 use POSIX qw(setsid strftime);
 use Vend::Util;
@@ -255,6 +255,7 @@ sub create_cookie {
        my ($name, $value, $out, $expire, $cookie);
        my @jar;
        @jar = ['MV_SESSION_ID', $Vend::SessionName, $Vend::Expire || undef];
+       push @jar, ['MV_STATIC', 1] if $Vend::Cfg->{Static};
        push @jar, @{$::Instance->{Cookies}}
                if defined $::Instance->{Cookies};
        $out = '';
@@ -293,8 +294,8 @@ sub respond {
                $Vend::StatusLine = "HTTP/1.0 200 OK\r\n$Vend::StatusLine"
                        if defined $Vend::InternalHTTP
                                and $Vend::StatusLine !~ m{^HTTP/};
-               $Vend::StatusLine .= $Vend::StatusLine =~ /^Content-Type:/im
-                                                       ? '' : "Content-Type: text/html\r\n";
+               $Vend::StatusLine .= ($Vend::StatusLine =~ /^Content-Type:/im)
+                                                       ? '' : "\r\nContent-Type: text/html\r\n";
                print Vend::Server::MESSAGE canon_status($Vend::StatusLine);
                print Vend::Server::MESSAGE "\r\n";
                print Vend::Server::MESSAGE $$body;
@@ -605,7 +606,7 @@ EOF
        if (defined $doc) {
                $path =~ /\.([^.]+)$/;
                $Vend::StatusLine = '' unless defined $Vend::StatusLine;
-               $Vend::StatusLine .= "Content-type: " . ($MIME_type{$1} || "text/plain");
+               $Vend::StatusLine .= "\r\nContent-type: " . ($MIME_type{$1} || "text/plain");
                respond(
                                        '',
                                        \$doc,
@@ -658,13 +659,13 @@ sub read_cgi_data {
 sub connection {
     my (%env, $entity);
     my $http;
-#::logGlobal ("begin connection: " . (join " ", times()) . "\n");
+#::logDebug ("begin connection: " . (join " ", times()) . "\n");
     read_cgi_data(\@Global::argv, \%env, \$entity)
        or return 0;
        $http = new Vend::Server \*Vend::Server::MESSAGE, \%env, $entity;
 #::logGlobal ("begin dispatch: " . (join " ", times()) . "\n");
     ::dispatch($http);
-#::logGlobal ("end connection: " . (join " ", times()) . "\n");
+#::logDebug ("end connection: " . (join " ", times()) . "\n");
        undef $Vend::ResponseMade;
        undef $Vend::InternalHTTP;
 }
index 4665e6a..de67601 100644 (file)
@@ -1,6 +1,6 @@
 # Session.pm - Minivend Sessions
 #
-# $Id: Session.pm,v 1.4 2000/03/02 10:33:25 mike Exp $
+# $Id: Session.pm,v 1.5 2000/03/09 13:33:27 mike Exp mike $
 # 
 # Copyright 1996-2000 by Michael J. Heins <mikeh@minivend.com>
 #
@@ -30,7 +30,7 @@ package Vend::Session;
 require Exporter;
 
 use vars qw($VERSION);
-$VERSION = substr(q$Revision: 1.4 $, 10);
+$VERSION = substr(q$Revision: 1.5 $, 10);
 
 @ISA = qw(Exporter);
 
@@ -128,7 +128,8 @@ File => [ 1, 0, sub {
 sub get_session {
        $Vend::HaveSession = 0;
        open_session();
-       my $new = read_session();
+       my $new;
+       $new = read_session() unless $Vend::ExternalProgram;
        unless($File_sessions) {
                lock_session();
                close_session();
index 086e718..3cc7682 100644 (file)
@@ -1,6 +1,6 @@
 # Util.pm - Minivend utility functions
 #
-# $Id: Util.pm,v 1.9 2000/03/02 10:33:45 mike Exp $
+# $Id: Util.pm,v 1.10 2000/03/09 13:33:40 mike Exp mike $
 # 
 # Copyright 1996-2000 by Michael J. Heins <mikeh@minivend.com>
 #
@@ -73,7 +73,7 @@ use Config;
 use Fcntl;
 use subs qw(logError logGlobal);
 use vars qw($VERSION @EXPORT @EXPORT_OK);
-$VERSION = substr(q$Revision: 1.9 $, 10);
+$VERSION = substr(q$Revision: 1.10 $, 10);
 
 BEGIN {
        eval {
@@ -296,8 +296,9 @@ sub setlocale {
 
 
 sub currency {
-       my($amount, $noformat, $convert) = @_;
+       my($amount, $noformat, $convert, $opt) = @_;
 #::logDebug("currency called: amount=$amount no=$noformat convert=$convert");
+       $opt = {} unless $opt;
        $amount = $amount / $Vend::Cfg->{PriceDivide} if $convert;
        return $amount if $noformat;
        my $loc;
@@ -306,7 +307,7 @@ sub currency {
        my $fmt;
        my $precede = '';
        my $succede = '';
-       if ($loc = $Vend::Cfg->{Locale}) {
+       if ($loc = $opt->{locale} || $Vend::Cfg->{Locale}) {
                $sep = $loc->{mon_thousands_sep} || $loc->{thousands_sep} || ',';
                $dec = $loc->{mon_decimal_point} || $loc->{decimal_point} || '.';
                return picture_format($amount, $loc->{price_picture}, $sep, $dec)
index 304d3eb..160c840 100644 (file)
@@ -483,12 +483,12 @@ For example, if you answered C<www.mydomain.com> at the prompt
 for server name, then you would see this difference in the catalog.cfg file:
 
     # template
-    Variable SERVER_NAME  __MVC_SERVERNAME__
+    Variable SERVER_NAME  &#32;_MVC_SERVERNAME__
 
     # configured catalog
     Variable SERVER_NAME  www.mydomain.com
 
-The macro string __MVC_SERVERNAME__ was substituted with the answer to
+The macro string &#32;_MVC_SERVERNAME__ was substituted with the answer to
 the question about server name.  In the same way, other variables are
 substituted, and include (at least):
 
@@ -510,7 +510,7 @@ the COMPANY variable in catalog.cfg, you could run a pre-qualifying
 script that set the environment variable MVC_COMPANY and then place in
 the catalog.cfg file:
 
-    Variable   COMPANY   __MVC_COMPANY__
+    Variable   COMPANY   &#32;_MVC_COMPANY__
 
 All files within a template directory are substituted for macros,
 not just the catalog.cfg file. There are two special directories
@@ -565,7 +565,7 @@ The prompt would now be:
 If the file I<config/precopy_commands> exists, it will be read as
 a command followed by the prompt/help value.
 
-    mysqladmin create __MVC_CATALOGNAME__
+    mysqladmin create &#32;_MVC_CATALOGNAME__
     We need to create an SQL database for your Minivend
     database tables.
 
index 5d0c077..fd2d6db 100644 (file)
@@ -476,6 +476,22 @@ all relevant to most questions.
 
 =item *
 
+The question is not easily comprehended.
+
+Sometimes this is due to language difficulties. While there are many
+Minivend users speaking many different languages, and there are a couple
+of language-specific user lists, the language on the main mail list is
+English. The clearer the question, the more likely you are to get an
+answer. Babelfish translations will probably not get it.
+
+=item *
+
+The question makes unreasonable demands. For instance, if you are trying
+to build a multi-store mall, and you are asking for step-by-step instructions
+on how to do it, you are unlikely to get an answer.
+
+=item *
+
 Question is answered in this FAQ, the README, or by doing a
 simple text search (with keywords you mention) in the documentation.
 Most people won't do manual reading for you -- they expect you to
index 0fd602a..1e20f17 100644 (file)
@@ -25,7 +25,7 @@ DOIT: {
 #
 # MiniVend link program configurator
 #
-# $Id: compile_link,v 1.4 2000/03/02 10:34:12 mike Exp mike $
+# $Id: compile_link,v 1.4 2000/03/02 10:34:12 mike Exp $
 #
 # Copyright 1996-2000 by Michael J. Heins <mikeh@minivend.com>
 #
index 12b9c05..5c5944c 100644 (file)
@@ -25,7 +25,7 @@ DOIT: {
 #
 # MiniVend program configurator
 #
-# $Id: config_prog,v 1.4 2000/03/02 10:34:24 mike Exp mike $
+# $Id: config_prog,v 1.4 2000/03/02 10:34:24 mike Exp $
 #
 # Copyright 1996-2000 by Michael J. Heins <mikeh@minivend.com>
 #
@@ -153,7 +153,7 @@ config_prog -- Configure MiniVend programs with MakeMaker variables
 
 =head1 VERSION
 
-$Id: config_prog,v 1.4 2000/03/02 10:34:24 mike Exp mike $
+$Id: config_prog,v 1.4 2000/03/02 10:34:24 mike Exp $
 
 =head1 DESCRIPTION
 
index d105c0f..bfda457 100644 (file)
@@ -25,7 +25,7 @@ DOIT: {
 #
 # MiniVend session dumper
 #
-# $Id: dump,v 1.4 2000/03/02 10:34:28 mike Exp mike $
+# $Id: dump,v 1.4 2000/03/02 10:34:28 mike Exp $
 #
 # Copyright 1996-2000 by Michael J. Heins <mikeh@minivend.com>
 #
@@ -239,7 +239,7 @@ dump -- MiniVend session dumper
 
 =head1 VERSION
 
-$Id: dump,v 1.4 2000/03/02 10:34:28 mike Exp mike $
+$Id: dump,v 1.4 2000/03/02 10:34:28 mike Exp $
 
 =head1 SEE ALSO
 
index a35ce35..f9fe381 100644 (file)
@@ -25,7 +25,7 @@ DOIT: {
 #
 # MiniVend session expiration
 #
-# $Id: expire,v 1.4 2000/03/02 10:34:29 mike Exp mike $
+# $Id: expire,v 1.5 2000/03/09 13:34:16 mike Exp mike $
 #
 # Copyright 1996-2000 by Michael J. Heins <mikeh@minivend.com>
 #
@@ -69,9 +69,8 @@ $Global::VendRoot = $Global::VendRoot || '/usr/local/minivend';
                if -f "$Global::VendRoot/_db_storable";
        
 }
-### END CONFIGURABLE VARIABLES
 
-sub dontwarn { $FindBin::RealBin; }
+### END CONFIGURABLE VARIABLES
 
 $Global::ConfigFile = 'minivend.cfg';
 $Global::HammerLock = 20;
@@ -112,12 +111,17 @@ BEGIN {
 
 use Vend::Session;
 use Vend::Config qw(get_catalog_default parse_time);
-use vars qw/$opt_c $opt_r $opt_e/;
+use vars qw/$opt_c $opt_r $opt_e $opt_u $opt_x/;
+
+$Vend::Quiet = 1;
+
+sub logGlobal { warn(@_) }
+sub is_retired {}
 
 my $USAGE = <<EOF;
-usage: expire [-r] -c catalog [-e 'SessionExpire']
+usage: expire [-r|-u] -c catalog [-e 'SessionExpire']
            or
-       expire [-r] [-e 'SessionExpire'] sessionfile [sessionfile.lock]
+       expire [-r|-u] [-e 'SessionExpire'] sessionfile [sessionfile.lock]
 
  OPTIONS
       -c catalog  specify a catalog from minivend.cfg
@@ -126,6 +130,12 @@ usage: expire [-r] -c catalog [-e 'SessionExpire']
                   time is a string like '4 hours' or '2 days'
 
       -r          reorganize database and recover lost disk space
+
+      -u          unlink files if file-based sessions (otherwise
+                     produces "rm -f \$file" suitable for shell
+                                 scripts)
+
+      -x          produce list of expired files, one per line
 EOF
 
 my $catalog;
@@ -136,7 +146,7 @@ $Vend::Cfg = { FileCreationMask => 0600 };
 
 use Getopt::Std;
 
-getopts('c:e:r') or die "$@\n$USAGE\n";
+getopts('c:e:rux') or die "$@\n$USAGE\n";
 
 $catalog    = $opt_c || undef;
 $expiretime = $opt_e || undef;
@@ -170,13 +180,9 @@ EOF
 
 } # END GETOPT
 
-die "too many args, aborting.\n" 
-               if @ARGV;
-my (%wanted) = qw(     sessionexpire   SessionExpire
-                                       sessiondatabase SessionDatabase
-                                       sessionlockfile SessionLockFile
-                                       scratchdir              ScratchDir
-                                       errorfile       ErrorFile);
+die "too many args, aborting.\n" if @ARGV;
+
+my $g;
 
 if(defined $catalog) {
        my($name,$dir,$param);
@@ -184,38 +190,20 @@ if(defined $catalog) {
        open(GLOBAL, $Global::ConfigFile) or
                die "No global configuration file? Aborting.\n";
        while(<GLOBAL>) {
-               next unless /^\s*catalog\s+$catalog\s+/i;
-               chomp;
-               s/^\s+//;
-               (undef,$name,$dir,$param) = split /\s+/, $_, 4;
-               last;
+               next unless /^\s*((?:sub)?catalog)\s+($catalog\s+.*)/i;
+               Vend::Config::parse_catalog($1, $2);
        }
        close GLOBAL;
        die "Catalog $catalog not found in $Global::ConfigFile.\n"
-               unless defined $name;
-       chdir $dir or die "chdir to $dir: $!\n";
-       open(CATALOG, 'catalog.cfg') or
-               die "No catalog configuration file? Aborting.\n";
-       my (%seen);
-       while(<CATALOG>) {
-               next unless /\S/;
-               next if /^\s*#/;
-               chomp;
-               s/^\s+//;
-               s/\s+$//;
-               ($name,$param) = split /\s+/, $_, 2;
-               next unless defined $wanted{lc $name};
-               $seen{$wanted{lc $name}} = $param;
-       }
-       close CATALOG;
-       for(values %wanted) {
-               next if defined $seen{$_};
-               $seen{$_} = get_catalog_default($_);
-       }
-       for(keys %seen) {
-               $Vend::Cfg->{$_} = $seen{$_};
-       }
-       $expiretime = $Vend::Cfg->{SessionExpire} unless defined $expiretime;
+               unless $Global::Catalog{$catalog};
+       $g = $Global::Catalog{$catalog};
+       chdir $g->{dir} or die "chdir to $g->{dir}: $!\n";
+       $Vend::Cfg = Vend::Config::config(
+                                       $g->{name},
+                                       $g->{dir},
+                                       "$g->{dir}/etc",
+                                       $g->{base} || undef,
+                                       );
 }
 else {
        $Vend::Cfg->{ScratchDir} = '/tmp';
@@ -223,7 +211,36 @@ else {
        $expiretime = '1 day' unless defined $expiretime;
 }
 
-$Vend::Cfg->{SessionExpire} = parse_time('SessionExpire', $expiretime);
+if($expiretime) {
+       $Vend::Cfg->{SessionExpire} = parse_time('SessionExpire', $expiretime);
+}
+
+print "expire=$expiretime=$Vend::Cfg->{SessionExpire}\n";
+
+if ($Vend::Cfg->{SessionType} eq 'File' ) {
+       require File::Find;
+       my $expire = $Vend::Cfg->{SessionExpire} + 60;
+       $expire /= 86400;
+       my $wanted;
+       my @nuke;
+       $wanted = sub {
+               return unless -f $_ && -M _ > $expire;
+               push @nuke, $_;
+       };
+       require File::Find;
+       File::Find::find($wanted, $Vend::Cfg->{SessionDatabase});
+       exit unless @nuke;
+       if($opt_u) {
+               unlink @nuke;
+       }
+       else {
+               my $joiner = $opt_x ? "\n" : "\nrm -f ";
+               print "rm -f " unless $opt_x;
+               print join $joiner, @nuke;
+               print "\n";
+       }
+       exit;
+}
 
 die $USAGE unless defined $Vend::Cfg->{SessionLockFile};
 
@@ -235,7 +252,7 @@ get_session() unless $reorg;
 expire_sessions($reorg);
 release_session() unless $reorg;
 
-system "compact ." if $db_reorg;
+#system "compact ." if $db_reorg;
 
 =head1 NAME
 
index 5e68c1b..ea544ef 100644 (file)
@@ -47,21 +47,29 @@ my $query;
 
 $USAGE = <<EOF;
 Expire all listed MiniVend catalogs. Will read information from
-either:
+either the file passed with -f or:
 
        $VendRoot/minivend.cfg
-       $VendRoot/catalogs.list
 
-usage: expireall [-r]
+usage: expireall [-r] [-f file]
 
+       -f    Alternate minivend.cfg file
        -r    Use reorganize parameter in command
 
 EOF
 
-getopts('r') or die "$@\n$USAGE\n";
+getopts('e:f:r') or die "$@\n$USAGE\n";
+
+my $Configfile = $opt_f || "$VendRoot/minivend.cfg";
+
+my $flag = '';
 
 if ($opt_r) {
-       $flag = '-r';
+       $flag .= '-r';
+}
+
+if($opt_e) {
+       $flag .= qq{ -e "$opt_e"};
 }
 
 # Parse the minivend.cfg file to look for script/catalog info
@@ -69,29 +77,15 @@ PARSECFG: {
        my $file;
        my @cfglines;
 
-       $file = "$VendRoot/minivend.cfg";
-       open(MVCFG, $file) or die "Couldn't read $file: $!\n";
+       open(MVCFG, $Configfile) or die "Couldn't read $Configfile: $!\n";
        while(<MVCFG>) { push(@cfglines, $_) if /^\s*catalog\s+/i }
        close MVCFG;
 
-       eval {
-               $file = "$VendRoot/catalogs.list";
-               open(MVCFG, $file) or die "Couldn't read $file: $!\n";
-               while(<MVCFG>) { push(@cfglines, $_) if /^\s*catalog\s+/i }
-               close MVCFG;
-       };
-       eval {
-               $file = "$VendRoot/active.catalogs";
-               open(MVCFG, $file) or die "Couldn't read $file: $!\n";
-               while(<MVCFG>) { push(@cfglines, $_) if /^\s*catalog\s+/i }
-               close MVCFG;
-               rename $file, "$file.bak";
-       };
        my %seen;
        @cfglines = grep !$seen{$_}++, @cfglines;
 
        for(@cfglines) {
-               next unless /^\s*catalog\s+([-\w_]+)/i;
+               next unless /^\s*(?:sub)?catalog\s+([-\w_]+)/i;
                push @cats, $1;
        }
 
@@ -107,7 +101,7 @@ expireall -- Run Minivend expire on all catalogs
 
 =head1 VERSION
 
-$Id: expireall,v 1.3 2000/03/02 10:34:30 mike Exp mike $
+$Id: expireall,v 1.4 2000/03/09 13:34:29 mike Exp mike $
 
 =head1 DESCRIPTION
 
index 669203d..e67cae4 100644 (file)
@@ -24,7 +24,7 @@ DOIT: {
 #
 # MiniVend localizer
 #
-# $Id: localize,v 1.3 2000/03/02 10:34:31 mike Exp mike $
+# $Id: localize,v 1.3 2000/03/02 10:34:31 mike Exp $
 #
 # Copyright 1996-2000 by Michael J. Heins <mikeh@minivend.com>
 #
@@ -353,7 +353,7 @@ localize -- produce MiniVend localization file from set of pages
 
 =head1 VERSION
 
-$Id: localize,v 1.3 2000/03/02 10:34:31 mike Exp mike $
+$Id: localize,v 1.3 2000/03/02 10:34:31 mike Exp $
 
 =head1 SYNOPSIS
 
index 77afd86..4741d88 100644 (file)
@@ -104,7 +104,7 @@ options:
     --minivenduser=username  The user ID which runs MiniVend
     --serverconf=filename    Location of httpd.conf
     --vendroot=filename      Location of MiniVend software
-       --homedir=directory      Use instead of \$HOME to set defaults
+    --homedir=directory      Use instead of \$HOME to set defaults
 
     Required:
     --catroot=directory      Directory where MiniVend catalog files go
@@ -116,18 +116,19 @@ options:
 
     Optional:
     --catuser=username       The user files should be owned by (if root)
-    --samplehtml=directory   The directory where template HTML goes
     --imagedir=directory     The directory where template images go
     --imageurl=url           The URL to prefix images with
+    --linkmode=mode          UNIX or INET (link program vlink or tlink)
+    --linkprogram=file       Use file as link program instead of vlink/tlink
     --nocfg                  Don't add to minivend.cfg
     --nocopy                 Don't actually copy the files, just test
     --norunning              Don't add to running server
+    --noumask                Don't set umask
+    --permtype=[M|G|U]       Set permission type (Multi, Group, User)
     --reference              Return hash of config as string (sets -F, no write)
-    --linkprogram=file       Use file as link program instead of vlink/tlink
-    --linkmode=mode          UNIX or INET (link program vlink or tlink)
+    --relocate=dir           Directory to relocate files to (for RPM and such)
+    --samplehtml=directory   The directory where template HTML goes
     --sampleurl=url          URL to access HTML for catalog
-       --relocate=dir           Directory to relocate files to (for RPM and such)
-    --noumask                Don't set umask
 
 EOF
 
@@ -164,6 +165,7 @@ my %optctl = (
     'nocopy'            => \$Conf{nocopy},
     'norunning'         => \$Conf{norunning},
     'noumask'           => \$Conf{noumask},
+    'permtype'          => \$Conf{permtype},
     'r'                 => \$Reconfigure,
     'reference'         => \$Conf{reference},
     'relocate'          => \$Conf{relocate},
@@ -211,6 +213,7 @@ my @options = ( qw/
     nocfg
     nocopy
     norunning
+    permtype=s
     r
     reference
     relocate=s
@@ -1918,7 +1921,7 @@ makecat [--options] name
 
 =head1 VERSION
 
-$Id: makecat,v 1.4 2000/03/02 10:34:39 mike Exp mike $
+$Id: makecat,v 1.5 2000/03/09 13:34:59 mike Exp mike $
 
 =head1 INTRODUCTION
 
index 0b009b3..038b77d 100644 (file)
@@ -124,7 +124,7 @@ use vars qw($VERSION);
 require Exporter;
 
 BEGIN {
-       $VERSION = '4.01';
+       $VERSION = '4.02';
 }
 
 
index c14ad7f..123aa18 100644 (file)
@@ -25,7 +25,7 @@ DOIT: {
 #
 # offline - MiniVend database builder and indexer
 #
-# $Id: offline,v 1.4 2000/03/02 10:35:06 mike Exp mike $
+# $Id: offline,v 1.4 2000/03/02 10:35:06 mike Exp $
 #
 # Copyright 1996-2000 by Michael J. Heins <mikeh@minivend.com>
 #
@@ -263,7 +263,7 @@ offline -- Minivend offline database builder
 
 =head1 VERSION
 
-$Id: offline,v 1.4 2000/03/02 10:35:06 mike Exp mike $
+$Id: offline,v 1.4 2000/03/02 10:35:06 mike Exp $
 
 =head1 DESCRIPTION
 
index 40c3d66..1d36d8c 100644 (file)
@@ -25,7 +25,7 @@ DOIT: {
 #
 # MiniVend restarter
 #
-# $Id: restart,v 1.2 2000/03/02 10:35:08 mike Exp mike $
+# $Id: restart,v 1.2 2000/03/02 10:35:08 mike Exp $
 #
 # Copyright 1996-2000 by Michael J. Heins <mikeh@minivend.com>
 #
index d215e21..1c93989 100644 (file)
@@ -25,7 +25,7 @@ DOIT: {
 #
 # update - MiniVend database updater
 #
-# $Id: update,v 1.4 2000/03/02 10:35:09 mike Exp mike $
+# $Id: update,v 1.4 2000/03/02 10:35:09 mike Exp $
 #
 # Copyright 1996-2000 by Michael J. Heins <mikeh@minivend.com>
 #