/**
  * Execute action
  * 
  * @see src/common/system_event/SystemEvent::process()
  */
 public function process()
 {
     $user_ids = $this->getParametersAsArray();
     $project_ids = array();
     // Get all projects the user is member of (project member or user group member)
     $um = $this->getUserManager();
     foreach ($user_ids as $user_id) {
         $user = $um->getUserById($user_id);
         if ($user && ($user->isActive() || $user->isRestricted())) {
             $prjs = $user->getAllProjects();
             foreach ($prjs as $pid) {
                 if (!isset($project_ids[$pid])) {
                     $project_ids[$pid] = $pid;
                 }
             }
         }
     }
     // Update SVNAccessFile of projects
     $backendSVN = $this->getBackendSVN();
     foreach ($project_ids as $project_id) {
         $project = $this->project_manager->getProject($project_id);
         if ($project && $this->ldap_project_manager->hasSVNLDAPAuth($project->getId())) {
             $backendSVN->updateProjectSVNAccessFile($project);
         }
     }
     $this->done();
 }
Exemplo n.º 2
0
 function svn_apache_auth($params)
 {
     if ($GLOBALS['sys_auth_type'] == 'ldap') {
         $ldapProjectManager = new LDAP_ProjectManager();
         if ($ldapProjectManager->hasSVNLDAPAuth($params['project_info']['group_id'])) {
             $params['svn_apache_auth'] = new LDAP_SVN_Apache($this->getLdap(), $params['project_info']);
         }
     }
 }
Exemplo n.º 3
0
 public function svn_apache_auth($params)
 {
     if ($GLOBALS['sys_auth_type'] == 'ldap') {
         $ldapProjectManager = new LDAP_ProjectManager();
         if ($ldapProjectManager->hasSVNLDAPAuth($params['project_info']['group_id'])) {
             if ($params['svn_conf_auth'] === SVN_Apache_SvnrootConf::CONFIG_SVN_AUTH_PERL || $params['project_authorizes_tokens']) {
                 $params['svn_apache_auth'] = new LDAP_SVN_Apache_ModPerl($this->getLdap(), $params['project_info']);
             } else {
                 $params['svn_apache_auth'] = new LDAP_SVN_Apache($this->getLdap(), $params['project_info']);
             }
         }
     }
 }