Gossamer Forum
Home : Products : DBMan : Installation :

Problem with View

Quote Reply
Problem with View
I have gotten the database going and it works great but I can't figure out one thing:
I have installed the secure_lookup.txt and added a field "Email" with tag -2. I would like my users' email to be attached to their enteries, however I have come across a problem: Everytime a user searches for something his own "email" is also included as part of the search criteria, so the search engine returns only fields that contain his email unless a "match any" field is selected. How can I get around this? I still want the users' email be shown on the v"View" but I don't want it to be editted/changed through "add" and at the same time I don't want it to automatically be included as search criteria.
Quote Reply
Re: Problem with View In reply to
One clarification:
1) I would like to force the author enter his true email (that is why I made 'Email'to be -2).
2) I would like the search field NOT use this as criteria for search or if it does I want it to be blank (at the present time it automatically uses the author's email as one search criteria)

I appreciate your help.
Quote Reply
Re: Problem with View In reply to
 
Quote:
Everytime a user searches for something his own "email" is also included as part of the search criteria

That would not be something that is part of the secure password lookup mod. There is nothing in the mod that changes the view search criteria.

I may need to look at your html.pl file. Do you know how to make it accessible?


------------------
JPD





Quote Reply
Re: Problem with View In reply to
please look at

http://www.iranvision.com/universityoftoronto.html.pl
and
http://www.iranvision.com/universityoftoronto.cfg

the test link is at

http://www.iranvision.com/cgi-bin/bkxchange/db.cgi?db=universityoftoronto


Quote Reply
Re: Problem with View In reply to
I think I know what the problem is but I don't know how to solve it.
in sub html_record_form I have:

my (%rec) = @_;
$rec{'Email'} = &get_email;
($db_auto_generate and print &build_html_record_form(%rec) and return);

This statement works fine when I want the author's email to be posted in the database with his record information. However, this causes the 'Email' field of any user to be set to "their own" email address and it uses the same email address in the 'view' or search step.

SO I guess there are two ways to get around this:

1) write the code in such way that the 'Email' field is set to the author's email address ONLY when he is posting enteries and NOT when he is searching or viewing enteries (this should be disablked for the admin also if he is to edit enteries, so his email is not posted after each editted entery).

2) Create another field 'contact' and use that in conjunction with 'Email'. Invoke 'Email' ONLY when verifying the identity of the user and use 'contact' for database purposes. But in this case again the author's 'contact' field should be forced to be set the same as the 'email' field.

These are what I can come up with but I am stuck in implementing them. Do you have any suggestions?
Quote Reply
Re: Problem with View In reply to
I see. Okay.

The easiest thing to do would be to change

Code:
my (%rec) = @_;
$rec{'Email'} = &get_email;

to

Code:
my (%rec) = @_;
if ($in{'add_form'}) {
$rec{'Email'} = &get_email;
}

That should fix it. Thanks for mentioning it.

------------------
JPD





Quote Reply
Re: Problem with View In reply to
Great!!! It works without that bug now.. thanks.