当前位置: 首页>>代码示例>>PHP>>正文


PHP PFUser::isRestricted方法代码示例

本文整理汇总了PHP中PFUser::isRestricted方法的典型用法代码示例。如果您正苦于以下问题:PHP PFUser::isRestricted方法的具体用法?PHP PFUser::isRestricted怎么用?PHP PFUser::isRestricted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PFUser的用法示例。


在下文中一共展示了PFUser::isRestricted方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: account_add_user_obj_to_group

/**
 * Add a new user into a given project
 * 
 * @param Integer $group_id Project id
 * @param PFUser    $user     User to add
 * 
 * @return Boolean
 */
function account_add_user_obj_to_group($group_id, PFUser $user)
{
    //user was found but if it's a pending account adding
    //is not allowed
    if (!$user->isActive() && !$user->isRestricted()) {
        $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('include_account', 'account_notactive', $user->getUserName()));
        return false;
    }
    //if not already a member, add it
    $res_member = db_query("SELECT user_id FROM user_group WHERE user_id=" . $user->getId() . " AND group_id='" . db_ei($group_id) . "'");
    if (db_numrows($res_member) < 1) {
        //not already a member
        db_query("INSERT INTO user_group (user_id,group_id) VALUES (" . db_ei($user->getId()) . "," . db_ei($group_id) . ")");
        //if no unix account, give them a unix_uid
        if ($user->getUnixStatus() == 'N' || !$user->getUnixUid()) {
            $user->setUnixStatus('A');
            $um = UserManager::instance();
            $um->assignNextUnixUid($user);
            $um->updateDb($user);
        }
        // Raise an event
        $em = EventManager::instance();
        $em->processEvent('project_admin_add_user', array('group_id' => $group_id, 'user_id' => $user->getId(), 'user_unix_name' => $user->getUserName()));
        $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('include_account', 'user_added'));
        account_send_add_user_to_group_email($group_id, $user->getId());
        group_add_history('added_user', $user->getUserName(), $group_id, array($user->getUserName()));
        return true;
    } else {
        $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('include_account', 'user_already_member'));
    }
    return false;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:40,代码来源:account.php

示例2: userCanRead

 /**
  * Test is user can read the content of this repository and metadata
  *
  * @param PFUser          $user       The user to test
  * @param GitRepository $repository The repository to test
  *
  * @return Boolean
  */
 public function userCanRead($user, $repository)
 {
     if ($repository->isPrivate() && $user->isMember($repository->getProjectId())) {
         return true;
     }
     if ($repository->isPublic()) {
         if ($user->isRestricted() && $user->isMember($repository->getProjectId())) {
             return true;
         }
         if (!$user->isAnonymous()) {
             return true;
         }
     }
     return false;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:23,代码来源:GitBackend.class.php

示例3: user_to_soap

/**
 * User can get information about other users if they are active, retricted or suspended
 *
 * Suspended is needed to be coherent with the GUI where the suspended users are displayed
 * like active users to people (otherwise it breaks Mylyn on trackers due to workflow manager)
 *
 * @param string $identifier
 * @param PFUser $user
 * @param PFUser $current_user
 * @return array
 */
function user_to_soap($identifier, PFUser $user = null, PFUser $current_user)
{
    if ($user !== null && ($user->isActive() || $user->isRestricted() || $user->isSuspended())) {
        if ($current_user->canSee($user)) {
            return array('identifier' => $identifier, 'username' => $user->getUserName(), 'id' => $user->getId(), 'real_name' => $user->getRealName(), 'email' => $user->getEmail(), 'ldap_id' => $user->getLdapId());
        }
    }
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:19,代码来源:utils_soap.php

示例4: restrictedMemberIsNotProjectMember

 private function restrictedMemberIsNotProjectMember(PFUser $user, $project_id)
 {
     return $user->isRestricted() && !$user->isMember($project_id);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:4,代码来源:Layout.class.php

示例5: userIsRestrictedAndNotMemberOfProject

 private function userIsRestrictedAndNotMemberOfProject(PFUser $user, Project $project)
 {
     return $user->isRestricted() && !$user->isMember($project->getID()) && $this->project_manager->checkRestrictedAccessForUser($project, $user);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:4,代码来源:PermissionChecker.class.php

示例6: trove_get_visibility_for_user

function trove_get_visibility_for_user($field, PFUser $user)
{
    if (ForgeConfig::areRestrictedUsersAllowed() && $user->isRestricted()) {
        return $field . ' = "' . db_es(Project::ACCESS_PUBLIC_UNRESTRICTED) . '"';
    } else {
        return $field . ' != "' . db_es(Project::ACCESS_PRIVATE) . '"';
    }
}
开发者ID:lincoln56,项目名称:tuleap,代码行数:8,代码来源:trove.php

示例7: userIsRestrictedAndNotProjectMember

 private function userIsRestrictedAndNotProjectMember(PFUser $user, Project $project)
 {
     return $project->allowsRestricted() && $user->isRestricted() && !$user->isMember($project->getID());
 }
开发者ID:slamj1,项目名称:tuleap,代码行数:4,代码来源:MediawikiManager.class.php

示例8: userCanAccessProject

 /**
  * Ensure given user can access given project
  *
  * @param PFUser  $user
  * @param Project $project
  * @return boolean
  * @throws Project_AccessProjectNotFoundException
  * @throws Project_AccessDeletedException
  * @throws Project_AccessRestrictedException
  * @throws Project_AccessPrivateException
  */
 public function userCanAccessProject(PFUser $user, Project $project)
 {
     if ($project->isError()) {
         throw new Project_AccessProjectNotFoundException();
     } elseif ($user->isSuperUser()) {
         return true;
     } elseif (!$project->isActive()) {
         throw new Project_AccessDeletedException($project);
     } elseif ($user->isMember($project->getID())) {
         return true;
     } elseif ($user->isRestricted() && !$this->canRestrictedUserAccess($user, $project)) {
         throw new Project_AccessRestrictedException();
     } elseif ($project->isPublic()) {
         return true;
     } elseif ($this->userHasBeenDelegatedAccess($user)) {
         return true;
     }
     throw new Project_AccessPrivateException();
 }
开发者ID:pdaniel-frk,项目名称:tuleap,代码行数:30,代码来源:URLVerification.class.php

示例9: assertUserCanAccessProject

 public function assertUserCanAccessProject(PFUser $user, Project $project)
 {
     if ($project->isPublic() && $user->isRestricted() && !$user->isMember($project->getGroupId()) || !$project->isPublic() && !$user->isMember($project->getGroupId())) {
         throw new Exception('User do not have access to the project', '3002');
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:6,代码来源:SOAP_RequestValidator.class.php


注:本文中的PFUser::isRestricted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。