General > Support

open_basedir restriction in effect

<< < (2/3) > >>

maitane:
I read that the problem is in the file common.php in libs directory. It says:

--- Code: ---// Prevent Mibew from access to files outside the installation
@ini_set('open_basedir', dirname(__FILE__) . '/../');
--- End code ---

Could someone tell me what I have to do to change or disable this restriction? Why is it there, which is his function?

faf:
Uh-oh...  :-\

First of all, the recipe you've used is almost two years old (not to mention that it's a little bit weird). In modern stable Mibew Messenger 1.6.7 there were fixed a lot of security issues.

open_basedir restriction has been adopted to make sure that even if someone will compromise a Mibew installation, it will be impossible  from a compromised code to access any file that is not a part of the application: http://www.php.net/manual/en/ini.core.php#ini.open-basedir

So, the cause of your problem is that you're including a part of Mibew into your code and by doing so activating that open_basedir restriction. And then you're trying to access the file that is not a part of Mibew and by doing so getting an exception.

There could be several ways to solve your trouble. The most simple one is to remove @ini_set('open_basedir',... string from the libs/common.php. Though, I'd not recommend you do do so due to both security reasons and the fact that you'll have to repeat this operation after each upgrade of Mibew Messenger.

Other ways will require some programming skills. For example, one could hide the button if the filename in the src attribute of the image is ended with the postfix '_off', or create a custom button generation code.

maitane:
Thanks for your response. Sorry about my ignorance and my limited "programming skils", but...:


--- Quote ---one could hide the button if the filename in the src attribute of the image is ended with the postfix '_off'
--- End quote ---

If I'm not wrong, it would require to modify the b.php file which is who makes the image src:

--- Code: ---$image_postfix = has_online_operators($groupid) ? "on" : "off";
$filename = dirname(__FILE__) . "/locales/${lang}/button/${image}_${image_postfix}.gif";
--- End code ---

So I could make that if image_postfix is _off, like you said, the filename to be empty. But, in this case, it would appear the "image not found" icon when the web loads. Any idea about how could I solve this?



faf:

--- Quote from: maitane on October 25, 2013, 05:51:17 PM ---
--- Quote ---one could hide the button if the filename in the src attribute of the image is ended with the postfix '_off'
--- End quote ---

If I'm not wrong, it would require to modify the b.php file

--- End quote ---

Sorry, but you're wrong. I've talked about client-side solution that could be implemented in JavaScript.

maitane:

--- Quote from: faf on October 25, 2013, 06:15:15 PM ---
--- Quote from: maitane on October 25, 2013, 05:51:17 PM ---
--- Quote ---one could hide the button if the filename in the src attribute of the image is ended with the postfix '_off'
--- End quote ---

If I'm not wrong, it would require to modify the b.php file

--- End quote ---

Sorry, but you're wrong. I've talked about client-side solution that could be implemented in JavaScript.

--- End quote ---

Oh, ok, thanks  :)

And what about not hide the image, put another link to the offline image instead?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version