global $i18n;
+ // Protection fom too many recent bot registrations from user IP.
+ if ($this->registeredRecently()) {
+ $this->err->add($i18n->get('error.access_denied'));
+ return false;
+ }
+
import('ttUserHelper');
if (ttUserHelper::getUserByLogin($this->login)) {
// User login already exists.
return true;
}
+
+ // registeredRecently determines if we already have a successful recent registration from user IP.
+ // "recent" means "within the last minute" and is set in a query by the following condition:
+ // "and created > now() - interval 1 minute". Change if necessary.
+ function registeredRecently() {
+ $mdb2 = getConnection();
+
+ $ip_part = ' created_ip = '.$mdb2->quote($_SERVER['REMOTE_ADDR']);
+ $sql = 'select created from tt_teams where '.$ip_part.' and created > now() - interval 1 minute';
+ $res = $mdb2->query($sql);
+ if (is_a($res, 'PEAR_Error'))
+ return false;
+ $val = $res->fetchRow();
+ if ($val)
+ return true;
+
+ return false;
+ }
}
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.68.4151 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.69.4152 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>