------------------------------------------------------------------------------

                  What's new in each version of Interchange
                       (since the version 5.0 branch)

                     See WHATSNEW-5.3 for later changes.

------------------------------------------------------------------------------


Interchange 5.1.0 released 2004-04-08.

Security
--------

* Plug a security hole which allows an attacker to expose arbitrary variable 
  contents by using an URL like 
  http://shop.example.com/cgi-bin/store/__SQLUSER__. 

  All Interchange applications using the standard "missing" special page
  from the demo catalog or a similar one are vulnerable to this attack.
  The attacker may learn the SQL access information for your Interchange
  application and use this information to read and manipulate sensitive
  data.

* Disallow [ and < in page names when setting MV_PAGE and MV_PREV_PAGE
  variables.

* Prevent login information from getting re-saved on a session cancel.

* Define a set of CGI keys that we don't want to save to disk, as
  @Global::HideCGI.

* Don't show sensitive (i.e. @Global::HideCGI) CGI variables in a dump.
  This allows saving a session to disk for diagnositic purposes in case
  of order failure.

Core
----

* mime subroutine handles email attachments better now: filename for
  attachments is set correctly from description parameter; 
  attachment vs. inline is now controlled by attach_only attribute
  for [tag mime ...]. Demo'd with encrypted credit card attachment
  in etc/report.

* Move mv_nextpage fallback before security check.

* Add the ability to create a transaction ID and later assign the order number.
  To use, you need to set in the main route:

	  counter_tid    etc/transaction.number

  At that point, in the current foundation, you would add this code to
  assign an order number *after* payment is taken.

	Set order number in values: [value
                        name=mv_order_number
                        set="[counter
                                name=`$Session->{current_route}{counter_name}
										|| 'etc/order.number'
									 `
                                sql=`$Session->{current_route}{sql_counter}`
                                start=`$Session->{current_route}{first_order_number}`
                                date=`$Session->{current_route}{date_counter}`
                            ]"
                    ]
	Set order number in session: [calc]
                        $Session->{mv_order_number} = $Values->{mv_order_number};
                    [/calc]

  This allows the order numbers to increment only after payment has been
  received, while still allowing the all-in-one transaction logging
  file located in a report file.

  If you use counter_tid, you *must* set set the order number in your
  logging file if you want it to be available.

  You will want to call [charge ... order_id="[value mv_transaction_id]"]
  to get full traceability of declined and failed charges.

* Add ability to use date-based order numbers with

		date_counter   1

  in the appropriate route.

* Allow setting a counter name without incrementing the counter itself, if

		increment   0

  is in the route. This is really how it should have been done in the
  first place.

* Remove Vend::Server::http_log_msg which is only called for SOAP accesses.

* Create way to specify that local override of a global tag should not cause
  an error message.

  		Limit  override_tag   tag1 tag2 tag3

* Define a set of CGI keys that we don't want to save to disk, as
  @Global::HideCGI.

* Allow [dump no-cgi=1 no-session=1 no-env=1] to finetune dump.

* Don't show sensitive (i.e. @Global::HideCGI) CGI variables in a dump.
  This allows saving a session to disk for diagnositic purposes in case
  of order failure.

* Fix problem with invalid cookie if FullUrl is enabled and there is no path.

* Allow standard handler for PUT operations. To enable, do:

	SpecialPage  put_handler  some_action

  The some_action action (could be a page) will be prepended to
  any path sent with the PUT.

* Add 'reverse' attribute to [item-list], to walk the cart lines in reverse
  order.

* Add ability to export only portions of tables based on a where= parameter.
  Only works for DBI tables at the current time.

  If the where parameter is a scalar, just passed as a "WHERE" clause,
  i.e.

  	  [export table=products where="prod_group='Ladders'"]

  You can pass anything that won't cause a syntax error, even including
  an "order by" or "limit".

  If you want to pass multiple things, or not worry about quoting,
  you can do:

  	[export table=products where.prod_group=Ladders]

  The normal caveats for hash parameters apply, i.e. you cannot
  do:

  	where.prod_group="[cgi foo]"

  You *can* do:

  	where.prod_group=`$Tag->cgi('foo')`

	or

	where.prod_group=`$CGI->{foo}`

  Normal DBI quoting is always done, so you don't include quotes.

* Allow (sensible) relative paths for DebugFile directive and
  change default debug file to $VENDROOT/debug.log.

* Remove obsolete and unused DifferentSecure directive.

* Fix rare but nasty bug that causes chained ITL conditional tests to fail
  in no-op mode:

	[if scratch something][or value something]...[/if]
	[if scratch something][and value something]...[/if]

  The problem happens when the first [if] contains a string that doesn't
  convert nicely to a number, and gets passed to an XOR test directly instead
  of being converted to a 1 or 0 first. That causes a string XOR to be done,
  which gives the wrong answer.

* Optimize no-op [if] checks when test is false.

* Add ability to control directory creation and umask of uploaded files.

  Automatic creation of directory:

   [set mv_auto_create_dir]1[/set]

  The umask for creation operation:

   [set mv_create_umask]02[/set]

* SpecialSub -- directive to specify subroutines (catalog or global)
  upon certain conditions, i.e. "missing".

  When the routine is called, it should perform whatever action is
  required. If it wants the catalog to continue with the default
  action, i.e. the "missing" special page, it should return false.
  If it returns true, and there is no second parameter of a page name
  returned, it will be assumed all required action has
  been taken and the default action will not be performed.

  If it returns true, and a second parameter is returned, it
  is the name of a page to display in lieu of the original one.

  This allows

    SpecialSub  missing  check_category

    Sub check_category <<EOS
    sub {
        my ($name) = @_;
        return unless $name =~ m{^[A-Z]};
        $name =~ s,_, ,g;
        my ($prod_group, $category) = split m{/}, $name;

        $CGI->{co} = 1;
        $CGI->{fi} = 'products';
        $CGI->{st} = 'db';
        $CGI->{sf} = join "\0", 'prod_group', 'category';
        $CGI->{op} = join "\0", 'eq', 'eq';
        $CGI->{se} = join "\0", $prod_group, $category;
        $CGI->{sp} = 'results';
        $CGI->{mv_todo} = 'search';
        $Tag->update('process');
        return (1, 'results');
    }
    EOS

  You can also use a GlobalSub to perform actions not allowed in a catalog
  subroutine.

* The Vend::Page module is modified to call a "missing" SpecialSub if
  it exists. No other actions are currently handled.

* Vend::Table::DBI::set_slice handles passed list correctly and doesn't 
  mangle arrays passed by reference

* Prevent Storable from dying when encountering a code object in
  save_more.

UserTag
-------

* Added new usps_query usertag for real-time rate quotes from U.S. Postal
  Service's webtools API. Documentation in tag.

* Add new UserTag option "attrDefault", which allows default attributes to
  be set globally or catalog-wide for a given usertag. Two examples:
 
  UserTag area attrDefault href index
  UserTag calc attrDefault filter entities

  Any user-specified attributes will take precedence, even if 0 or blank.

  This is designed to allow changing the default behavior of a tag without 
  changing its code, especially for built-in tags one would rather not
  customize. Note that when using this directive on global usertags,
  it must be done in interchange.cfg, and for catalog usertags in catalog.cfg.

* Add option to specify useragent to get_url tag.

* Add locale option to [convert-date] following a suggestion from 
  Rene Hertell <rene@hertell.com>.

* The [convert-date] global UserTag now has an "adjust" parameter which
  allows date adjustments such as "2 hours" or "3 weeks" etc. to be made.
  Valid qualifiers are seconds, hours, days, minutes and weeks.  If no
  qualifier is specified the the numeric value is assumed to be a number
  of days.  The old "days" parameter still works, but has been depreciated.

* Add filter attribute to var tag, similar to value, cgi, and scratch,
  except that filtered value will never be saved back into the variable.

* Add matrix option to [weight] UserTag for automatically
  falling back to the base SKU weight if not filled in for the variant.

* [import-fields]: sanity check on key name to avoid imports in wrong 
  file format

* Make pageonly=1 option in [history-scan] UserTag work correctly 
  when there's no history saved in the user's session.

* [row-edit]: display columns in the same order as in the columns 
  parameter

UI
--

* customer_mailing: Add full path for sendmail in batch, 
  using $Config->{SendMailProgram}, weed duplicate email addresses, 
  sort by email instead of last name 

* let [row_edit] honor spread_width meta setting

* display an error message if for whatever reason the regions directory is
  empty

* fix item_price.html in order to keep secure mode

* add names to templates/components list page

* fix menu loader bug with combined category field type reported by Michael Streubel
  <Michael.Streubel@palmwaregroup.com>

* give focus to username box on login page load to allow immediate 
  username typing

Foundation
----------

* Added entries to shipping.asc for USPS rate queries, and two new vars to
  variable.txt. 

* Remove "default" column from mv_metadata.asc, as it is not used anywhere.
  This allows the addition of mv_metadata to MySQL, as otherwise the
  column name "default" prevents the creation of the table.

* Add missing [timed-build] to category_vertical_tree component.

* Improve layout of order tracking page, use [convert-date] for date
  display.

* Supply framework for making use of the modulo feature
  for UPS shipments. Two new catalog variables enable/disable the feature
  and set the modulus, respectively. We still maintain the 'one big box'
  assumption that has been there all along, but now alternatives are somewhat
  easier to implement.

* On special_pages/missing.html set correct scratch variable so admin
  missing page error displays correctly.

TableEditor
-----------

* Apply Paul Vinciguerra's patch to number of rows thing, which gets multiple row
  tabs working on the tabbed display if not in ui_style mode.

* Make containing form name (i.e. <form name=foo ...>) available
  to the widget.

* Allow setting of a disabled.param=1 entry so that you can show
  widgets in a table editor yet not accept data from them. The DISABLED=1
  flag will be set in the widget (which normally grays it out) and
  it will be set to be display_only.

* Pass the form and form_name parameters to Vend::Form for use in
  widgets.

* Add option "top-buttons-rows" to set the number of rows where
  top buttons will be triggered. Use said options in appropriate
  UI pages.

Menu
----

* Enhance flyout menus to have a lined-up image indicating a submenu.
  The parameter is an image name (if not beginning with <) or
  arbitrary HTML (if first character is <).

  Use by passing the parameter:

  	  submenu_image_right="[var IMAGE_DIR]/right.gif"

  or

  	  submenu_image_left="[image src=asterisk.gif]"

  or to fake it out with some text:

	submenu_image_right=|
			<span style="font-size: smaller !important"> &nbsp; (more)</span>
						|

Widgets
-------

* Allow date_widget to display/store empty value if called as date_blank
  or datetime_blank.

Options
-------

* Add blank_label="--select--" option to [item-options], allows development
  of code to enforce option selection.

* Add missing space to SQL query in Interchange 4.8 options.

Payment
-------

* Always pass the customer's IP address through to PSiGate as part 
  of the payment request.  
  This patch was supplied by Gary Benson - thanks!

* Pass credit card security code through to Verisign if provided in
  CGI parameter mv_credit_card_cvv2.

i18n
----

* "make localefiles" ignores CVS conflict files now

* Japanese UI translation update from Murahashi <murahashi@ayayu.com>.

* Improve translation of UI and foundation store.

* [LC] uses DefaultLocale setting if $Scratch->{mv_locale} isn't available

SOAP
----

* no DNS lookups unless HostnameLookups is set

Debian
------

* Add libhtml-parser-perl to Build-Depends to keep HTML::Entities
  module out of the package (Closes: #224435, thanks to Henrik Holmboe
  <elements@hack.se> for the bug report)

* Check for existence of expireall binary in cron script.

Mod_interchange
---------------

* Fixed a weird bug where null HTTP variables were being passed
  under certain circumstances.

* Added a SUN_LEN() macro for those operating systems that don't
  have one already.  I think this was done for Solaris.  I can't
  remember now. :-)

* Fixed a bunch of potential buffer overflows.  Each of them would
  have a very remote possibility of being tripped, unless intentionally.

* Added a "OrdinaryFileList" directive to DECLINE requests where the
  path starts with one of the values in the list.  If this module
  DECLINEs a request then Apache will attempt to serve the request
  instead.  This is useful for creating excptions to <Location />,
  for image files etc.

* Added a "InterchangeScript" directive.  The new directive can be used
  to specify a SCRIPT_NAME to pass to Interchange.  The value will override
  the SCRIPT_NAME=/foo that would default from <Location /foo>.

* Lots of minor cleanups.


------------------------------------------------------------------------------

(end)
