-// ttAccessCheck is used to check whether user is allowed to proceed. This function is used
-// as an initial check on all publicly available pages.
-function ttAccessCheck($required_rights)
-{
- global $auth;
- global $user;
-
- // Redirect to login page if user is not authenticated.
- if (!$auth->isAuthenticated()) {
- header('Location: login.php');
- exit();
- }
-
- // Check rights.
- if (!($required_rights & $user->rights_mask))
- return false;
-
- return true;
-}
-