TinyPortal
Development => Support => Topic started by: kripz on April 08, 2008, 12:13:08 PM
A download item has been removed but users are still using the link to try download the file.
My log is being flooded with many entries of "You are not allowed to access this section.".
Users are also thinking "Why can i access this section?" when in reality the file has been deleted.
How can i change the error message for this situation while keeping the error for when users really dont have access?
PS: using .98
EDIT:
Do i edit this?
function TPdownload()
{
global $txt, $scripturl, $db_prefix, $modSettings, $context, $settings , $boarddir;
$tp_prefix=$settings['tp_prefix'];
$item = $context['TPortal']['dlitem'];
$request = db_query("SELECT * FROM {$tp_prefix}dlmanager WHERE id=$item LIMIT 1", __FILE__, __LINE__);
if(mysql_num_rows($request)>0){
$row = mysql_fetch_assoc($request);
$myfilename=$row['name'];
$newname=TPDlgetname($row['file']);
$real_filename=$row['file'];
$cat=$row['category'];
$request2 = db_query("SELECT * FROM {$tp_prefix}dlmanager WHERE id=$cat", __FILE__, __LINE__);
if(mysql_num_rows($request2)>0){
$row2 = mysql_fetch_assoc($request2);
$show = get_perm($row2['access']);
mysql_free_result($request2);
}
else{
$show=false;
}
$filename= $boarddir.'/tp-downloads/'.$real_filename;
mysql_free_result($request);
}
else
$show=false;
// can we actually download?
if($show==1){
// removed to reduce size
}
else
fatal_error($txt['tp-notallowed']);
exit();
}
Do i change the fatal_error($txt['tp-notallowed']) to fatal_error("Download Removed", false)?
Is there any reason you wouldn't try that out to see if it works?
Because although it may work, it might remove the "You are not allowed to access this section." for users who dont have permission.
Then put both messages in there. This item is missing, or you are not allowed.