Exemplo n.º 1
0
 public function anonymous_access_to_script_allowed($params)
 {
     if (strpos($_SERVER['REQUEST_URI'], $this->getPluginPath()) === 0) {
         $url = new Git_URL(ProjectManager::instance(), $this->getRepositoryFactory(), $_SERVER['REQUEST_URI']);
         if ($url->isSmartHTTP()) {
             $params['anonymous_allowed'] = true;
         }
     }
 }
Exemplo n.º 2
0
 private function routeGitSmartHTTP(Git_URL $url)
 {
     if (!$url->isSmartHTTP()) {
         return;
     }
     $repository = $url->getRepository();
     if (!$repository) {
         return;
     }
     $logger = new WrapperLogger($this->logger, 'http');
     $logger->debug('REQUEST_URI ' . $_SERVER['REQUEST_URI']);
     $command_factory = new Git_HTTP_CommandFactory($this->factory, new User_LoginManager(EventManager::instance(), UserManager::instance(), new User_PasswordExpirationChecker(), PasswordHandlerFactory::getPasswordHandler()), PermissionsManager::instance(), new URLVerification(), $logger);
     $http_wrapper = new Git_HTTP_Wrapper($logger);
     $http_wrapper->stream($command_factory->getCommandForRepository($repository, $url));
     exit;
 }