Free Web Hosting Forum
(#1 (permalink))
Old
Junior Member
bluephoenix is on a distinguished road
 
Posts: 5
Join Date: Dec 2009
Post eXtplorer - 06-16-2010, 04:07 PM

I need a way to work around the realpath() functions in this file, as I am recieving open_basedir restriction errors. Can anyone help me, what should I replace in here (my website is http://www.mark.vacau.com and the subdomain of eXtplorer is located at http://www.mark.vacau.com/extplorer")

PHP Code:
// the filename of the eXtplorer script: (you rarely need to change this)
if($_SERVER['SERVER_PORT'] == 443 ) {
    
$GLOBALS["script_name"] = "https://".$GLOBALS['__SERVER']['HTTP_HOST'].$GLOBALS['__SERVER']["PHP_SELF"];
    
$GLOBALS['home_url'] = "https://".$GLOBALS['__SERVER']['HTTP_HOST'].dirname($GLOBALS['__SERVER']["PHP_SELF"]);
}
else {
    
$GLOBALS["script_name"] = "http://".$GLOBALS['__SERVER']['HTTP_HOST'].$GLOBALS['__SERVER']["PHP_SELF"];
    
$GLOBALS['home_url'] = "http://".$GLOBALS['__SERVER']['HTTP_HOST'].dirname($GLOBALS['__SERVER']["PHP_SELF"]);
}
$GLOBALS['home_url'] = str_replace'/administrator'''$GLOBALS['home_url'] );
$GLOBALS['home_dir'] = !empty( $_SERVER['DOCUMENT_ROOT'] ) ? $_SERVER['DOCUMENT_ROOT'] : '.';

// Important Definitions!
define "_EXT_PATH"realpath(dirname__FILE__ ).'/..') );
define "_EXT_FTPTMP_PATH"realpathdirname__FILE__ ).'/../ftp_tmp') );
if( 
function_exists'mosGetParam') || class_exists'jconfig')) {
    
define "_EXT_URL"$GLOBALS['home_url']."/administrator/components/com_extplorer" );
} else {
    
define "_EXT_URL"dirname($GLOBALS['script_name']) );

The realpath functions are in the "Important Definitions" section

Thanks in advance
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
Senior Member
Jasper is on a distinguished road
 
Posts: 165
Join Date: Jun 2010
Default 06-16-2010, 05:48 PM

How about changing it like this?

// Important Definitions!
PHP Code:
define "_EXT_PATH"realpath(dirname__FILE__ ).'/extdir') );
define "_EXT_FTPTMP_PATH"realpathdirname__FILE__ ).'/extdir/ftp_tmp') );
if( 
function_exists'mosGetParam') || class_exists'jconfig')) {
    
define "_EXT_URL"$GLOBALS['home_url']."/administrator/components/com_extplorer" );
} else {
    
define "_EXT_URL"dirname($GLOBALS['script_name']) );

(note: this may not hold the functionality you are looking for, but if so you need to be clearer about what you want to achieve)
Reply With Quote
(#3 (permalink))
Old
Junior Member
bluephoenix is on a distinguished road
 
Posts: 5
Join Date: Dec 2009
Default 06-16-2010, 06:23 PM

I want to eliminate the realpath() function, as it is restricted by php

thanks
Reply With Quote
(#4 (permalink))
Old
Senior Member
Jasper is on a distinguished road
 
Posts: 165
Join Date: Jun 2010
Default 06-16-2010, 06:45 PM

It's not. It's just not allowed to go outside the space of your account (and they would be crazy to let). At least, that's what the error you are explaining would point at. I can actually use realpath just fine even when going to /home. So perhaps your problem is in another place...

Oh and let me rephrase the question of what you want to do. You are installing extplorer and find that with the current configuration it doesn't work. You want us to provide a better configuration. In order to do so we need to know what you want to use extplorer for - if you want to use it to manage files outside your account, it's not going to be able. If you want to manage files in public_html that's a completely different story from when you want an isolated environment for extplorer. Hell, you can even use extplorer to manage parts of your database if you want to! (to add even more confusion, you can then again use SQLite and store your database as a file on your account).
Reply With Quote
(#5 (permalink))
Old
Junior Member
bluephoenix is on a distinguished road
 
Posts: 5
Join Date: Dec 2009
Default 06-16-2010, 06:51 PM

Haha, no im not trying to access files outside my account it is actually for changing files on my server when I do not have access to an ftp client. I have found that online ftp clients are not easy to use at all, compared with eXtplorer.

I wasnt entirely sure how the protection worked, but thanks for clearing that up. I ended up going through a couple of the main files replacing

PHP Code:
realpath($GLOBALS['home_url']); 
and similar with

PHP Code:
"/home/a1230698/public_html/"
in addition to using the changed code you provided
and it now works and doesn't spam me with errors

I also didn't know you could manage databases with it thats awesome

Last edited by bluephoenix; 06-16-2010 at 06:54 PM.
Reply With Quote
(#6 (permalink))
Old
Senior Member
Jasper is on a distinguished road
 
Posts: 165
Join Date: Jun 2010
Default 06-16-2010, 07:24 PM

I was just kidding with the databases (in php you can make "file access layer" that behaves like any other file access but just does whatever you made it to do, which could be changing your database, thus you could use extplorer to access your database). It can be done, but there is absolutely no advantage to doing it.

Good that you got it working - your solution is a good one, though I would personally have looked for a way to get it working with realpath, because it seems that realpath should work, but that realpath is used in such a way that does not work.

The changed code I provided did not do what you wanted, it was meant to give extplorer access to only a subfolder of the directory that file is in. So do please change that as well, or strange things might happen.

You do realise there are two different file manager application you can reach from your control panel? I am not entirely sure, but using extplorer might get you into trouble with your permissions.
Reply With Quote
(#7 (permalink))
Old
Junior Member
bluephoenix is on a distinguished road
 
Posts: 5
Join Date: Dec 2009
Default 06-16-2010, 07:30 PM

orr darn xD

ill have a go at getting it to work later with realpath, and so far it has worked with it in file mode, but if it does wreak havoc with permissions, I will switch it to ftp mode
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com