Exemplo n.º 1
0
/**
 * Check if the user can access the project $group,
 * regarding the restricted access
 *
 * @param Object{Group} $group the Group object
 * @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 = UserManager::instance()->getCurrentUser();
            if ($user) {
                if ($user->isRestricted()) {
                    return $group->userIsMember();
                } else {
                    return true;
                }
            } else {
                return false;
            }
        } else {
            return false;
        }
    } else {
        return true;
    }
}
Exemplo n.º 2
0
/**
 * Check if the user can access the project $group,
 * regarding the restricted access
 *
 * @param Object{Group} $group the Group object
 * @return boolean true if the current session user has access to this project, false otherwise
 */
function checkRestrictedAccess($group)
{
    if (ForgeConfig::areRestrictedUsersAllowed()) {
        if ($group) {
            $user = UserManager::instance()->getCurrentUser();
            if ($user) {
                if ($user->isRestricted()) {
                    return $group->userIsMember();
                } else {
                    return true;
                }
            } else {
                return false;
            }
        } else {
            return false;
        }
    } else {
        return true;
    }
}
Exemplo n.º 3
0
 /**
  * Returns a soap Group object corresponding to the Codendi Group object
  *
  * @param Object{Group} $group the group we want to convert in soap
  * @return array the soap group object
  */
 function group_to_soap($group)
 {
     $soap_group = array('group_id' => $group->getGroupId(), 'group_name' => util_unconvert_htmlspecialchars($group->getPublicName()), 'unix_group_name' => $group->getUnixName(), 'description' => util_unconvert_htmlspecialchars($group->getDescription()));
     return $soap_group;
 }