Example #1
0
 /**
  * Checks if the user can access the project $group,
  * regarding the restricted access
  *
  * @param Project $group Affected project
  * @param         $user
  *
  * @return boolean true if the current session user has access to this project, false otherwise
  */
 private function getRestrictedAccessForUserInGroup($group, $user)
 {
     if (ForgeConfig::areRestrictedUsersAllowed()) {
         if ($group) {
             if ($user) {
                 if ($user->isRestricted()) {
                     return $group->userIsMember();
                 } else {
                     return true;
                 }
             } else {
                 return false;
             }
         } else {
             return false;
         }
     } else {
         return true;
     }
 }
Example #2
0
 /**
  * Check if the user can access the project $group,
  * regarding the restricted access
  *
  * @param Project $group Affected project
  * @return boolean true if the current session user has access to this project, false otherwise
  */
 function checkRestrictedAccess($group)
 {
     if (array_key_exists('sys_allow_restricted_users', $GLOBALS) && $GLOBALS['sys_allow_restricted_users'] == 1) {
         if ($group) {
             $user = $this->_getUserManager()->getCurrentUser();
             if ($user) {
                 if ($user->isRestricted()) {
                     return $group->userIsMember();
                 } else {
                     return true;
                 }
             } else {
                 return false;
             }
         } else {
             return false;
         }
     } else {
         return true;
     }
 }