From ab0bef14be78701aedd647dd4eaccab641b6d01d Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 6 Jun 2010 21:08:10 -0700 Subject: Try to adjust for situations where /proc/loadavg is_readable() but generates an error if we call file() on it. Fixes ticket #1149. --- modules/gallery/helpers/gallery_block.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/gallery/helpers') diff --git a/modules/gallery/helpers/gallery_block.php b/modules/gallery/helpers/gallery_block.php index 08ce21b7..cb28cbcd 100644 --- a/modules/gallery/helpers/gallery_block.php +++ b/modules/gallery/helpers/gallery_block.php @@ -70,9 +70,9 @@ class gallery_block_Core { $block->css_id = "g-platform"; $block->title = t("Platform information"); $block->content = new View("admin_block_platform.html"); - if (@is_readable("/proc/loadavg")) { + if (@is_readable("/proc/loadavg") && $first_line = current(@file("/proc/loadavg"))) { $block->content->load_average = - join(" ", array_slice(explode(" ", current(file("/proc/loadavg"))), 0, 3)); + join(" ", array_slice(explode(" ", $first_line), 0, 3)); } else { $block->content->load_average = t("Unavailable"); } -- cgit v1.2.3 From 1d91e1b2dc8456681f9e38baaca1d191cff1ac7a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 6 Jun 2010 23:19:02 -0700 Subject: Don't show the rotate links if the active user can't edit the photo. Fixes ticket #1157. Thanks to psvo. --- modules/gallery/helpers/gallery_event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery/helpers') diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 89ad6a4c..ae7131ae 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -242,7 +242,7 @@ class gallery_event_Core { $csrf = access::csrf_token(); $theme_item = $theme->item(); $page_type = $theme->page_type(); - if ($item->is_photo() && graphics::can("rotate")) { + if ($can_edit && $item->is_photo() && graphics::can("rotate")) { $options_menu ->append( Menu::factory("ajax_link") -- cgit v1.2.3