From c0022dc3c35024ecfc101171bdccfc3b07227ebb Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 1 Oct 2010 21:17:08 -0700 Subject: Fix a bug in the way we set the mime type for protected image renders. Also whitelist the digibug controller so that it's accessible when the gallery is private, and don't expire old proxies right away since Digibug may request the full size multiple times for different preview operations. Fixes ticket #1410. --- modules/digibug/controllers/digibug.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'modules/digibug') diff --git a/modules/digibug/controllers/digibug.php b/modules/digibug/controllers/digibug.php index 3c2bb115..88d1ace0 100644 --- a/modules/digibug/controllers/digibug.php +++ b/modules/digibug/controllers/digibug.php @@ -95,16 +95,11 @@ class Digibug_Controller extends Controller { if (!TEST_MODE) { // Dump out the image - header("Content-Type: $proxy->item->mime_type"); + header("Content-Type: {$proxy->item->mime_type}"); Kohana::close_buffers(false); $fd = fopen($file, "rb"); fpassthru($fd); fclose($fd); - - // If the request was for the image and not the thumb, then delete the proxy. - if ($type == "full") { - $proxy->delete(); - } } $this->_clean_expired(); -- cgit v1.2.3 From dff1a536961cd401b8e133e260fcc3cca7c13dc6 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 25 Oct 2010 21:04:48 -0700 Subject: All modules should be named Xxx_Core for extensibility. Fixes #1458. --- modules/comment/models/comment.php | 2 +- modules/digibug/models/digibug_proxy.php | 2 +- modules/exif/models/exif_key.php | 2 +- modules/exif/models/exif_record.php | 2 +- modules/g2_import/models/g2_map.php | 2 +- modules/gallery/models/access_cache.php | 2 +- modules/gallery/models/access_intent.php | 2 +- modules/gallery/models/cache.php | 2 +- modules/gallery/models/failed_auth.php | 2 +- modules/gallery/models/graphics_rule.php | 2 +- modules/gallery/models/incoming_translation.php | 2 +- modules/gallery/models/log.php | 2 +- modules/gallery/models/message.php | 2 +- modules/gallery/models/module.php | 2 +- modules/gallery/models/outgoing_translation.php | 2 +- modules/gallery/models/permission.php | 2 +- modules/gallery/models/task.php | 2 +- modules/gallery/models/theme.php | 2 +- modules/gallery/models/var.php | 2 +- modules/notification/models/pending_notification.php | 2 +- modules/notification/models/subscription.php | 2 +- modules/rest/models/user_access_key.php | 2 +- modules/search/models/search_record.php | 2 +- modules/server_add/models/server_add_file.php | 2 +- modules/tag/models/tag.php | 2 +- modules/user/models/group.php | 2 +- modules/user/models/user.php | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) (limited to 'modules/digibug') diff --git a/modules/comment/models/comment.php b/modules/comment/models/comment.php index 772e8b60..8f860a7b 100644 --- a/modules/comment/models/comment.php +++ b/modules/comment/models/comment.php @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Comment_Model extends ORM { +class Comment_Model_Core extends ORM { function item() { return ORM::factory("item", $this->item_id); } diff --git a/modules/digibug/models/digibug_proxy.php b/modules/digibug/models/digibug_proxy.php index 0ce21649..2bff6ddb 100644 --- a/modules/digibug/models/digibug_proxy.php +++ b/modules/digibug/models/digibug_proxy.php @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Digibug_Proxy_Model extends ORM { +class Digibug_Proxy_Model_Core extends ORM { protected $belongs_to = array("item"); } diff --git a/modules/exif/models/exif_key.php b/modules/exif/models/exif_key.php index 3e9784ac..8ca63ada 100644 --- a/modules/exif/models/exif_key.php +++ b/modules/exif/models/exif_key.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Exif_Key_Model extends ORM { +class Exif_Key_Model_Core extends ORM { } diff --git a/modules/exif/models/exif_record.php b/modules/exif/models/exif_record.php index 8f87f6bc..03b8c982 100644 --- a/modules/exif/models/exif_record.php +++ b/modules/exif/models/exif_record.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Exif_Record_Model extends ORM { +class Exif_Record_Model_Core extends ORM { } diff --git a/modules/g2_import/models/g2_map.php b/modules/g2_import/models/g2_map.php index a20f48d6..8b96050d 100644 --- a/modules/g2_import/models/g2_map.php +++ b/modules/g2_import/models/g2_map.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class G2_Map_Model extends ORM { +class G2_Map_Model_Core extends ORM { } diff --git a/modules/gallery/models/access_cache.php b/modules/gallery/models/access_cache.php index af1b5c6c..e730f25c 100644 --- a/modules/gallery/models/access_cache.php +++ b/modules/gallery/models/access_cache.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Access_Cache_Model extends ORM { +class Access_Cache_Model_Core extends ORM { } diff --git a/modules/gallery/models/access_intent.php b/modules/gallery/models/access_intent.php index e71f8c46..31711014 100644 --- a/modules/gallery/models/access_intent.php +++ b/modules/gallery/models/access_intent.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Access_Intent_Model extends ORM { +class Access_Intent_Model_Core extends ORM { } diff --git a/modules/gallery/models/cache.php b/modules/gallery/models/cache.php index 4a7e37f6..1c464d51 100644 --- a/modules/gallery/models/cache.php +++ b/modules/gallery/models/cache.php @@ -17,4 +17,4 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Cache_Model extends ORM {} +class Cache_Model_Core extends ORM {} diff --git a/modules/gallery/models/failed_auth.php b/modules/gallery/models/failed_auth.php index a541f435..649e4bc9 100644 --- a/modules/gallery/models/failed_auth.php +++ b/modules/gallery/models/failed_auth.php @@ -17,4 +17,4 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Failed_Auth_Model extends ORM {} +class Failed_Auth_Model_Core extends ORM {} diff --git a/modules/gallery/models/graphics_rule.php b/modules/gallery/models/graphics_rule.php index 49036b9c..09410af0 100644 --- a/modules/gallery/models/graphics_rule.php +++ b/modules/gallery/models/graphics_rule.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Graphics_Rule_Model extends ORM { +class Graphics_Rule_Model_Core extends ORM { } diff --git a/modules/gallery/models/incoming_translation.php b/modules/gallery/models/incoming_translation.php index 45340c30..ff6a7160 100644 --- a/modules/gallery/models/incoming_translation.php +++ b/modules/gallery/models/incoming_translation.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Incoming_Translation_Model extends ORM { +class Incoming_Translation_Model_Core extends ORM { } diff --git a/modules/gallery/models/log.php b/modules/gallery/models/log.php index aa1a37ed..5d065313 100644 --- a/modules/gallery/models/log.php +++ b/modules/gallery/models/log.php @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Log_Model extends ORM { +class Log_Model_Core extends ORM { /** * @see ORM::__get() */ diff --git a/modules/gallery/models/message.php b/modules/gallery/models/message.php index 994d0cdb..3f84efd0 100644 --- a/modules/gallery/models/message.php +++ b/modules/gallery/models/message.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Message_Model extends ORM { +class Message_Model_Core extends ORM { } diff --git a/modules/gallery/models/module.php b/modules/gallery/models/module.php index dc181849..e54613d1 100644 --- a/modules/gallery/models/module.php +++ b/modules/gallery/models/module.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Module_Model extends ORM { +class Module_Model_Core extends ORM { } diff --git a/modules/gallery/models/outgoing_translation.php b/modules/gallery/models/outgoing_translation.php index 43f56dce..cd580bed 100644 --- a/modules/gallery/models/outgoing_translation.php +++ b/modules/gallery/models/outgoing_translation.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Outgoing_Translation_Model extends ORM { +class Outgoing_Translation_Model_Core extends ORM { } diff --git a/modules/gallery/models/permission.php b/modules/gallery/models/permission.php index b6b544d5..51bd95e7 100644 --- a/modules/gallery/models/permission.php +++ b/modules/gallery/models/permission.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Permission_Model extends ORM { +class Permission_Model_Core extends ORM { } diff --git a/modules/gallery/models/task.php b/modules/gallery/models/task.php index 4888a734..4d435101 100644 --- a/modules/gallery/models/task.php +++ b/modules/gallery/models/task.php @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Task_Model extends ORM { +class Task_Model_Core extends ORM { public function get($key, $default=null) { $context = unserialize($this->context); if (array_key_exists($key, $context)) { diff --git a/modules/gallery/models/theme.php b/modules/gallery/models/theme.php index 523542f9..50fd04fd 100644 --- a/modules/gallery/models/theme.php +++ b/modules/gallery/models/theme.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Theme_Model extends ORM { +class Theme_Model_Core extends ORM { } \ No newline at end of file diff --git a/modules/gallery/models/var.php b/modules/gallery/models/var.php index a79d0048..f21486ee 100644 --- a/modules/gallery/models/var.php +++ b/modules/gallery/models/var.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Var_Model extends ORM { +class Var_Model_Core extends ORM { } diff --git a/modules/notification/models/pending_notification.php b/modules/notification/models/pending_notification.php index c447620e..5857ce8c 100644 --- a/modules/notification/models/pending_notification.php +++ b/modules/notification/models/pending_notification.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Pending_Notification_Model extends ORM { +class Pending_Notification_Model_Core extends ORM { } \ No newline at end of file diff --git a/modules/notification/models/subscription.php b/modules/notification/models/subscription.php index 043de45c..273b6ad9 100644 --- a/modules/notification/models/subscription.php +++ b/modules/notification/models/subscription.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Subscription_Model extends ORM { +class Subscription_Model_Core extends ORM { } \ No newline at end of file diff --git a/modules/rest/models/user_access_key.php b/modules/rest/models/user_access_key.php index 1da0f5eb..93c3cf7f 100644 --- a/modules/rest/models/user_access_key.php +++ b/modules/rest/models/user_access_key.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class User_Access_Key_Model extends ORM { +class User_Access_Key_Model_Core extends ORM { } diff --git a/modules/search/models/search_record.php b/modules/search/models/search_record.php index fe9b758f..77290903 100644 --- a/modules/search/models/search_record.php +++ b/modules/search/models/search_record.php @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Search_Record_Model extends ORM { +class Search_Record_Model_Core extends ORM { function item() { return model_cache::get("item", $this->item_id); } diff --git a/modules/server_add/models/server_add_file.php b/modules/server_add/models/server_add_file.php index 83bde344..92b9f6de 100644 --- a/modules/server_add/models/server_add_file.php +++ b/modules/server_add/models/server_add_file.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Server_Add_File_Model extends ORM { +class Server_Add_File_Model_Core extends ORM { } diff --git a/modules/tag/models/tag.php b/modules/tag/models/tag.php index 269a0f39..d6ad4dfd 100644 --- a/modules/tag/models/tag.php +++ b/modules/tag/models/tag.php @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Tag_Model extends ORM { +class Tag_Model_Core extends ORM { protected $has_and_belongs_to_many = array("items"); /** diff --git a/modules/user/models/group.php b/modules/user/models/group.php index b27c7250..17d9320b 100644 --- a/modules/user/models/group.php +++ b/modules/user/models/group.php @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Group_Model extends ORM implements Group_Definition { +class Group_Model_Core extends ORM implements Group_Definition { protected $has_and_belongs_to_many = array("users"); /** diff --git a/modules/user/models/user.php b/modules/user/models/user.php index b28288be..55bb3d6a 100644 --- a/modules/user/models/user.php +++ b/modules/user/models/user.php @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class User_Model extends ORM implements User_Definition { +class User_Model_Core extends ORM implements User_Definition { protected $has_and_belongs_to_many = array("groups"); protected $password_length = null; -- cgit v1.2.3