Subversion Repositories xrowsecuredfiles

[/] [trunk/] [extension/] [xrowsecuredfiles/] [modules/] [files/] [view.php] - Diff between revs 1 and 3

Show entire file | Ignore whitespace | Details | Blame | View Log

Rev 1 Rev 3
Line 8... Line 8...
        return $Module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
        return $Module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
}
}
 
 
$user = eZUser::currentUser();
$user = eZUser::currentUser();
$access =  $user->hasAccessTo( 'files', 'read' );
$access =  $user->hasAccessTo( 'files', 'read' );
 
 
 
 
 
 
if ( $access['accessWord'] == 'no' )
if ( $access['accessWord'] == 'no' )
{
{
        return $Module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
        return $Module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
}
}
Line 44... Line 42...
$url = new ezcUrl( $fullurl, $urlCfg );
$url = new ezcUrl( $fullurl, $urlCfg );
 
 
# extract "files/view"
# extract "files/view"
$url->params = array_slice( $url->getParams(), 3 );
$url->params = array_slice( $url->getParams(), 3 );
 
 
$query = $url->getQuery();
$url->setQuery( array() );
 
 
$uri = $url->buildUrl();
$uri = $url->buildUrl();
 
 
if ( empty( $uri ) or $uri == '/' )
if ( empty( $uri ) or $uri == '/' )
{
{
        return $Module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
        return $Module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
}
}
 
 
$file = xrowSecuredFilesTool::directory() . '/' . $directory . '/'  .  $uri;
//@TODO fix for siteaccess prepended urls
eZClusterFileHandler::instance();
$file = xrowSecuredFilesTool::directory() . '/' . $directory  .  $uri;
 
 
//End with file download
//End with file download
eZFile::download($file, false );
eZFile::download($file, false );
 
 
//Else return 404
//Else return 404