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


PHP ForgeConfig::areAnonymousAllowed方法代码示例

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


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

示例1: __construct

 public function __construct(Project $project)
 {
     if (!$project->isPublic()) {
         $this->mapping = array(ProjectUGroup::ANONYMOUS => ProjectUGroup::PROJECT_MEMBERS, ProjectUGroup::AUTHENTICATED => ProjectUGroup::PROJECT_MEMBERS, ProjectUGroup::REGISTERED => ProjectUGroup::PROJECT_MEMBERS);
     } elseif (!ForgeConfig::areAnonymousAllowed()) {
         $this->mapping[ProjectUGroup::ANONYMOUS] = ProjectUGroup::REGISTERED;
         if (ForgeConfig::areRestrictedUsersAllowed() && $project->allowsRestricted()) {
             $this->mapping[ProjectUGroup::ANONYMOUS] = ProjectUGroup::AUTHENTICATED;
             $this->mapping[ProjectUGroup::AUTHENTICATED] = ProjectUGroup::AUTHENTICATED;
         }
     }
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:12,代码来源:PermissionsUGroupMapper.php

示例2: getAllForProject

 /**
  * @param Project $project
  * @return User_ForgeUGroup[]
  */
 public function getAllForProject(Project $project)
 {
     $user_groups = array();
     if (ForgeConfig::areAnonymousAllowed() && $project->isPublic()) {
         $user_groups[] = $this->getDynamicForgeUserGroupByName(User_ForgeUGroup::ANON);
     }
     if (ForgeConfig::areRestrictedUsersAllowed() && $project->allowsRestricted()) {
         $user_groups[] = $this->getDynamicForgeUserGroupByName(User_ForgeUGroup::AUTHENTICATED);
     }
     if ($project->isPublic()) {
         $user_groups[] = $this->getDynamicForgeUserGroupByName(User_ForgeUGroup::REGISTERED);
     }
     $user_groups[] = $this->getDynamicForgeUserGroupByName(User_ForgeUGroup::PROJECT_MEMBERS);
     $user_groups[] = $this->getDynamicForgeUserGroupByName(User_ForgeUGroup::PROJECT_ADMINS);
     return array_merge($user_groups, $this->getStaticByProject($project), array($this->getDynamicForgeUserGroupByName(User_ForgeUGroup::NOBODY)));
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:20,代码来源:ForgeUserGroupFactory.php

示例3: authenticate

 /**
  * Authentication method
  *
  * Returns the authenticated user
  *
  * @return PFUser
  */
 function authenticate()
 {
     // test if username field is empty
     if (!$this->issetUsername()) {
         $this->setHeader();
     } else {
         $username = $this->getUsername();
         $password = $this->getPassword();
         $user = $this->getUser($username, $password);
         // Ask again for authentication if the user entered a wrong username or password
         // if fields are left blank the user is considered as anonymous unless Tuleap don't accept anonymous access
         if ($user->isAnonymous() && ($username || $password || !ForgeConfig::areAnonymousAllowed())) {
             $this->setHeader();
         } else {
             return $user;
         }
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:25,代码来源:WebDAVAuthentication.class.php

示例4: needAuthentication

 private function needAuthentication(GitRepository $repository, Git_URL $url)
 {
     return !ForgeConfig::areAnonymousAllowed() || $this->isGitPush($url) || !$this->canBeReadByAnonymous($repository) || $this->isInPrivateProject($repository);
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:4,代码来源:CommandFactory.class.php

示例5: verifyRequest

 /**
  * Check if anonymous is granted to access else redirect to login page
  *
  * @param Array $server
  *
  * @return void
  */
 public function verifyRequest($server)
 {
     $user = $this->getCurrentUser();
     if (!ForgeConfig::areAnonymousAllowed() && $user->isAnonymous() && !$this->isScriptAllowedForAnonymous($server) && !$this->getPermissionsOverriderManager()->doesOverriderAllowUserToAccessPlatform($user)) {
         $redirect = new URLRedirect();
         $this->urlChunks['script'] = $redirect->buildReturnToLogin($server);
     }
 }
开发者ID:sunmoonone,项目名称:tuleap,代码行数:15,代码来源:URLVerification.class.php

示例6: getProjectPrivacy

 protected function getProjectPrivacy(Project $project)
 {
     if ($project->isPublic()) {
         $privacy = 'public';
         if (ForgeConfig::areAnonymousAllowed()) {
             $privacy .= '_w_anon';
         } else {
             $privacy .= '_wo_anon';
         }
     } else {
         $privacy = 'private';
     }
     return $privacy;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:14,代码来源:Layout.class.php

示例7: doesPlatformRequireLogin

 public function doesPlatformRequireLogin()
 {
     $anonymous_user = new PFUser(array('user_id' => 0));
     if (ForgeConfig::areAnonymousAllowed() && !$this->getPermissionsOverriderManager()->doesOverriderForceUsageOfAnonymous()) {
         return false;
     } elseif ($this->getPermissionsOverriderManager()->doesOverriderAllowUserToAccessPlatform($anonymous_user)) {
         return false;
     }
     return true;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:10,代码来源:URLVerification.class.php

示例8: itReturnsTrueIfRegexpMatchsOnlyTheEndOfTheIP

 public function itReturnsTrueIfRegexpMatchsOnlyTheEndOfTheIP()
 {
     ForgeConfig::set(ForgeAccess::CONFIG, ForgeAccess::ANONYMOUS);
     ForgeConfig::set(ForgeAccess::REVERSE_PROXY_REGEXP, '172.*');
     $_SERVER['REMOTE_ADDR'] = '2.2.172.1';
     $this->assertTrue(ForgeConfig::areAnonymousAllowed());
 }
开发者ID:pdaniel-frk,项目名称:tuleap,代码行数:7,代码来源:ForgeConfigTest.php

示例9: itReturnsFalseIfAccessModeIsRestricted

 public function itReturnsFalseIfAccessModeIsRestricted()
 {
     ForgeConfig::set(ForgeAccess::CONFIG, ForgeAccess::RESTRICTED);
     $this->assertFalse(ForgeConfig::areAnonymousAllowed());
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:5,代码来源:ConfigTest.php

示例10: verifyRequest

 /**
  * Check if anonymous is granted to access else redirect to login page
  *
  * @param Array $server
  *
  * @return void
  */
 public function verifyRequest($server)
 {
     $user = $this->getCurrentUser();
     if (!ForgeConfig::areAnonymousAllowed() && $user->isAnonymous() && !$this->isScriptAllowedForAnonymous($server)) {
         $redirect = new URLRedirect();
         $this->urlChunks['script'] = $redirect->buildReturnToLogin($server);
     }
 }
开发者ID:pdaniel-frk,项目名称:tuleap,代码行数:15,代码来源:URLVerification.class.php

示例11: menu_print_sidebar

function menu_print_sidebar($params)
{
    if (!user_isloggedin()) {
        echo menu_notloggedin();
        if (!ForgeConfig::areAnonymousAllowed()) {
            return;
        }
    } else {
        echo menu_loggedin($params['title']);
    }
    // LJ Site Admin menu added here
    if (user_is_super_user()) {
        echo menu_site_admin();
    }
    echo menu_software();
    echo menu_site();
    //search menu
    echo menu_search();
    ?>
	<div align="center">
	     <?php 
    echo $GLOBALS['HTML']->getOsdnNavDropdown();
    ?>
	     </div>
		   <?php 
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:26,代码来源:menu.php


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