Added ticket 80, scm login integration with database login.

Based on the login for Subversion and the email address for git and
Mercurial.
This commit is contained in:
Loic d'Anterroches
2008-12-05 11:34:02 +01:00
parent d6e3b8dca9
commit a1eeb12516
8 changed files with 72 additions and 18 deletions

View File

@@ -35,6 +35,26 @@ class IDF_Scm_Git
$this->repo = $repo;
}
/**
* Given the string describing the author from the log find the
* author in the database.
*
* @param string Author
* @return mixed Pluf_User or null
*/
public function findAuthor($author)
{
// We extract the email.
$match = array();
if (!preg_match('/<(.*)>/', $author, $match)) {
return null;
}
$sql = new Pluf_SQL('email=%s', array($match[1]));
$users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen()));
return ($users->count() > 0) ? $users[0] : null;
}
/**
* Returns the URL of the git daemon.
*