summaryrefslogtreecommitdiff
path: root/modules/notification/helpers
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2010-02-21 13:08:06 -0800
committerAndy Staudacher <andy.st@gmail.com>2010-02-21 13:08:06 -0800
commitbe20309259de9310da3be703c93c4e42def2541b (patch)
tree38ecbb4fe4183e65af79cd9fbdfae3d99b8cd4d3 /modules/notification/helpers
parentcb57c3912aef6bed394a4693f94e9c97001aff34 (diff)
parent1377b2c7b3110a132d4b2d748be72a6aafa537e6 (diff)
Merge commit 'upstream/master'
Diffstat (limited to 'modules/notification/helpers')
-rw-r--r--modules/notification/helpers/notification_event.php36
1 files changed, 22 insertions, 14 deletions
diff --git a/modules/notification/helpers/notification_event.php b/modules/notification/helpers/notification_event.php
index c8628ae4..19e8dedb 100644
--- a/modules/notification/helpers/notification_event.php
+++ b/modules/notification/helpers/notification_event.php
@@ -128,23 +128,31 @@ class notification_event_Core {
}
static function show_user_profile($data) {
- if ($data->display_all) {
- $view = new View("user_profile_notification.html");
- $view->subscriptions = array();
- foreach(ORM::factory("subscription")
- ->where("user_id", "=", $data->user->id)
- ->find_all() as $subscription) {
- $item = ORM::factory("item")
+ // Guests don't see comment listings
+ if (identity::active_user()->guest) {
+ return;
+ }
+
+ // Only logged in users can see their comment listings
+ if (identity::active_user()->id != $data->user->id) {
+ return;
+ }
+
+ $view = new View("user_profile_notification.html");
+ $view->subscriptions = array();
+ foreach(ORM::factory("subscription")
+ ->where("user_id", "=", $data->user->id)
+ ->find_all() as $subscription) {
+ $item = ORM::factory("item")
->where("id", "=", $subscription->item_id)
->find();
- if ($item->loaded()) {
- $view->subscriptions[] = (object)array("id" => $subscription->id, "title" => $item->title,
- "url" => $item->url());
- }
- }
- if (count($view->subscriptions) > 0) {
- $data->content[] = (object)array("title" => t("Watching"), "view" => $view);
+ if ($item->loaded()) {
+ $view->subscriptions[] = (object)array("id" => $subscription->id, "title" => $item->title,
+ "url" => $item->url());
}
}
+ if (count($view->subscriptions) > 0) {
+ $data->content[] = (object)array("title" => t("Watching"), "view" => $view);
+ }
}
} \ No newline at end of file