--- a/include/git/projectlist/ProjectListBase.class.php +++ b/include/git/projectlist/ProjectListBase.class.php @@ -362,6 +362,8 @@ if ($config->HasValue('gitphp.description')) { $project->SetDescription($config->GetValue('gitphp.description')); + } else if ($config->HasValue('gitweb.description')) { + $project->SetDescription($config->GetValue('gitweb.description')); } if ($config->HasValue('gitphp.category')) { @@ -415,19 +417,19 @@ if (!$this->config) return; - if ($this->config->HasKey('cloneurl')) { + if ($this->config->GetValue('cloneurl')) { $project->SetCloneUrl(GitPHP_Util::AddSlash($this->config->GetValue('cloneurl'), false) . $project->GetProject()); } - if ($this->config->HasKey('pushurl')) { + if ($this->config->GetValue('pushurl')) { $project->SetPushUrl(GitPHP_Util::AddSlash($this->config->GetValue('pushurl'), false) . $project->GetProject()); } - if ($this->config->HasKey('bugpattern')) { + if ($this->config->GetValue('bugpattern')) { $project->SetBugPattern($this->config->GetValue('bugpattern')); } - if ($this->config->HasKey('bugurl')) { + if ($this->config->GetValue('bugurl')) { $project->SetBugUrl($this->config->GetValue('bugurl')); } @@ -456,6 +458,19 @@ $this->Sort(); $this->ApplySettings(); + } + + /** + * Filter projects by user access + * + * @param string $username username + */ + public function FilterByUser($username) + { + foreach ($this->projects as $path => $project) { + if (!$project->UserCanAccess($username)) + unset($this->projects[$path]); + } } /**