Inserting environment variables

P

Paul

Guest
I'd like to insert a value from $HTTP_COOKIE_VARS and $REMOTE_ADDR into fields whenever a user updates a record.

I could write a short SQL routine to update the table directly, but I wondered if there is a more elegant method?

The reason behind this is that I'm using cookie authentication as a method for controlling the $enable_edit flag - it is set to 1 when a user accesses his own record, 0 all other times, but there are other users with higher privs who can also edit all records, so I want to track who is making changes by inserting their user name (from their cookie) and their IP address from the environment variables into the record.

Thanks for a superb script!
 
E

Eugenio

Guest
Paul wrote:
>
> I'd like to insert a value from $HTTP_COOKIE_VARS and
> $REMOTE_ADDR into fields whenever a user updates a record.
>
> I could write a short SQL routine to update the table
> directly, but I wondered if there is a more elegant method?
>
> The reason behind this is that I'm using cookie
> authentication as a method for controlling the $enable_edit
> flag - it is set to 1 when a user accesses his own record, 0
> all other times, but there are other users with higher privs
> who can also edit all records, so I want to track who is
> making changes by inserting their user name (from their
> cookie) and their IP address from the environment variables
> into the record.

You could for example use ID_user as field type and change the behaviour of DaDaBIK about ID_user fields in business_logic.

Eugenio.

(Latest version of DaDaBIK when this message was posted: 2.2.1)
 
Top