Skip to content

Commit

Permalink
fix(spdx2): also show email-address of creator in report
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhbr committed Jan 24, 2017
1 parent 9d74d05 commit 42f9284
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/lib/php/Dao/UserDao.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,19 @@ public function getUserName($userId)
}
return $userRow['user_name'];
}
/**
* @param int $userId
* @return string
*/
public function getUserEmail($userId)
{
$userRow = $this->dbManager->getSingleRow("SELECT user_email FROM users WHERE user_pk=$1",array($userId),__METHOD__);
if(!$userRow)
{
throw new \Exception('unknown user with id='.$userId);
}
return $userRow['user_email'];
}
}
2 changes: 1 addition & 1 deletion src/spdx2/agent/spdx2.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ protected function writeReport(&$packageNodes, $packageIds, $uploadId)
$message = $this->renderString($this->getTemplateFile('document'),array(
'documentName'=>$fileBase,
'uri'=>$this->uri,
'userName'=>$this->container->get('dao.user')->getUserName($this->userId),
'userName'=>$this->container->get('dao.user')->getUserName($this->userId) . " (" . $this->container->get('dao.user')->getUserEmail($this->userId) . ")",
'organisation'=>'',
'packageNodes'=>$packageNodes,
'packageIds'=>$packageIds,
Expand Down

0 comments on commit 42f9284

Please sign in to comment.