X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/03e3d32869aa0791e1d841be69cf5c0c84a5450f..241fff8e23fee4caddf4038ad83df75e8146f1a2:/WEB-INF/lib/ttUser.class.php diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 05081c5a..7867ac8e 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -810,7 +810,7 @@ class ttUser { return; } - // setOnBehalfUser sets on behalf user both the object and the session. + // setOnBehalfUser sets on behalf user both the object and the session. function setOnBehalfUser($user_id) { // Unset things first. @@ -833,4 +833,17 @@ class ttUser { $this->behalf_name = $onBehalfUserName; return; } + + // The exists() function determines if an active user exists in context of a page. + // If we are working as self, true. + // If we are working in a subgroup with active users, true. + // If we are working in a subgroup without active users, false. + function exists() { + if (!$this->behalfGroup) + return true; // Working as self. + else if ($this->behalfGroup->active_users) + return true; // Subgroup has users. + + return false; + } }