// getTopRole returns top role id.
private function getTopRole() {
- global $user;
$mdb2 = getConnection();
$sql = "select id from tt_roles where group_id = 0 and rank = ".MAX_RANK." and status = 1";
}
// getRoleByRank looks up a role by its rank.
- static function getRoleByRank($rank, $group_id) {
+ static function getRoleByRank($rank) {
global $user;
$mdb2 = getConnection();
- $rank = (int) $rank; // Cast to int just in case for better security.
+ $group_id = $user->getGroup();
+ $org_id = $user->org_id;
+ $rank = (int) $rank; // Cast to int just in case.
- $sql = "select id from tt_roles where group_id = $group_id and rank = $rank and (status = 1 or status = 0)";
+ $sql = "select id from tt_roles where group_id = $group_id and org_id = $org_id and rank = $rank and (status = 1 or status = 0)";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.28.4547 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.28.4548 | 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>
if ($err->no() && ttRoleHelper::getRoleByName($cl_name)) $err->add($i18n->get('error.object_exists'));
if ($err->no()) {
- $existing_role = ttRoleHelper::getRoleByRank($cl_rank, $user->group_id);
+ $existing_role = ttRoleHelper::getRoleByRank($cl_rank);
if (!$existing_role) {
// Insert a role with default user rights.
if (ttRoleHelper::insert(array(