You are not logged in.
Pages: 1
Hi all,
I have come across an issue where I need to allow members to upload, edit and delete photos, but they should only be able to see the images that they have uploaded, otherwise they would be able to see, edit and delete everyone's images.
To get around this, I am wondering if it is possible to dynamically set the root directory for the ExtendedFileManager and ImageManager when the page is loaded, so that it would become their personal folder?
For example, if the user had an id of 6, when they open up a page with the editor on, it will dynamically set the root dir to be www.domain.com/xinha/ExtendedFileManager/6/ or something like that. I see that it is not possible to view files beyond the specified root directory, so I think that if this is possible, it should be the solution to my problems. Obviously a folder called 6 would need to exist, but that is outside the scope of Xinha as that would be set up along with registration.
Appreciate any feedback on this.
Thanks
Patrick
Offline
If you are using PHP for your user management you have the freedom to set the image dir to whichever you like in the config.
see http://xinha.python-hosting.com/wiki/Pl … ileManager
Offline
Hi Ray,
Sorry for the delay getting back to you.. So this config stuff, I can put in the head tag?
Thanks
Patrick
Offline
If you are using PHP for your user management you have the freedom to set the image dir to whichever you like in the config.
see http://xinha.python-hosting.com/wiki/Pl … ileManager
Hi Ray,
I tried this, but it doesn't work.
How I must set
$IMConfig['images_dir'] = '<images dir>';
$IMConfig['images_url'] = '<images url>';
$IMConfig['files_dir'] = '<files dir>';
$IMConfig['files_url'] = '<files url>';
when xinha dir is in root of my web and dir for files and images is the same in web root named FILES?
absolut path to FILES is c:\apache\htdocs\tree\FILES, web is http://localhost/tree
thanks a lot
Bunak
Offline
Well, that sort of worked... I get a rich text editor appear and I can click on the image button, but when I do that, the image window pops up and i get the following error:
Warning: dir(/home/.../public/www/images/uploads/member_1) [function.dir]: failed to open dir: No such file or directory in /home/.../public/www/xinha/plugins/ImageManager/Classes/Files.php on line 223
Fatal error: Call to a member function read() on a non-object in /home/.../public/www/xinha/plugins/ImageManager/Classes/Files.php on line 226
But the dir does exist, and is chmod 777... I reckon I must be so close any more help would be great, thanks for the help so far.
Offline
Well, you must have an error in the path. This is a php error, and it's pretty clear, the directory does not exists.
Did it work with the common upload directory before you changed it ?
Offline
maybe there is a spelling error or something then.. this is the first upload i have tried on this site. I will look again in the morning, maybe then it will be clear. Glad to hear that it is probably just a typo though.. Have had some issues with directory browsing stuff, so thats cool. Thanks for the input, will let you know how I get on
Patrick
Offline
there was a mistake I forgot to put a trailing slash on the path name I put that on and now I am taken to the image upload screen, and I can create and manipulate new folders, but I can't upload images..
Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/tmp/php_upload/phpg5sVXh) is not within the allowed path(s) in /home/.../public/www/xinha/plugins/ExtendedFileManager/Classes/ExtendedFileManager.php on line 458
this is the only error that happens, and I am assuming this now has to do with the host? So close, and yet so far Thanks or the help and advice so far, much appreciated...
actually, not sure what I did, but uploads sort of work now..
I was able to upload both files and images using the relevant plugin buttons, but whn I uploaded an image it wouldn't let me press ok - or cancel for that matter.
Now however, when I click on the FileLink button, nothing happens. When I click on the Image Upload button, a popup window appears, but doesn't resize itself, and I have the same issue as above, being able to upload images but not do anything when I have uploaded it.
On top of all that, it doesnt work at all in Internet Explorer 6 or 7.. so it seems a little way off completion at this time, I hope someone is able to help.
Many Thanks
Patrick
Last edited by AussieFreelancer (2007-03-22 20:05:09)
Offline
Hello all,
I changed $IMConfig['images_dir'] and $IMConfig['images_url'] in config.inc.php and that works fine. But now I like to set those vars dynamic in the template of a HTML file that is generated bij a perl-script.
What JS-code where to place? I think somewhere in NewbieGuide -> Page Code
Thanks...
Wijnand
Last edited by wijnand (2007-03-25 12:38:29)
Offline
Pages: 1