Gossamer Forum
Home : Products : DBMan : Customization :

limit records for default user

Quote Reply
limit records for default user
i am using dbman for an opt-in mailing list and want default users to add themselves as a record but not to the password file. so default user can do nothing but add record. my database is filling with spam postings like prescription drugs, online casinos etc. i would like to somehow restrict the default user to add only one record in five minutes or so. i want to allow my logged in users to add as many and as often as desired. i'm capturing ip addresses so that could help filter if necessary. i have a link on the website that goes straight to the add record form so i guess my modification needs to go in the validate record section. i just don't know what code to put there. help!!!!
Quote Reply
Re: [delicia] limit records for default user In reply to
in case anyone is interested, here's my solution.
i have an array in cfg (@db_compare_fields) specifying two fields in db to be compared when record is added. then i have the following code in sub validate_record:

Code:
### delicia hack error if two fields match, specify in cfg 1/25/2008
if ($in{$db_compare_fields[0]}) {
if ($in{$db_compare_fields[0]} eq $in{$db_compare_fields[1]}) {
push (@input_err, "Invalid $db_compare_fields[1]"); # show second field in error
}
}
###