Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Currently logged in user

Quote Reply
Currently logged in user
Hi,

I'm displaying the name of the currently logged in user somewhere in the site header. That's why I put the following code into the header template:

<%if Username and Username ne default%>Currently logged in: <%Name%><%endif%>

The "ne default" is not in the DBMan documentation, but was necessary because the default user has no name and shouldn't be displayed while viewing the records (otherwise, you will see: " Unknown Tag: 'Name' "). This is because I have some direct links calling the db as default user.

I have done another thing in the footer template (where you have the menu nagivation bar):

<a href="db.cgi?do=search_results&keyword=*&db=<%db%><%if Username and Username ne default%>&User_ID=<%Username%><%endif>&fm=long<%if sdb%>&sdb=<%sdb%><%endif%><%if q%>&q=<%q%><%endif%>">List own records only</a>

<a href="db.cgi?do=search_results&keyword=*&db=<%db%>&fm=long<%if sdb%>&sdb=<%sdb%><%endif%><%if q%>&q=<%q%><%endif%>">List all records</a>


This helps me to let the logged in user just look at a list of his own records while the default user can look at all records. The logged in users would like to doublecheck their records and this can easily be done once they have their "List own records" function.

I just tought I'd drop a note about this here. Let me know what you think. Smile

Oliver
Subject Author Views Date
Thread Currently logged in user olivers 3517 Jul 21, 2003, 10:38 AM
Post Re: [olivers] Currently logged in user
olivers 3390 Jul 22, 2003, 1:12 AM
Post Re: [olivers] Currently logged in user
olivers 3384 Jul 22, 2003, 3:31 AM