This topic is locked

Problem with SESSION Variable

3/23/2007 5:37:33 AM
PHPRunner General questions
D
dieter author

I have a table users, a table groups. The group has an ID and a name. How can I get the group-name of the currently logged in user and write this name in a field of the add page. The user should not have the possibility to change this value.
Thanks
Dieter

J
Jane 3/23/2007

Hi,
you can do it using AfterSuccessfulLogin event on the Events tab.

Pull GroupName from users table in this event and save it in the $_SESSION["GroupName"] variable. Then use this variable as default value on the "Edit as" settings dialog on the Visual Editor tab.

S
sloftus 3/28/2007

I have a similar question. I understand how you can add the username to a field when a record is added, but how can I add the username to a field when a record is edited (I have a 'last updated by username field). Any user can change a record but I need to know who made the last change.
Regards, Steve