Added the ability to use the username of a user to link a git commit.

This commit is contained in:
Loic d'Anterroches 2009-11-06 15:58:21 +01:00
parent 48ff314487
commit 3c46b7734f

View File

@ -191,9 +191,14 @@ class IDF_Scm_Git extends IDF_Scm
if (!preg_match('/<(.*)>/', $author, $match)) { if (!preg_match('/<(.*)>/', $author, $match)) {
return null; return null;
} }
$sql = new Pluf_SQL('email=%s', array($match[1])); foreach (array('email', 'login') as $what) {
$users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen())); $sql = new Pluf_SQL($what.'=%s', array($match[1]));
return ($users->count() > 0) ? $users[0] : null; $users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen()));
if ($users->count() > 0) {
return $users[0];
}
}
return null;
} }
public static function getAnonymousAccessUrl($project) public static function getAnonymousAccessUrl($project)