Gossamer Forum
Home : Products : DBMan : Customization :

Confidential Records

Quote Reply
Confidential Records
I'd like to make it so that there is a way for the imputee can select a record to be confidential.

By this I mean not showing up in searches and maybe not visable to certain users like the default user...any suggestions?

(I know how to set up a way for people to select the option, just not how to make that do anything.)


Thanks in advance
Quote Reply
Re: [mabel] Confidential Records In reply to
Ok...because all my normal people that use the system log in as default, I have made it so you can modify and/or view only your own records.

I have also made a field where someone can select yes or no to be confidential. Now I am trying to make it so that when 'Yes' is selected it automatically changes ownership of the record to admin...

something like this: #this is in the sub html_add_success of the html.pl

if ($in{'Confidential'} eq 'Yes') { #I know the conditional works, but
$in{$db_cols[$auth_user_field] = 'admin'; #I don't know how to set up this line.
}

Can anyone please fix that one line of code???????

Thanks,

Mike
Quote Reply
Re: [mabel] Confidential Records In reply to
ok, the code is

if ($in{'Confidential'} eq 'Yes') {
$in{$'Userid'} = 'admin';
}

but it just changes it back or gives an error message depending where you put it

CAN SOMEONE tell me where the script takes the current user and inserts that into the Userid field as of now???????????
plz!!
Quote Reply
Re: [mabel] Confidential Records In reply to
>>$in{$'Userid'} = 'admin';<<

You need to remove that second $
Quote Reply
Re: [Paul] Confidential Records In reply to
what I really want to do is in

sub add_record { and preview_record

comment out # ($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid);

and add

if ($in{'Confidential'} eq 'Yes') {
$in{'Userid'} = 'admin';
}

else {

$in{'Userid'} = 'default';

}

however, the script doesnt like a default user making an admin record!

how can I fix it so the script doesn't care???

Last edited by:

mabel: Jul 12, 2002, 4:29 PM
Quote Reply
Re: [mabel] Confidential Records In reply to
can anyone tell me where in the add script it checks to make sure

user using the database equals what is in the Userid field???
Quote Reply
Re: [mabel] Confidential Records In reply to
Taken from the FAQ:

Hide Record

Question:

Is there a modification for making it so that there's a checkbox when people add/modify records and that if it's unchecked, the record isn't shown in a search?

Response:

You could add a checkbox field to your database. I'll call it "ShowRecord" for illustrative purposes. You can call it anything you'd like, as long as you're consistent.

Define the checkbox as:

%db_checkbox_fields = ( ShowRecord => 'Yes' );

In db.cgi, sub view_records, at the beginning of the subroutine, add code:

unless ($per_admin) {
$in{'ShowRecord'} = "Yes";
}

This will let those with admin permission to view all records, but those without will only be able to view the ones that have the box checked. This will also apply to the owner of the record. The owner will be able to see his own record if he does a "modify" or "delete" though.

If that doesn't help look for the thread called "Hiding complete records" in the FAQ.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Confidential Records In reply to
thanks, i thought i had checked all of the FAQ