Multiple points granted when user fast clicks

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
clau_bolson's picture

I need advice to help me deal with this problem:
I use userpoints in a site where points are awarded to users when they login, but only once a day.
I have setup a rule:

On event "User has logged in"

If

$today = date("d-m-Y"); // if he has logged in yesterday at 23:50 he can log in today at 0:05

$today_timestamp = strtotime($hoy);

if ([account:user-last-login-raw]<$today_timestamp)
return true;
else

return false;

DO
Grant points to a user

This works as planned, except when the user clicks very fast the login button. Then it grants points to the user multiple times.

I have also tried , as a condition, a comparison of "$today_timestamp" with max(time_stamp) for the user in the userpoints_txn table, with similar results.

Any ideas on how to avoid this?
Thanks!

User Points

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week