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


PHP ForgeConfig::getSuperPublicProjectsFromRestrictedFile方法代码示例

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


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

示例1: isSuperPublic

 private function isSuperPublic()
 {
     $super_public_projects = ForgeConfig::getSuperPublicProjectsFromRestrictedFile();
     return in_array($this->getID(), $super_public_projects);
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:5,代码来源:Project.class.php

示例2: isProjectSuperPublic

 private function isProjectSuperPublic($project_id)
 {
     $projects = ForgeConfig::getSuperPublicProjectsFromRestrictedFile();
     return in_array($project_id, $projects);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:5,代码来源:Layout.class.php

示例3: restrictedUserCanAccessUrl


//.........这里部分代码省略.........
     $allow_access_to_project_mail = array(1);
     // Support project mailing lists (Developers Channels)
     $allow_access_to_project_frs = array(1);
     // Support project file releases
     $allow_access_to_project_refs = array(1);
     // Support project references
     $allow_access_to_project_news = array(1);
     // Support project news
     $allow_access_to_project_trackers_v5 = array(1);
     //Support project trackers v5 are used for support requests
     // List of fully public projects (same access for restricted and unrestricted users)
     // Customizable security settings for restricted users:
     include $GLOBALS['Language']->getContent('include/restricted_user_permissions', 'en_US');
     // End of customization
     // For convenient reasons, admin can customize those variables as arrays
     // but for performances reasons we prefer to use hashes (avoid in_array)
     // so we transform array(101) => array(101=>0)
     $allow_access_to_project_forums = array_flip($allow_access_to_project_forums);
     $allow_access_to_project_trackers = array_flip($allow_access_to_project_trackers);
     $allow_access_to_project_docs = array_flip($allow_access_to_project_docs);
     $allow_access_to_project_mail = array_flip($allow_access_to_project_mail);
     $allow_access_to_project_frs = array_flip($allow_access_to_project_frs);
     $allow_access_to_project_refs = array_flip($allow_access_to_project_refs);
     $allow_access_to_project_news = array_flip($allow_access_to_project_news);
     $allow_access_to_project_trackers_v5 = array_flip($allow_access_to_project_trackers_v5);
     foreach ($forbidden_url as $str) {
         $pos = strpos($req_uri, $str);
         if ($pos === false) {
             // Not found
         } else {
             if ($pos == 0) {
                 // beginning of string
                 return false;
             }
         }
     }
     // Welcome page
     if (!$allow_welcome_page) {
         $sc_name = '/' . trim($script_name, "/");
         if ($sc_name == '/index.php') {
             return false;
         }
     }
     //Forbid search unless it's on a tracker
     if (strpos($req_uri, '/search') === 0 && isset($_REQUEST['type_of_search']) && $_REQUEST['type_of_search'] == 'tracker') {
         return true;
     } elseif (strpos($req_uri, '/search') === 0) {
         return false;
     }
     // Forbid access to other user's page (Developer Profile)
     if (strpos($req_uri, '/users/') === 0 && !$allow_user_browsing) {
         if ($req_uri != '/users/' . $user->getName() && $req_uri != '/users/' . $user->getName() . '/avatar.png') {
             return false;
         }
     }
     // Forum and news. Each published news is a special forum of project 'news'
     if (strpos($req_uri, '/news/') === 0 && isset($allow_access_to_project_news[$group_id])) {
         $user_is_allowed = true;
     }
     if (strpos($req_uri, '/news/') === 0 && $allow_news_browsing) {
         $user_is_allowed = true;
     }
     if (strpos($req_uri, '/forum/') === 0 && isset($allow_access_to_project_forums[$group_id])) {
         $user_is_allowed = true;
     }
     // Codendi trackers
     if (strpos($req_uri, '/tracker/') === 0 && isset($allow_access_to_project_trackers[$group_id])) {
         $user_is_allowed = true;
     }
     // Trackers v5
     if (strpos($req_uri, '/plugins/tracker/') === 0 && isset($allow_access_to_project_trackers_v5[$group_id])) {
         $user_is_allowed = true;
     }
     // Codendi documents and wiki
     if ((strpos($req_uri, '/docman/') === 0 || strpos($req_uri, '/plugins/docman/') === 0 || strpos($req_uri, '/wiki/') === 0) && isset($allow_access_to_project_docs[$group_id])) {
         $user_is_allowed = true;
     }
     // Codendi mailing lists page
     if (strpos($req_uri, '/mail/') === 0 && isset($allow_access_to_project_mail[$group_id])) {
         $user_is_allowed = true;
     }
     // Codendi file releases
     if (strpos($req_uri, '/file/') === 0 && isset($allow_access_to_project_frs[$group_id])) {
         $user_is_allowed = true;
     }
     // References
     if (strpos($req_uri, '/goto') === 0 && isset($allow_access_to_project_refs[$group_id])) {
         $user_is_allowed = true;
     }
     if (!$user_is_allowed) {
         $this->getEventManager()->processEvent(Event::IS_SCRIPT_HANDLED_FOR_RESTRICTED, array('allow_restricted' => &$user_is_allowed, 'user' => $user, 'uri' => $script_name));
     }
     if ($group_id && !$user_is_allowed) {
         if (in_array($group_id, ForgeConfig::getSuperPublicProjectsFromRestrictedFile())) {
             return true;
         }
         return false;
     }
     return true;
 }
开发者ID:sunmoonone,项目名称:tuleap,代码行数:101,代码来源:URLVerification.class.php

示例4: itDoesNotStorePublicProjectsInTheStorage

 public function itDoesNotStorePublicProjectsInTheStorage()
 {
     stub($GLOBALS['Language'])->getContent('include/restricted_user_permissions', 'en_US')->returns($this->customised_file);
     ForgeConfig::getSuperPublicProjectsFromRestrictedFile();
     $this->assertIdentical(ForgeConfig::get('public_projects'), false);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:6,代码来源:ConfigTest.php


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