diff --git a/src/IDF/Scm/Git.php b/src/IDF/Scm/Git.php index ca05429..edc1aab 100644 --- a/src/IDF/Scm/Git.php +++ b/src/IDF/Scm/Git.php @@ -280,6 +280,14 @@ class IDF_Scm_Git extends IDF_Scm public static function getAuthAccessUrl($project, $user, $commit=null) { + // if the user haven't registred a public ssh key, + // he can't use the write url which use the SSH authentification + if ($user != null) { + $keys = $user->get_idf_key_list(); + if (count ($keys) == 0) + return self::getAnonymousAccessUrl($project); + } + return sprintf(Pluf::f('git_write_remote_url'), $project->shortname); }