Skip to content

Commit

Permalink
Merge pull request #2431 from owlhooter/master
Browse files Browse the repository at this point in the history
Add Anonymous check for blockfinder email
  • Loading branch information
TheSerapher committed May 29, 2015
2 parents 9336608 + d1d392a commit ecf2c1c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cronjobs/findblock.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,12 @@
// 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';
Expand Down
3 changes: 3 additions & 0 deletions include/classes/user.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ private function getHash($string, $version=0, $pepper='') {
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');
}
Expand Down

0 comments on commit ecf2c1c

Please sign in to comment.