Skip to content

Commit

Permalink
Merge pull request #3 from ngodfraind/master
Browse files Browse the repository at this point in the history
Notification works with anon.
  • Loading branch information
maxailloud committed Feb 7, 2014
2 parents ee098ad + fbd6d3f commit c047b92
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Service/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ public function createNotification(NotifiableInterface $notifiable)
$doer = $securityToken->getUser();
}
}
if ($doer !== null) {

if ($doer instanceof Claroline\CoreBundle\Entity\User) {
$doerId = $doer->getId();
}

Expand Down Expand Up @@ -188,8 +189,10 @@ public function notifyUsers(Notification $notification, NotifiableInterface $not
$loggedUser = $token->getUser();
$removeUserIds = array($notification->getUserId());

if (!empty($loggedUser) && $loggedUser->getId() != $notification->getUserId()) {
array_push($removeUserIds, $loggedUser->getId());
if ($loggedUser instanceof Claroline\CoreBundle\Entity\User) {
if (!empty($loggedUser) && $loggedUser->getId() != $notification->getUserId()) {
array_push($removeUserIds, $loggedUser->getId());
}
}
}

Expand Down

0 comments on commit c047b92

Please sign in to comment.