.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Vend::UserDB 3pm" .TH Vend::UserDB 3pm "2011-04-22" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" UserDB.pm \-\- Interchange User Database Functions .SH "SYNOPSIS" .IX Header "SYNOPSIS" userdb \f(CW$function\fR, \f(CW%options\fR .SH "DESCRIPTION" .IX Header "DESCRIPTION" 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 \*(L"cookie\*(R" or other persistent session information. .PP It is object-oriented and called via the [userdb] usertag, which calls the userdb subroutine. .PP It restores and manipulates the form values normally stored in the user session values \*(-- the ones set in forms and read through the \f(CW\*(C`[value variable]\*(C'\fR tags. A special function allows saving of shopping cart contents. .PP The preference, billing, and shipping information is keyed so that different sets of information may be saved, providing and \*(L"address_book\*(R" function that can save more than one shipping and/or billing address. The set to restore is selected by the form values \f(CW\*(C`s_nickname\*(C'\fR, \f(CW\*(C`b_nickname\*(C'\fR, and \f(CW\*(C`p_nickname\*(C'\fR. .SH "METHODS" .IX Header "METHODS" User login: .PP .Vb 2 \& $obj\->login(); # Form values are \& # mv_username, mv_password .Ve .PP Create account: .PP .Vb 2 \& $obj\->new_account(); # Form values are \& # mv_username, mv_password, mv_verify .Ve .PP Change password: .PP .Vb 2 \& $obj\->change_pass(); # Form values are \& # mv_username, mv_password_old, mv_password, mv_verify(new) .Ve .PP Get, set user information: .PP .Vb 3 \& $obj\->get_values(); \& $obj\->set_values(); \& $obj\->clear_values(); .Ve .PP Save, restore filed user information: .PP .Vb 2 \& $obj\->get_shipping(); \& $obj\->set_shipping(); \& \& $obj\->get_billing(); \& $obj\->set_billing(); \& \& $obj\->get_preferences(); \& $obj\->set_preferences(); \& \& $obj\->get_cart(); \& $obj\->set_cart(); .Ve .SS "Shipping Address Book" .IX Subsection "Shipping Address Book" 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: .PP .Vb 9 \& s_nickname \& name \& address \& city \& state \& zip \& country \& phone_day \& mv_shipmode .Ve .PP The values are saved with the \f(CW$obj\fR\->\fIset_shipping()\fR method and restored with \f(CW$obj\fR\->get_shipping. A list of the keys available is kept in the form value \f(CW\*(C`address_book\*(C'\fR, suitable for iteration in an \s-1HTML\s0 select box or in a set of links. .SS "Accounts Book" .IX Subsection "Accounts Book" The accounts book saves information relevant to billing the order. By default these form values are included: .PP .Vb 12 \& b_nickname \& b_name \& b_address \& b_city \& b_state \& b_zip \& b_country \& b_phone \& mv_credit_card_type \& mv_credit_card_exp_month \& mv_credit_card_exp_year \& mv_credit_card_reference .Ve .PP The values are saved with the \f(CW$obj\fR\->\fIset_billing()\fR method and restored with \f(CW$obj\fR\->get_billing. A list of the keys available is kept in the form value \f(CW\*(C`accounts\*(C'\fR, suitable for iteration in an \s-1HTML\s0 select box or in a set of links. .SS "Preferences" .IX Subsection "Preferences" Preferences are miscellaneous session information. They include by default the fields \f(CW\*(C`email\*(C'\fR, \f(CW\*(C`fax\*(C'\fR, \f(CW\*(C`phone_night\*(C'\fR, and \f(CW\*(C`fax_order\*(C'\fR. The field \f(CW\*(C`p_nickname\*(C'\fR acts as a key to select the preference set. .SS "Locations" .IX Subsection "Locations" There are several database locations that have special purposes. These fields are not saved as user values. .IP "\s-1USERNAME\s0 default: username" 4 .IX Item "USERNAME default: username" The username or key field of the database table. .IP "\s-1BILLING\s0 default: accounts" 4 .IX Item "BILLING default: accounts" Billing address hash field. .IP "\s-1SHIPPING\s0 default: address_book" 4 .IX Item "SHIPPING default: address_book" Shipping address hash field. .IP "\s-1PREFERENCES\s0 default: preferences" 4 .IX Item "PREFERENCES default: preferences" Miscellaneous information hash field. .IP "\s-1FEEDBACK\s0 default: feedback" 4 .IX Item "FEEDBACK default: feedback" Customer feedback hash field. .IP "\s-1PRICING\s0 default: price_level" 4 .IX Item "PRICING default: price_level" Customer pricing level marker. .IP "\s-1CARTS\s0 default: carts" 4 .IX Item "CARTS default: carts" Saved carts hash field. .IP "\s-1PASSWORD\s0 default: password" 4 .IX Item "PASSWORD default: password" Customer password info. If \f(CW\*(C`crypt\*(C'\fR is set, may be encrypted. .IP "\s-1LAST\s0 default: mod_time" 4 .IX Item "LAST default: mod_time" Last login time .IP "\s-1EXPIRATION\s0 default: expiration" 4 .IX Item "EXPIRATION default: expiration" Expiration of account. .IP "\s-1OUTBOARD_KEY\s0 default: (none)" 4 .IX Item "OUTBOARD_KEY default: (none)" Key information for linking to another table of address or other info. .IP "\s-1GROUPS\s0 default: groups" 4 .IX Item "GROUPS default: groups" Groups they should be logged into. .IP "\s-1SUPER\s0 default: super" 4 .IX Item "SUPER default: super" Whether they are a superuser (admin). .IP "\s-1ACL\s0 default: acl" 4 .IX Item "ACL default: acl" .PD 0 .IP "\s-1FILE_ACL\s0 default: file_acl" 4 .IX Item "FILE_ACL default: file_acl" .IP "\s-1DB_ACL\s0 default: db_acl" 4 .IX Item "DB_ACL default: db_acl" .PD Location of access control information. .IP "\s-1CREATED_DATE_ISO\s0 default: (none)" 4 .IX Item "CREATED_DATE_ISO default: (none)" .PD 0 .IP "\s-1CREATED_DATE_UNIX\s0 default: (none)" 4 .IX Item "CREATED_DATE_UNIX default: (none)" .IP "\s-1UPDATED_DATE_ISO\s0 default: (none)" 4 .IX Item "UPDATED_DATE_ISO default: (none)" .IP "\s-1UPDATED_DATE_UNIX\s0 default: (none)" 4 .IX Item "UPDATED_DATE_UNIX default: (none)" .PD Date fields. .IP "\s-1MERGED_USER\s0 default: (none)" 4 .IX Item "MERGED_USER default: (none)" The user id of another account this was merged into. If present, and data (should be a valid user id) is present in the field, the user will be logged as that username.