global $i18n;
global $user;
- // Protection fom too many recent bot registrations from user IP.
+ // Protection from too many recent bot registrations from user IP.
if (!$user->can('administer_site')) { // No problems for site admin.
if ($this->registeredRecently()) {
$this->err->add($i18n->get('error.access_denied'));
return false;
}
- if (!$this->setCreatedBy($this->user_id))
+ // Set created_by appropriately (admin or self).
+ $created_by = $user->can('administer_site') ? $user->id : $this->user_id;
+ if (!$this->setCreatedBy($created_by))
return false;
return true;
}
// Update top manager.
- $sql = "update tt_users set created_by = $user_id where id = $user_id and group_id = $this->group_id";
+ $sql = "update tt_users set created_by = $user_id where id = $this->user_id and group_id = $this->group_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error')) {
$this->err->add($i18n->get('error.db'));
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.12.4396 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.12.4397 | 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>
import('ttRegistrator');
$registrator = new ttRegistrator($fields, $err);
$registrator->register();
- $registrator->setCreatedBy($user->id); // Override created_by to admin account.
+ // $registrator->setCreatedBy($user->id); // Override created_by to admin account.
+ // TODO: redo ttRegistrator class by passing in created_by_id in $fields to keep code straightforward.
if ($err->no()) {
header('Location: admin_groups.php');
exit();