1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00
php-e107/request.php

50 lines
1.1 KiB
PHP
Raw Normal View History

2006-12-02 04:36:16 +00:00
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| Copyright (C) 2008-2013 e107 Inc
2006-12-02 04:36:16 +00:00
| http://e107.org
2009-07-14 05:31:57 +00:00
|
2006-12-02 04:36:16 +00:00
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| Generic File Request Script.
2006-12-02 04:36:16 +00:00
|
+----------------------------------------------------------------------------+
*/
2008-12-30 16:51:07 +00:00
2006-12-02 04:36:16 +00:00
require_once("class2.php");
2008-12-30 16:51:07 +00:00
if (!e_QUERY || isset($_POST['userlogin']))
{
2006-12-02 04:36:16 +00:00
header("location: {$e107->base_path}");
exit();
}
// Media-Manager direct file download.
2006-12-02 04:36:16 +00:00
if(vartrue($_GET['file']) && is_numeric($_GET['file'])) // eg. request.php?file=1
2006-12-02 04:36:16 +00:00
{
$sql = e107::getDb();
if ($sql->select('core_media', 'media_url', "media_id= ".intval($_GET['file'])." AND media_userclass IN (".USERCLASS_LIST.") LIMIT 1 "))
2008-07-04 20:23:13 +00:00
{
$row = $sql->fetch();
// $file = $tp->replaceConstants($row['media_url'],'rel');
e107::getFile()->send($row['media_url']);
}
2006-12-02 04:36:16 +00:00
}
else //BC Legacy Support. (Downloads Plugin)
2008-12-30 16:51:07 +00:00
{
e107::getRedirect()->redirect(e_PLUGIN."download/request.php?".e_QUERY);
2006-12-02 04:36:16 +00:00
}
exit();
2008-12-30 16:51:07 +00:00
2006-12-02 04:36:16 +00:00
?>