Page 1 of 1

CKeditor and File Manager

Posted: Sat Jul 03, 2010 11:59 am
by DesignNorth
Has anyone managed to hook up File manger http://labs.corefive.com/2009/10/30/an-open-file-manager-for-ckeditor-3-0/

To ckeditor and got it to work within WebYep?

Can it be done?


The Core five site mentions:

If you are intergrating the FileManager with CKEditor 3.x or higher, simply set the URL when you configure your instance, like so:

Code: Select all

CKEDITOR.replace('instancename', {
   filebrowserBrowseUrl: '[Path to Filemanager]/index.html',
   ...other configuration options...
});


I believe the instance name should be 'CKEditor1' but how should the code be correclty confirgured in config.js ?

Can't seem to get it to work.

Re: CKeditor and File Manager

Posted: Sun Jul 04, 2010 3:23 pm
by DesignNorth
Looking closer I'm thinking this is not possible with WebYep unless WebYep is altered specifically for FileManager to work

Re: CKeditor and File Manager

Posted: Fri Jul 09, 2010 10:28 am
by johannes
Is there already a PHP connector available for FileManager?

Re: CKeditor and File Manager

Posted: Fri Jul 09, 2010 4:42 pm
by DesignNorth
Yes there is :-)

filemanager > connectors > php

Files:

filemanager.class.php
filemanager.config.php
filemanager.php

Are these any help?



http://labs.corefive.com/projects/filemanager/

Re: CKeditor and File Manager

Posted: Tue Jul 13, 2010 7:33 pm
by johannes
You should be able to link FileManager into CKEditor by adding this to the webyep-system/program/opt/ckeditor_init.php:

Code: Select all

filebrowserBrowseUrl: "/webyep-system/program/opt/filemanager/index.html"


Assuming you've put FileManager in the folder "filemanager" inside WebYep's "opt" folder.

Setting up FileManager is another thing though.
Please see FileManager's forum for that...

Please most of all note that FileManager will need it's own authentication mechanism!

Re: CKeditor and File Manager

Posted: Tue Jul 13, 2010 8:41 pm
by DesignNorth
Thanks for the information.

FCKEditor comes with a Filemanager as part of the download. Which can be activated with a one line code change. Does that have to have an authentication process also?

Re: CKeditor and File Manager

Posted: Thu Jul 15, 2010 12:57 pm
by johannes
Yes - definitely!

In some versions some file managers unfortunately came with a default configuration that did not use any authentication. That enabled anybody to upload any files to that web site.

Please carefully read the documentation of the used file manager regarding security and authentication.

Re: CKeditor and File Manager

Posted: Wed Aug 04, 2010 2:29 pm
by DesignNorth
If using the Commercial version http://ckfinder.com/,

Does that have to be secured, or does that work "out of the box" so to speak?

Re: CKeditor and File Manager

Posted: Mon Aug 09, 2010 10:20 am
by johannes
CKFinder always needs some kind of authentication - it does not per se use the authentication mechanism of the CMS it's embedded in.

So, yes, also in the commercial version you need to set up some sort of authentication or anyone will be able to upload files.

Currently CKFinder comes with a default configuration where the authentication function simply returns false, meaning, that no one can upload files.

Do not change that by simply returning true - because then everyone can upload files.

You could do the following:

  • Install CKFinder in the folder /webyep-system/program/opt/ckfinder
  • Set up HTTP Authentication on your server for that folder (using .htaccess or any other mechanism provided by your ISP)
  • Then adapt the CKFinder config's CheckAuthentication() function - change the "return false;" to:

    Code: Select all

       return isset($_SERVER['PHP_AUTH_USER']) || isset($_SERVER['REMOTE_USER']);

Re: CKeditor and File Manager

Posted: Wed Oct 20, 2010 6:21 pm
by tonylees
Hi All,

I am really struggling to get this to work... more a lack of experience than anything else!

I have followed Johannes example But , what should be in the .htacces file? and should this be in the ckfinder folder or the folder that contains ckfinder?

Thanks
Tony

Re: CKeditor and File Manager

Posted: Tue Nov 02, 2010 7:44 am
by johannes
The .htaccess file should be placed inside the CKFinder folder.

It should contain something like this:

Code: Select all

AuthType Basic
AuthName "File Manager"
AuthUserFile /path/to/password-file
Require valid-user


The path to the password file is important - please ask your ISP where to best put this file.

To generate the content of the password file you either can use the command line tool htpasswd (if present in your computer or if you have terminal access to your server) or use some online tool like http://www.htaccesstools.com/htpasswd-generator/

Re: CKeditor and File Manager - CKFinder

Posted: Fri Dec 31, 2010 10:24 pm
by mendodev
Hello -

I have been following this post on the integration of CKFinder with CKEditor and have been successful. Thank you, Johannes for your instructions regarding the .htaccess and .htpassword files.

It is working in that I can successfully upload an image from the web server via CKFinder.

However, there is a problem with the authentication; if I go to the web page where the image was added after clearing out the cookies or using a new browser, an authentication screen appears as soon as the web page is loaded. E.g. "To view this page, you must log in to this area on xyz.com:80: File Manager." This means that the general public would see the authentication window. If the username and password setup in .htpassword are not entered, then the images won't load.

If there have been multiple images uploaded, once the user name and password have been entered the first time, the authentication window will reappear.

The appearance of the authentication window is independent of logging into webyep, and I think that it is happening at this stage because of something in the .htaccess file. The .htaccess file is currently located inside of the ckfinder folder, which is OK with my ISP.

My question is, how can I prevent the authentication window from appearing when a web page containing images is loaded? I have looked on the CKFinder site as well as the .htaccess generator site, but was unable to locate anything. Any information is greatly appreciated.

Thank you,

Cynthia

CKeditor and File Manager - more information

Posted: Fri Dec 31, 2010 11:32 pm
by mendodev
I have been doing some more research and realized that the images are stored in ckfinder/userfiles/images/

The htaccess and htpasswd files are also stored inside of the the ckfinder directory

The AuthUserFile line is pointing to .../webyep-system/program/opt/ckfinder/.htpasswd

Consequently, the authentication window is appearing when a page is loaded that contains any images located within in the ckfinder directory because the .htaccess file is protecting anything that is viewed inside of the ckfinder directory.

So, if the directory that stores the uploaded files is outside of the ckfinder directory, the file uploader will work with authentication and the uploaded files will be able to be viewed without having to go through an authentication window.

Does this sound correct?

Thank you,

Cynthia

Re: CKeditor and File Manager

Posted: Fri Jan 07, 2011 1:39 pm
by johannes
mendodev wrote:So, if the directory that stores the uploaded files is outside of the ckfinder directory, the file uploader will work with authentication and the uploaded files will be able to be viewed without having to go through an authentication window.


Yes.
Actually it is the common case that the "userfiles" folder is not located inside the ckfinder directory but in the root directory of the website.

Re: CKeditor and File Manager

Posted: Thu Jan 11, 2018 6:54 am
by slevven
ave you seen/read the documentation ? There is nothing .... It's not a documentation, it's only some signature of class or methods with no description....

I have also tried Filza File manager app on iOS devices.