summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/user_profile.php
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-02-27 14:03:01 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-02-27 14:03:01 +0000
commita58aa6e97b0e44adf7a878db6e276b081e202192 (patch)
treececc68b1222cb283a021478b822952c468d64393 /modules/gallery/controllers/user_profile.php
parent10e36fcf1b5acf07c5cc128105af03fb09aac89e (diff)
parentd9707ae749df2770370dc4eeeeaddda28f092d4d (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/controllers/user_profile.php')
-rw-r--r--modules/gallery/controllers/user_profile.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/modules/gallery/controllers/user_profile.php b/modules/gallery/controllers/user_profile.php
index 327d2ff1..b89bc358 100644
--- a/modules/gallery/controllers/user_profile.php
+++ b/modules/gallery/controllers/user_profile.php
@@ -21,20 +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;
- $display_all = $active_user->admin || ($is_current_active && !$active_user->guest);
+ 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() && $display_all;
+ $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;