Mod Title: Admin Uploads Only
Date released: 13.03.11
Description: Users cannot upload any files to the file hoster and only the admin is allowed to. This mod is very handy for people who want to use DFH as a download manager for their users.
Versions Supported: v1.0, v1.1
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Follow these steps:
1) Open upload.php
2) Find
- Code: Select all
require_once("./config.php");
3) Add after it
- Code: Select all
session_start();
if(isset($_SESSION['logged_in']) && $_SESSION['logged_in']==md5(md5($adminpass))) {
4) Go to the end of ./upload.php and add after the line
- Code: Select all
</td></tr></table></center>
- Code: Select all
<?php
} else {
echo "Sorry, but you need to be an admin to upload files on our website.";
}
?>
5) Go into upload.php and find
- Code: Select all
if(isset($_SESSION['logged_in']) && $_SESSION['logged_in']==md5(md5($adminpass))) {
6) Add above that piece of code
- Code: Select all
$_SESSION['logged_in'] = $_POST['check'];
7) Go into ./styles/Indigo/file_upload_form.php and add this code on the very first line.
- Code: Select all
<?php
session_start();
?>
8) After that, find
- Code: Select all
swfu.addPostParam("pprotect", $("input#pprotect").val());
- Code: Select all
swfu.addPostParam("check", $("input#check").val());
9) Now find
- Code: Select all
<tr><td align=center colspan=2><?php if(isset($categorylist)) { echo $categorylist; } ?></td></tr></table>
- Code: Select all
<input type="hidden" name="check" value = "<?php echo $_SESSION['logged_in'];?>" id ="check" size="40" />
P.S.: I advise you to add the below code in file_upload_form.php to inform you whether you are logged in as Admin or not to avoid uploading a large file just to get an error back saying you must be an admin to upload files. If you are already logged in as Admin and a message was not displayed, refresh the page to update the session ID on the javascript flash progress bar. In other words, do not upload any files unless you see the message "You are logged in as Admin".
1) Find
- Code: Select all
<h1><center><? echo $lang[upload];?></center></h1>
- Code: Select all
<?php
if(isset($_SESSION['logged_in'])) {
?>
<h1><center><font color="#FF0000">You are logged in as Admin</font></center></h1>
<?php
}
?>