CKeditor and File Manager

General discussions about WebYep
DesignNorth
Rank 2
Rank 2
Posts: 57
Joined: Mon Apr 23, 2007 4:49 pm

CKeditor and File Manager

Postby DesignNorth » Sat Jul 03, 2010 11:59 am

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.

DesignNorth
Rank 2
Rank 2
Posts: 57
Joined: Mon Apr 23, 2007 4:49 pm

Re: CKeditor and File Manager

Postby DesignNorth » Sun Jul 04, 2010 3:23 pm

Looking closer I'm thinking this is not possible with WebYep unless WebYep is altered specifically for FileManager to work

johannes
Objective Development
Objective Development
Posts: 815
Joined: Fri Nov 10, 2006 4:39 pm
Contact:

Re: CKeditor and File Manager

Postby johannes » Fri Jul 09, 2010 10:28 am

Is there already a PHP connector available for FileManager?

DesignNorth
Rank 2
Rank 2
Posts: 57
Joined: Mon Apr 23, 2007 4:49 pm

Re: CKeditor and File Manager

Postby DesignNorth » Fri Jul 09, 2010 4:42 pm

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/

johannes
Objective Development
Objective Development
Posts: 815
Joined: Fri Nov 10, 2006 4:39 pm
Contact:

Re: CKeditor and File Manager

Postby johannes » Tue Jul 13, 2010 7:33 pm

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!

DesignNorth
Rank 2
Rank 2
Posts: 57
Joined: Mon Apr 23, 2007 4:49 pm

Re: CKeditor and File Manager

Postby DesignNorth » Tue Jul 13, 2010 8:41 pm

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?

johannes
Objective Development
Objective Development
Posts: 815
Joined: Fri Nov 10, 2006 4:39 pm
Contact:

Re: CKeditor and File Manager

Postby johannes » Thu Jul 15, 2010 12:57 pm

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.

DesignNorth
Rank 2
Rank 2
Posts: 57
Joined: Mon Apr 23, 2007 4:49 pm

Re: CKeditor and File Manager

Postby DesignNorth » Wed Aug 04, 2010 2:29 pm

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?

johannes
Objective Development
Objective Development
Posts: 815
Joined: Fri Nov 10, 2006 4:39 pm
Contact:

Re: CKeditor and File Manager

Postby johannes » Mon Aug 09, 2010 10:20 am

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']);

tonylees
Rank 2
Rank 2
Posts: 48
Joined: Sat Feb 07, 2009 11:40 pm

Re: CKeditor and File Manager

Postby tonylees » Wed Oct 20, 2010 6:21 pm

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

johannes
Objective Development
Objective Development
Posts: 815
Joined: Fri Nov 10, 2006 4:39 pm
Contact:

Re: CKeditor and File Manager

Postby johannes » Tue Nov 02, 2010 7:44 am

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/

mendodev
Posts: 2
Joined: Wed Mar 17, 2010 11:16 pm

Re: CKeditor and File Manager - CKFinder

Postby mendodev » Fri Dec 31, 2010 10:24 pm

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

mendodev
Posts: 2
Joined: Wed Mar 17, 2010 11:16 pm

CKeditor and File Manager - more information

Postby mendodev » Fri Dec 31, 2010 11:32 pm

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

johannes
Objective Development
Objective Development
Posts: 815
Joined: Fri Nov 10, 2006 4:39 pm
Contact:

Re: CKeditor and File Manager

Postby johannes » Fri Jan 07, 2011 1:39 pm

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.

slevven
Posts: 1
Joined: Thu Jan 11, 2018 6:52 am

Re: CKeditor and File Manager

Postby slevven » Thu Jan 11, 2018 6:54 am

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.


Return to “WebYep (english)”

Who is online

Users browsing this forum: No registered users and 2 guests