Permalink
Browse files

Restore the user_profile.php change from reverted

4091219 that had this comment in the
change: "Also fixed a UI bug: No longer showing the edit user buttons
to admins in the profile view (to be consistent with the requirements
in the controller)."
  • Loading branch information...
1 parent 0d72daf commit 4c637530440860a90ac39fe04037ed8adfcbe17a @bharat bharat committed Feb 19, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 modules/gallery/controllers/user_profile.php
View
5 modules/gallery/controllers/user_profile.php
@@ -23,7 +23,8 @@ public function show($id) {
$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);
+ $can_edit = $is_current_active && !$active_user->guest;
+ $display_all = $active_user->admin || $can_edit;
$v = new Theme_View("page.html", "other", "profile");
$v->page_title = t("%name Profile", array("name" => $user->display_name()));
@@ -32,7 +33,7 @@ public function show($id) {
// @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->editable = identity::is_writable() && $can_edit;
$event_data = (object)array("user" => $user, "display_all" => $display_all, "content" => array());
module::event("show_user_profile", $event_data);

0 comments on commit 4c63753

Please sign in to comment.