Merge pull request #2431 from owlhooter/master

Add Anonymous check for blockfinder email
This commit is contained in:
Sebastian Grewe 2015-05-29 18:50:55 +02:00
commit ecf2c1cc41
2 changed files with 9 additions and 2 deletions

View File

@ -157,8 +157,12 @@ if (empty($aAllBlocks)) {
// Notify users
$aAccounts = $notification->getNotificationAccountIdByType('new_block');
if (is_array($aAccounts)) {
$finder = $user->getUserName($iAccountId);
if ($user->getUserNameAnon($iAccountId) == 1) {
$finder = "Anonymous";
} else {
$finder = $user->getUserName($iAccountId);
}
foreach ($aAccounts as $aData) {
$aMailData['height'] = $aBlock['height'];
$aMailData['subject'] = 'New Block';

View File

@ -31,6 +31,9 @@ class User extends Base {
public function getUserName($id) {
return $this->getSingle($id, 'username', 'id');
}
public function getUserNameAnon($id) {
return $this->getSingle($id, 'is_anonymous', 'id');
}
public function getUserNameByEmail($email) {
return $this->getSingle($email, 'username', 'email', 's');
}