diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-04 11:42:37 -0800 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-04 11:42:37 -0800 |
| commit | 8ca69cffbba70fe22e19478f742a37bdbd758d83 (patch) | |
| tree | 712a69eef7d134d7ad2ea2668d30fda44914beff /modules/gallery/controllers/photos.php | |
| parent | 5743b159c28888f2165cc4269d3302fea24fde7a (diff) | |
| parent | 5c107be9033ae48f781c8430702458f613e791ee (diff) | |
Merge branch 'master' into talmdal_dev
Diffstat (limited to 'modules/gallery/controllers/photos.php')
| -rw-r--r-- | modules/gallery/controllers/photos.php | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php index 0c2ff6ee..ba4cfb83 100644 --- a/modules/gallery/controllers/photos.php +++ b/modules/gallery/controllers/photos.php @@ -18,11 +18,12 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class Photos_Controller extends Items_Controller { - - /** - * @see REST_Controller::_show($resource) - */ - public function _show($photo) { + public function show($photo) { + if (!is_object($photo)) { + // show() must be public because we route to it in url::parse_url(), so make + // sure that we're actually receiving an object + Kohana::show_404(); + } access::required("view", $photo); $where = array("type != " => "album"); @@ -53,12 +54,9 @@ class Photos_Controller extends Items_Controller { print $template; } - - /** - * @see REST_Controller::_update($resource) - */ - public function _update($photo) { + public function update($photo_id) { access::verify_csrf(); + $photo = ORM::factory("item", $photo_id); access::required("view", $photo); access::required("edit", $photo); @@ -125,10 +123,8 @@ class Photos_Controller extends Items_Controller { } } - /** - * @see REST_Controller::_form_edit($resource) - */ - public function _form_edit($photo) { + public function form_edit($photo_id) { + $photo = ORM::factory("item", $photo_id); access::required("view", $photo); access::required("edit", $photo); |
