Fixed issue 209, erroneous details with private repository

This commit is contained in:
Loic d'Anterroches
2009-06-19 16:20:33 +02:00
parent 29e053bf6b
commit 8915b45948
3 changed files with 21 additions and 2 deletions

View File

@@ -349,9 +349,28 @@ class IDF_Project extends Pluf_Model
return new Pluf_Template_ContextVars($tags);
}
/**
* Get the access url to the repository.
*
* This will return the right url based on the user.
*
* @param Pluf_User The user (null)
*/
public function getSourceAccessUrl($user=null)
{
$right = $this->getConf()->getVal('source_access_rights', 'all');
if (($user == null or $user->isAnonymous())
and $right == 'all' and !$this->private) {
return $this->getRemoteAccessUrl();
}
return $this->getWriteRemoteAccessUrl($user);
}
/**
* Get the remote access url to the repository.
*
* This will always return the anonymous access url.
*/
public function getRemoteAccessUrl()
{