X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=WEB-INF%2Flib%2Fcommon.lib.php;h=3dce388f5193706cbca402054db09678fb2f694b;hb=ecf7d911c95935f8cfb2403f645cd12f93d8c3f5;hp=5621492228ff0f780510be76ccfeb80b22b4b19f;hpb=718f61be021c6afa8ddd836e6f5cd9d76faf8530;p=timetracker.git diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index 56214922..3dce388f 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,10 @@ function ttAccessAllowed($required_right) } // Check if user has the right. - if (in_array($required_right, $user->rights)) + if (in_array($required_right, $user->rights)) { + ttUserHelper::updateLastAccess(); return true; + } return false; -} \ No newline at end of file +}