Fileman is, in techical terms, a big ol' hack. More precisely, it's a proxy for the Cpanel File Manager. It allows resellers the ability to offer the functionality of the Cpanel File Manager without having to give complete access to the full Cpanel. It expects certain aspects of the Cpanel File Manager to act a certain way, and if those aspects change, well.... This distribution consists of 3 files: README.txt - this file fileman.php - the main processing file index.html - the "layout" file (An .htaccess file will also be needed) ********** WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! THIS APPLICATION PROVIDES FULL ACCESS TO THE FILE SYSTEM OF THE WEBSITE WHICH IT ACCESSES. PLEASE MAKE SURE THIS APPLICATION IS PASSWORD PROTECTED OR OTHERWISE SECURED! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! ********** LICENSE ******* BY USING THIS SOFTWARE, THE USER AGREES TO THIS LICENSE. THE AUTHOR CLAIMS OR OFFERS NO RESPONSIBILITY, LIABILITY OR WARRANTY FOR ANY LOSS, DAMAGE OR OTHER PAIN THAT MAY OCCUR FROM THE USE OF THIS SOFTWARE. THIS SOFTWARE'S USEFULNESS AND MAINTENANCE ARE NOT THE RESPONSIBILITY OF THE AUTHOR. REQUESTS FOR UPDATES, UPGRADES, FIXES AND/OR ADVICE MAY OR MAY NOT BE ANSWERED. ANY FUTURE CHANGES TO CPANEL __MAY__ RENDER THIS SOFTWARE USELESS. THIS SOFTWARE IS FREE (AS IN NO MONEY REQUIRED FOR ITS USE), AND UNDER NO OTHER LICENSE. USERS ARE FREE TO MODIFY THIS SOFTWARE. USERS ARE NOT ALLOWED TO SELL, RESELL OR REDISTRIBUTE THIS SOFTWARE, IN WHOLE OR IN PART, EITHER BY ITSELF OR AS PART OF ANOTHER PIECE OF SOFTWARE, WITHOUT THE AUTHOR'S PERMISSION. ALL RESPECTIVE COPYRIGHTS ARE THE SOLE POSSESSION OF THEIR OWNER. Cpanel is Copyright (c) 1997-2004 John N Koston. ********** INSTALLATION ************ The quick explanation: --------------------- 1. Create a directory 2. Password protect the directory 3. Add the following line to the .htaccess file in that directory: ErrorDocument 404 /webpath/to/fileman/fileman.php 4. Edit the configuration settings in fileman.php 5. Edit index.html to taste. 6. Upload index.html and fileman.php to this new "fileman" directory The long explanation: -------------------- 1. Create a directory under the web root somewhere. Theoretically, you can call this directory whatever you wish, and it should work, but it's not been tested as anything other than "fileman". EXAMPLE: /home/username/public_html/fileman (all future references to this new directory in this documentation will be referred to as "fileman") 2. Password protect this new "fileman" directory. This can be done in Cpanel. Using this method, an .htaccess file will be automatically created and placed in the "fileman" directory. NOTE: You do not have to use the same user/pass combo you use to log in to Cpanel. In fact, it's encouraged that you use a different user/pass combo. Your users will never need to know the user/pass of Cpanel. Even if you don't password protect this directory (you fool!), you'll need to create an .htaccess file in this directory for the next step. 3. Open up the .htaccess file in a text editor. Depending on the settings of your ftp client, it may not be visible. Assuming you created the "fileman" directory under the "public_html" directory, add the following line to the bottom of the .htaccess file: ErrorDocument 404 /fileman/fileman.php The path in the above line (the part after "404") needs to be an absolute path from the WEB ROOT to the fileman.php file. 4. Edit the configuration settings in fileman.php as appropriate. The editable settings are constants and are as follows: DEFINE('CP_USERNAME', 'username'); - The username used to log into the domain's Cpanel DEFINE('CP_PASSWORD', 'password'); - The password used to log into the domain's Cpanel DEFINE('CP_THEME', 'vertex'); - The name of the Cpanel theme the domain uses. Only "vertex" has been tested. YMMV. DEFINE('CP_DOMAIN', $_SERVER['HTTP_HOST']); - This is the domain name where the Cpanel File Manager you wish to access resides. In nearly all cases, it will be the current domain. It shouldn't need to be changed, but if it is, it should be something like 'www.example.com'. NOTE: This script *could* be used remotely, by that I mean it could be installed on one domain, and access the Cpanel file Manager of another domain. To do this, set the CP_DOMAIN to the remote domain you wish to access, the DOC_ROOT to some file path on the remote domain, and try it out. It just might work. DEFINE('DOC_ROOT', $_SERVER['DOCUMENT_ROOT']); - This is the path to the directory you wish to be the default for the File Manager listing. Shouldn't need to be changed, but if it is, set it to a full path to some directory, like '/home/user/public_html/somedir'. NOTE: Setting this to some directory lower in the file tree WON'T and DOESN'T prevent the user from accessing directories above this "root" directory. DEFINE('HIDE_ME', TRUE); - Boolean TRUE/FALSE value of whether you want the "fileman" directory to be hidden from the user. A best attempt is made at not allowing access to this directory or files. DEFINE('DYNAMIC_IMAGES', TRUE); - This script will load the images by proxy, i.e. fileman.php is called for each tag and fileman.php sends the correct image to the browser. This is not the way the web is designed to work. So, if you wish to improve performance and lower bandwidth, you can set this constant to FALSE, create an "images" (must be named "images") directory under the "fileman" directory, and copy all of the File Manager's image files to this "images" directory. You will get all the benefits of cached, static files. 5. You may have to/want to edit the layout of index.html. Currently it looks good in my Firefox, not so good in my IE. I could not get the proxying to work with the original Cpanel layout of the File Manager which uses frames. Iframes, however, did work, and I went with that. The page is layed out simply using CSS absolute positioning. As long as you keep the Iframes and their attributes, you can layout the index page anyway you wish. Your mileage may vary. 6. Upload index.html and fileman.php to the "fileman" directory. USAGE ***** 1. Log in. 2. Use exactly like the Cpanel File Manager, i.e. just start clicking until something happens. Thanks, dv at josheli dot com http://www.josheli.com