Fixed Limit form plugin by IP address?

prophoto

Active Member
Suggestions on how to use the limit form plugin along with IP address field? Still trying to thwart spam submissions.
 
Not built-in.
You may use an ip element with isuniquevalue (if you only want one entry) or a php validation.
 
I must be doing something wrong because it's not working. Can you give me an overview of what the settings should be?
 
  • Lookup element - The element that contains user or user group ids.
  • Max element - Once the limit record has been found, this element contains the number of records that given user can submit.
The element must contain the user (id) or user group ids.
There's nothing to check against the IP.

You may use an ip element with isuniquevalue (if you only want one entry) or a php validation...
instead of the form limit plugin.
 
Not built-in.
You may use an ip element with isuniquevalue (if you only want one entry) or a php validation.
Nothing. Can't get this to work either. No PHP errors in logs.

1730934470523.png


1730934497321.png
 
Confirmed. It seems (all) validations don't get the value on new records.

Adding
Code:
$opts['use_default'] = true;
in plugins\fabrik_element\ip\ip.php before line 168
seems to fix it (tested with new and existing records, editOnUpdate on and off, but not with different element access settings).

But I really don't know what this code is for at all... :(
 
Added just after defined('_JEXEC') or die('Restricted access'); still no change. Able to submit form time and time again. I also turned off the element hidden function and it still allows me to post.
 
It seems like you inserted the suggested code close to the top of the file. As @troester said, insert that line in plugins\fabrik_element\ip\ip.php before line 168. This would mean immediately before, not some arbitrary place before.
 
Please post some more informations. What is working/not working?
Isunique validation is working fine on my site.
 
New entries go right through, so Isunique validation is NOT WORKING.
Edit entries fail, so Isunique validation is WORKING.
 
With the fix it is working.
New records with the IP of an existing record won't save.
Existing records can be saved (using their same, already saved, so unique IP).

If the IP element is set to "update on edit" it won't save if the IP does already exist (in an other record).
 
This is not my experience. New records can be added over and over from the same IP. I am not using update on edit.
 
Back
Top