From: <sy...@us...> - 2012-01-30 23:25:53
|
Revision: 39710 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39710&view=rev Author: sylvieg Date: 2012-01-30 23:25:46 +0000 (Mon, 30 Jan 2012) Log Message: ----------- [ENH]download: when clicking on a download link with no perm - remember the link so that after login you dowload the file Modified Paths: -------------- branches/8.x/tiki-download_file.php Modified: branches/8.x/tiki-download_file.php =================================================================== --- branches/8.x/tiki-download_file.php 2012-01-30 22:11:57 UTC (rev 39709) +++ branches/8.x/tiki-download_file.php 2012-01-30 23:25:46 UTC (rev 39710) @@ -124,11 +124,13 @@ // Check permissions except if the user comes with a valid Token if ( !$zip && $tiki_p_admin_file_galleries != 'y' && !$userlib->user_has_perm_on_object($user, $info['galleryId'], 'file gallery', 'tiki_p_download_files') && !($info['backlinkPerms'] == 'y' && !$filegallib->hasOnlyPrivateBacklinks($info['fileId']))) { + if (!$user) $_SESSION['loginfrom'] = $_SERVER['REQUEST_URI']; $access->display_error('', tra('Permission denied'), 401); } if ( isset($_GET['thumbnail']) && is_numeric($_GET['thumbnail'])) { //check also perms on thumb $info_thumb = $filegallib->get_file($_GET['thumbnail']); if ( !$zip && $tiki_p_admin_file_galleries != 'y' && !$userlib->user_has_perm_on_object($user, $info_thumb['galleryId'], 'file gallery', 'tiki_p_download_files') && !($info['backlinkPerms'] == 'y' && !$filegallib->hasOnlyPrivateBacklinks($info_thumb['fileId']))) { + if (!$user) $_SESSION['loginfrom'] = $_SERVER['REQUEST_URI']; $access->display_error('', tra('Permission denied'), 401); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |