8.3. User Database Functions

The user database features are implemented as a series of functions attached to the userdb tag. The functions are:

login

logout

new_account

            [userdb function=new_account
                    username_mask="^[A-Z]*[0-9]"
                    ]
            [userdb function=new_account
                    username="[value mv_order_number]"
                    password="[value zip]"
                    verify="[value zip]"
                    database="orders"
                    ]

change_pass

set_shipping

            [userdb function=set_shipping nickname=Dad]

get_shipping

            [userdb function=get_shipping nickname=Dad]

get_shipping_names

            [set name=shipping_nicknames
                 interpolate=1]
              [userdb function=get_shipping_names show=1]
            [/set]

set_billing

            [userdb function=set_billing nickname=discover]

get_billing

            [userdb function=get_billing nickname=visa]

save

set_cart

            [userdb function=set_cart nickname=christmas]

get_cart

            [userdb function=get_cart nickname=mom_birthday]

set_acl

            [userdb function=set_acl location=cartcfg/editcart]
            [userdb function=set_acl location=cartcfg/editcart delete=1]
            [userdb function=set_acl location=cartcf/editcart show=1]

check_acl

            [if type=explicit
                compare="[userdb
                            function=check_acl
                            location=cartcfg/editcart]"
            ]
            [page cartcfg/editcart]Edit your cart configuration</a>
            [/if]

set_file_acl, set_db_acl

            [userdb function=set_file_acl
                    mode=rw
                    location=products/inventory.txt]

check_file_acl, check_db_acl

            [userdb function=check_db_acl
                    mode=w
                    location=inventory]
            [if type=explicit
                compare="[userdb
                            function=check_db_acl
                            mode=w
                            location=inventory]"
            ]
            [userdb function=set_acl location=cartcfg/edit_inventory]
            [page cartcfg/edit_inventory]You may edit the inventory database</a>
            [else]
            [userdb function=set_acl location=cartcfg/edit_inventory delete=1]
            Sorry, you can't edit inventory.
            [/if]