TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 22, 2024, 09:04:51 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,197
  • Total Topics: 21,221
  • Online today: 226
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 77
  • Total: 77

You are not allowed to access this section.

Started by kripz, April 08, 2008, 12:13:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kripz

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)?

IchBin

Is there any reason you wouldn't try that out to see if it works?

kripz

Because although it may work, it might remove the "You are not allowed to access this section." for users who dont have permission.

IchBin

Then put both messages in there. This item is missing, or you are not allowed.