[ic] Keeping track of how much a user has spent...

Kevin Walsh interchange-users@interchange.redhat.com
Wed Jan 23 12:33:00 2002


>
> * most of the context removed due to a lack of proper quoting *
>
> Thank you - I experimented a little and found that adding the line:
> [value name=credit_limit set="[scratch credit_limit]" hide=1]
> right before the [userdb save] cleaned it all up.
>
You probably shouldn't keep your credit_limit as a value, when userdb
can read/write scratches directly.  The problem with values is that
users could potentially change their credit limit by appending
something along the lines of "credit_limit=1000" to their list of URI
arguments.

To configure userdb to read/write credit_limit as a scratch, edit your
catalog.cfg file.  Look for an existing "UserDB scratch" directive, or
equivalent, and append your scratch variable name to the list.  If no
UserDB scratch directive is present in catalog.cfg then add
"UserDB scratch credit_limit" to catalog.cfg.

Once you have restarted, you'll find that you can read/write this value
as a scratch without the need to convert to and from a value.
[userdb load] would load your credit_limit into a scratch automatically
just as [userdb save] would save it.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/