Gossamer Forum
Home : Products : DBMan : Customization :

Hiding field for guests not for user

Quote Reply
Hiding field for guests not for user
I've searched the posts and I've found a solution to hide a field in a record for the users but not for admin.
I'm looking for a solution to hide the field for guests but not for the users of the database.

I hope my question is clear enough.

Erik
Quote Reply
Re: [Erik Verkuil] Hiding field for guests not for user In reply to
Here is an example using an address field which will only be viewed by registered users:

print qq|
<table><tr><td>Nickname:</td><td>$rec{'Nickname'}</td></tr>
|;

unless ($db_userid eq 'default') {
print qq|<tr><td>Address:</td><td>$rec{'Address'}</td></tr>|;
}

print qq| <tr><td>City:</td><td>$rec{'City'}</td></tr></table> |;

You can also change default to guest if they are required to login as such.

Hope this helps

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Hiding field for guests not for user In reply to
Works great.
Thanks.

Is it possible to only show the field for the user who inserted the record?

Thanks again.

Erik
Quote Reply
Re: [Erik Verkuil] Hiding field for guests not for user In reply to
Sure is :) You would use:

if($rec{'Userid'} eq $db_userid){
the the field codes |;
}

Just change: $rec{'Userid'} to contain the actual field name for your userid field.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Hiding field for guests not for user In reply to
Thanks again LoisC, it works allright!

Erik