← Back to team overview

woda team mailing list archive

extended _from

 

Hi Malcom
I've added the user and group in the _from field (not for next release).

It's tested on 3 databases:
-  simple ones, taken from the provided examples: links.cgi and forum.cgi 
	tested with
	 x	friend account (friend group), 
	 x	user account
	 x	admin group

- a relational db with a table for users and groups 
	tested with 
	 x	user account, with default user group
	 x	admin group
(can't test with group defined in table because it's currently broken)

- a dd.txt db, created and running using the web system of the "pro" version
	tested with 
	x	friend account
	x	user group
	x	admin group 

It works very well in each case.

Could you test a bit too ?
Because I really wonder why Ziga has never do that... I guess there was 
problems, but I can't found nor imagine any.

Below are the little changes.
Of course, _from contains user related values, that shouldn't be shown by 
default but this is already the case.
It's just quickly done, to see if it works. It would be better with a list 
(user,group,ip), or splitted in 3 fields: _from_user, _from_group and 
_from_ip/hostname


sub recSetSystem {

    # _from

    local ($from);
    $from         = $RH;		#     $RH = $ENV{'REMOTE_HOST'};
    $from         = $RA if !$from;	#     $RA = $ENV{'REMOTE_ADDR'};
    my $user 	  = "user: $User - " if ($User);
    my $group 	  = "group: $Group - " if ($Group);
    my $adress	  = "adress: $from";
    $rec{'_from'} = $user . $group . $adress;

    # _at

    $rec{'_at'} = time;

    # can be done with a hidden field!
    # $rec{'_user'}=$User;
}

Xavier
xavier@xxxxxxxxxxxxxx