X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/2ff04a2baeaa449ab30b822e2bb52ff792776753..9339284bfdaba5a0c2a4e3c9fa000194a508d0bf:/WEB-INF/lib/ttUser.class.php diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 85b26d51..5321e74d 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -251,12 +251,14 @@ class ttUser { $includeSelf = isset($options['include_self']); $select_part = 'select u.id, u.name'; + if (isset($options['include_login'])) $select_part .= ', u.login'; if (!isset($options['include_clients'])) $select_part .= ', r.rights'; + if (isset($options['include_role'])) $select_part .= ', r.name as role_name, r.rank'; $from_part = ' from tt_users u'; $left_joins = null; - if (isset($options['max_rank']) || $skipClients) + if (isset($options['max_rank']) || $skipClients || isset($options['include_role'])) $left_joins .= ' left join tt_roles r on (u.role_id = r.id)'; $where_part = " where u.team_id = $this->team_id"; @@ -305,14 +307,13 @@ class ttUser { if ($one_user['id'] == $this->behalf_id) return true; } - return false; } // adjustBehalfId attempts to adjust behalf_id and behalf_name to a first found - // aapropriate user. + // apropriate user. // - // Needed for situations when use does not have do_own_something right. + // Needed for situations when user does not have do_own_something right. // Example: has view_charts but does not have view_own_charts. // In this case we still allow access to charts, but set behalf_id to someone else. function adjustBehalfId() {