1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-29 10:38:08 +01:00

Block file downloads when disabled

This commit is contained in:
e107steved 2008-07-04 20:23:13 +00:00
parent 026486683a
commit 07522db6ff
2 changed files with 19 additions and 7 deletions

View File

@ -4,8 +4,8 @@
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_download.php,v $
| $Revision: 1.2 $
| $Date: 2007-02-03 14:21:30 $
| $Revision: 1.3 $
| $Date: 2008-07-04 20:23:12 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@ -96,6 +96,8 @@ define("LAN_dl_74", "Total downloads from this mirror: ");
define("LAN_dl_75", "no image available ");
define("LAN_dl_76", "Go to page");
define("LAN_dl_77", "Downloads"); // Intentional duplicate - some languages need it to be different. This is for number of townloads
define("LAN_dl_77", "Downloads"); // Intentional duplicate - some languages need it to be different. This is for number of downloads
define('LAN_dl_78', 'That download has been disabled or discontinued. Please check in the --LINK--downloads</a> area for a more recent version.');
?>

View File

@ -12,8 +12,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/request.php,v $
| $Revision: 1.4 $
| $Date: 2007-10-28 22:19:16 $
| $Revision: 1.5 $
| $Date: 2008-07-04 20:23:13 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@ -112,9 +112,19 @@ if (preg_match("#.*\.[a-z,A-Z]{3,4}#", e_QUERY)) {
if ($type == "file")
{
$qry = "SELECT d.*, dc.download_category_class FROM #download as d LEFT JOIN #download_category AS dc ON dc.download_category_id = d.download_category WHERE d.download_id = {$id}";
if ($sql->db_Select_gen($qry)) {
if ($sql->db_Select_gen($qry))
{
$row = $sql->db_Fetch();
if (check_class($row['download_category_class']) && check_class($row['download_class'])) {
if (check_class($row['download_category_class']) && check_class($row['download_class']))
{
if ($row['download_active'] == 0)
{ // Inactive download - don't allow
require_once(HEADERF);
$ns -> tablerender(LAN_dl_61, "<div style='text-align:center'>".str_replace('--LINK--',"<a href='".e_HTTP.'download.php'."'>",LAN_dl_78).'</div>');
require_once(FOOTERF);
exit();
}
if($pref['download_limits'] && $row['download_active'] == 1) {
check_download_limits();
}