UserDB.pm -- Interchange User Database Functions
userdb $function, %options
The Interchange user database saves information for users, including shipping,
billing, and preference information. It allows the user to return to a
previous session without the requirement for a "cookie" or other
persistent session information.
It is object-oriented and called via the [userdb] usertag, which calls the
It restores and manipulates the form values normally stored in the user session
values -- the ones set in forms and read through the "[value
variable]" tags. A special function allows saving of shopping cart
The preference, billing, and shipping information is keyed so that different
sets of information may be saved, providing and "address_book"
function that can save more than one shipping and/or billing address. The set
to restore is selected by the form values "s_nickname",
"b_nickname", and "p_nickname".
$obj->login(); # Form values are
# mv_username, mv_password
$obj->new_account(); # Form values are
# mv_username, mv_password, mv_verify
$obj->change_pass(); # Form values are
# mv_username, mv_password_old, mv_password, mv_verify(new)
Get, set user information:
Save, restore filed user information:
The shipping address book saves information relevant to shipping the order. In
its simplest form, this can be the only address book needed. By default these
form values are included:
The values are saved with the $obj-> set_shipping()
restored with $obj->get_shipping. A list of the keys available is kept in
the form value "address_book", suitable for iteration in an HTML
select box or in a set of links.
The accounts book saves information relevant to billing the order. By default
these form values are included:
The values are saved with the $obj-> set_billing()
method and restored
with $obj->get_billing. A list of the keys available is kept in the form
value "accounts", suitable for iteration in an HTML select box or in
a set of links.
Preferences are miscellaneous session information. They include by default the
fields "email", "fax", "phone_night", and
"fax_order". The field "p_nickname" acts as a key to
select the preference set.