I was just asked about having a "guest account" that couldn't
actually buy anything and came up with what I thought was a
clever way to handle this.  I thought I'd share it.

I added a new entry to the "permission" table.  I called it
"Deny Cart", maybe I should've just called it "Guest".
Anyway, I added two lines to the top of ADD_BASKET to
support this:

        if ($UserInfo["Permission"]["Deny Cart"])
                return;

Using return this way has to be done outside of any
braces so make sure you do it outside of functions
and outside of other if statements.

This makes it so that anybody with this permission
setting will always have an empty basket.  This was
important to me because I have also modified freetrade
to track inventory that is in carts rather than waiting
until it is purchased.  I do have stuff that returns
the inventory for expired sessions but we didn't want
"guests" to tie up inventory.
--
Paul Chamberlain, [EMAIL PROTECTED]


------------------------------------------------------------
To subscribe:    [EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Site:            http://www.working-dogs.com/freetrade/
Problems?:       [EMAIL PROTECTED]

Reply via email to