X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2Fcommon.lib.php;h=7086fe298243667a99991461e8236739ae136ddb;hb=e59d57b1fcf105382028dcfc0157a6ca84b0dc46;hp=e9f9332777963d8f90a659915f2db8aeada6ba5d;hpb=e4c40a490a8c9477cab1d41b786aa7aaa5e930d6;p=timetracker.git diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index e9f93327..7086fe29 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -325,30 +325,9 @@ function ttValidCondition($val, $emptyValid = true) return true; } -// 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; -} - // ttAccessAllowed checks whether user is allowed access to a particular page. -// This function is a replacement for ttAccessCheck above as part of roles revamp. -// To be used as an initial check on all publicly available pages -// (except login.php and register.php where we don't have to check). +// It is used as an initial check on all publicly available pages +// (except login.php, register.php, and others where we don't have to check). function ttAccessAllowed($required_right) { global $auth; @@ -361,8 +340,11 @@ function ttAccessAllowed($required_right) } // Check if user has the right. - if (in_array($required_right, $user->rights)) + if (in_array($required_right, $user->rights)) { + import('ttUserHelper'); + ttUserHelper::updateLastAccess(); return true; + } return false; }