4.85. userdb
4.85.1. Summary
Parameters: function
Positional parameters in same order.
The attribute hash reference is passed to the subroutine after the parameters as the last argument. This may mean that there are parameters not shown here.
Invalidates cache: YES
Attribute aliases
name ==> nickname table ==> db [userdb function other_named_attributes]
Parameters | Description | Default |
function | DEFAULT_VALUE | |
name | Alias for nickname | DEFAULT_VALUE |
table | Alias for db | DEFAULT_VALUE |
Attributes | Default |
interpolate (reparse) | No |
Other_Characteristics | |
Invalidates cache | YES |
Container tag | No |
Has Subtags | No |
Nests | Yes |
Tag expansion example:
[userdb function] --- TODO: (tag result)
ASP-like Perl call:
$Tag->userdb({ function => VALUE });
or similarly with positional parameters,
$Tag->userdb(function, $attribute_hash_reference);
4.85.2. Description
Interchange provides a [userdb ...] tag to access the UserDB functions.
[userdb function=function_name username="username"* password="password"* verify="password"* oldpass="old password"* shipping="fields for shipping save" billing="fields for billing save" preferences="fields for preferences save" force_lower=1 param1=value* param2=value* hide=1 show=1 ... ]
* Optional
It is normally called in an mv_click or mv_check setting, as in:
[set Login] mv_todo=return mv_nextpage=welcome [userdb function=login] [/set] <FORM ACTION="[process]" METHOD=POST> <INPUT TYPE=hidden NAME=mv_click VALUE=Login> Username <INPUT NAME=mv_username SIZE=10> Password <INPUT NAME=mv_password SIZE=10> </FORM>
There are several global parameters that apply to any use of the userdb functions. Most importantly, by default the database table is set to be userdb. If you must use another table name, then you should include a database=table parameter with any call to userdb. The global parameters (default in parentheses):
database Sets user database table (userdb) hide Hide the return value of certain functions (including login, new_account, save, load) show Show the return value of certain functions or the error message, if any (0) force_lower Force possibly upper-case database fields to lower case session variable names (0) billing Set the billing fields (see Accounts) shipping Set the shipping fields (see Address Book) preferences Set the preferences fields (see Preferences) bill_field Set field name for accounts (accounts) addr_field Set field name for address book (address_book) pref_field Set field name for preferences (preferences) cart_field Set field name for cart storage (carts) pass_field Set field name for password (password) time_field Set field for storing last login time (time) expire_field Set field for expiration date (expire_date) acl Set field for simple access control storage (acl) file_acl Set field for file access control storage (file_acl) db_acl Set field for database access control storage (db_acl)