Gossamer Forum
Home : Products : DBMan : Customization :

Changing who can see a particuler DB field

Quote Reply
Changing who can see a particuler DB field
How can I change the following code so that I, as the admin and anybody viewing the database can see this field?

|;
if ($per_admin) {
print qq|
<FONT COLOR="#00CC00"><B>Accredited with the BCCA?</B></FONT><BR><$font>$rec{'accredited'}</FONT><BR>
|;
}
print qq|

Thanks
Quote Reply
Re: [Doug Thorlakson] Changing who can see a particuler DB field In reply to
Two ways...

Change ($per_admin) to ($per_view) or take out the if/then statement entirely

|;
if ($per_admin) {
print qq|

<FONT COLOR="#00CC00"><B>Accredited with the BCCA?</B></FONT><BR><$font>$rec{'accredited'}</FONT><BR>
|;
}
print qq|


remove part in red.
Quote Reply
Re: [Watts] Changing who can see a particuler DB field In reply to
I have tried your suggestions but they did not accomplish what I am trying to do. I have a database setup that I would like to have our members fill in several fields of information themselves. But there is one field that only I should fill. How do I set it up so that they can complete thier portion of the form, I fill in the last field and the public be able to see all the fields but not edit them.

Does that make sense.

Thanks

Doug T.
Quote Reply
Re: [Doug Thorlakson] Changing who can see a particuler DB field In reply to
1. Set up cfg to allow a default user and so that default user can only *view* records
2. Allow registered users to *modify* only own records
3. Change the if/then in html_record_form to this:

if ($per_admin) {print qq|<INPUT TYPE="text" NAME="whatever" VALUE="$rec{'whatever'}">|;}
else {print qq|<INPUT TYPE="hidden" NAME="whatever" VALUE="$rec{'whatever'}">|;}

Give this a try - it'll print the input box if your admin and a hidden tag if you're not.

I always have to monkey around with the permissions until I get them right. Sometimes I use JPDeni's Configurator just for the permissions settings.

Good Luck!

.
Quote Reply
Re: [Watts] Changing who can see a particuler DB field In reply to
Hi.

Thanks for your help. What I ended up oing was removing the hidden tag from the else line an that did the trick for me.

Doug T.