summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/user_profile.php
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/gallery/controllers/user_profile.php
parentcb57c3912aef6bed394a4693f94e9c97001aff34 (diff)
parent1377b2c7b3110a132d4b2d748be72a6aafa537e6 (diff)
Merge commit 'upstream/master'
Diffstat (limited to 'modules/gallery/controllers/user_profile.php')
-rw-r--r--modules/gallery/controllers/user_profile.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/gallery/controllers/user_profile.php b/modules/gallery/controllers/user_profile.php
index 05373466..b89bc358 100644
--- a/modules/gallery/controllers/user_profile.php
+++ b/modules/gallery/controllers/user_profile.php
@@ -21,21 +21,21 @@ class User_Profile_Controller extends Controller {
public function show($id) {
// If we get here, then we should have a user id other than guest.
$user = identity::lookup_user($id);
- $active_user = identity::active_user();
- $is_current_active = $active_user->id == $id;
- $can_edit = $is_current_active && !$active_user->guest;
- $display_all = $active_user->admin || $can_edit;
+ if (!$user) {
+ throw new Kohana_404_Exception();
+ }
$v = new Theme_View("page.html", "other", "profile");
$v->page_title = t("%name Profile", array("name" => $user->display_name()));
$v->content = new View("user_profile.html");
- // @todo modify user_home to supply a link to their album,
$v->content->user = $user;
- $v->content->not_current = !$is_current_active;
- $v->content->editable = identity::is_writable() && $can_edit;
+ $v->content->contactable =
+ !$user->guest && $user->id != identity::active_user()->id && $user->email;
+ $v->content->editable =
+ identity::is_writable() && !$user->guest && $user->id == identity::active_user()->id;
- $event_data = (object)array("user" => $user, "display_all" => $display_all, "content" => array());
+ $event_data = (object)array("user" => $user, "content" => array());
module::event("show_user_profile", $event_data);
$v->content->info_parts = $event_data->content;