]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #18 adds forwarding when no access
authorCash Costello <cash.costello@gmail.com>
Sat, 14 Jul 2012 15:59:19 +0000 (11:59 -0400)
committerCash Costello <cash.costello@gmail.com>
Sat, 14 Jul 2012 15:59:19 +0000 (11:59 -0400)
pages/photos/album/view.php
pages/photos/image/view.php

index cef3647eec90ea24dfd9bb80e5fd188623edb779..100cc44c6bb073d51f09dd3f4a9c30bf358019f3 100644 (file)
@@ -12,8 +12,9 @@ group_gatekeeper();
 $album_guid = (int) get_input('guid');
 $album = get_entity($album_guid);
 if (!$album) {
-       // @todo album deleted or don't have access
-       forward('photos/all');
+       register_error(elgg_echo('noaccess'));
+       $_SESSION['last_forward_from'] = current_page_url();
+       forward('');
 }
 
 elgg_set_page_owner_guid($album->getContainerGUID());
index 6bd0257e093ce82472b6fe3e8454fab7f8b7e520..1d359b6c7986b7af98ee9817a335ecee20538560 100644 (file)
@@ -12,7 +12,9 @@ group_gatekeeper();
 $photo_guid = (int) get_input('guid');
 $photo = get_entity($photo_guid);
 if (!$photo) {
-
+       register_error(elgg_echo('noaccess'));
+       $_SESSION['last_forward_from'] = current_page_url();
+       forward('');
 }
 
 $photo->addView();