Show message if not authorized to download
Posted: Sat Nov 04, 2006 7:29 pm
If a user is not authorized to download a file they don't see anything. This changes that:
Code: Select all
#
#----[ OPEN ] ----
#
attach_mod/dislpaying.php
#
#----[ FIND ] ----
#
// Display Notice (attachment there but not having permissions to view it)
// Not included because this would mean template and language file changes (at this stage this is not a wise step. ;))
#
#----[ REPLACE WITH ] ----
#
$template->assign_block_vars('postrow.noaccess', array());
#
#-----[ FIND ]------------------------------------------
#
function display_post_attachments($post_id, $switch_attachment)
{
global $attach_config, $is_auth;
#
#-----[ REPLACE WITH ]------------------------------------------
#
function display_post_attachments($post_id, $switch_attachment)
{
global $attach_config, $is_auth, $template;
#
#----[ FIND ] ----
#
if (intval($switch_attachment) == 0 || intval($attach_config['disable_mod']) || (!($is_auth['auth_download'] && $is_auth['auth_view'])))
#
#----[ REPLACE WITH ] ----
#
if (intval($switch_attachment) == 0 || intval($attach_config['disable_mod']))// || (!($is_auth['auth_download'] && $is_auth['auth_view'])))
#
#----[ OPEN ] ----
#
templeates/subsilver/viewtopic_attach_body.tpl
#
#----[ FIND ] ----
#
</style>
#
#----[ AFTER, ADD ] ----
#
<!-- BEGIN noaccess -->
<div align="center"><hr width="95%" /></div>
<table width="95%" border="1" cellpadding="2" cellspacing="0" class="attachtable" align="center">
<tr><td width="100%" class="attachheader" align="center"><b><span class="gen">You are not allowed to view downloads!!!</span></b></td></tr>
<tr><td width="100%" class="attachheader" align="center"><b><span class="gen">Please register or request access to attachments</span></b></td></tr>
</table>
<div align="center"><hr width="95%" /></div>
<!-- END noaccess -->