CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 CKFinder Role Session Variable

Print topic Send  topic

Author Message
pbarkley

Posts: 37
Posted: 05/01/2013, 2:19 AM

I seem to be stumped here. I have CKEditor working fine; it obviously integrates nicely from CCS 5.0. However, CKFinder is another issue. I can get it to run OK by adding the following line to the html on the page where I need it:

<script language="JavaScript" src="{page:pathToRoot}ckfinder/ckfinder.js" type="text/javascript"></script>

Then I use the same code from the CKFinder documentation that starts like this:

var finder = new CKFinder();

The result is that I get CKFinder integrated nicely as expected. The problem I'm having is setting a session variable to identify which role (in CKFinder) that I want so I can restrict access to certain directories for certain functions. For example, in the CCS page for the newsletter editor, that person should have a role of "newsletter" (lower case) so they don't upload files to the wrong place. The concept in the documentation for CKFinder makes sense, but apparently I'm not setting the session variable in the right place in CCS:

$_SESSION['CKFinder_UserRole'] = "newsletter";
I've tried this in various places, including the After Initialize event, but CKFinder completely ignores it. I can put in debugging statements and see that it's actually being set correctly wherever I place it, but apparently it can't be seen by CKFinder.

To illustrate, here are two of the Access Control definitions from the CKFinder config.php file:

$config['AccessControl'][] = Array(  
  'role' => '*',   
  'resourceType' => '*',   
  'folder' => '/',   
  'folderView' => true,   
  'folderCreate' => false,   
  'folderRename' => false,   
  'folderDelete' => false,   
  
  'fileView' => true,   
  'fileUpload' => true,   
  'fileRename' => true,   
  'fileDelete' => true);   
  
$config['AccessControl'][] = Array(  
  'role' => 'newsletter',   
  'resourceType' => 'Newsletters',   
  'folder' => '/newsletter',   
  'folderView' => true,   
  'folderCreate' => false,   
  'folderRename' => false,   
  'folderDelete' => false,   
  
  'fileView' => true,   
  'fileUpload' => true,   
  'fileRename' => true,   
  'fileDelete' => true);

The resource types, including "Newsletters" (cap) appear to be correctly defined because they all work under the asterisk role condition and I've tested them all.

The reason I say that the role session variable is being ignored, is because if the asterisk role (IOW, everyone) is commented out, the newsletter page cannot see anything at all except the basket. If the everyone role is there, the newsletter page can see a half dozen (all) defined areas. If I make a change to the asterisk role to prohibit renaming a file for example, that right immediately disappears from the newsletter page. IOW, I seem to be able to control access, but only through the everyone case, because the system is completely ignoring the session variable.

That leads me to conclude I'm not setting it correctly. Can anyone help? Thanks!
View profile  Send private message
bannedone


Posts: 273
Posted: 05/01/2013, 11:22 AM

Hi

There are issues with ckfinder and ckeditor in ccs. It actually an incomplete implementation by Yes.

I have fixed all the problems in both ckeditor & ckfinder. I have posted a fix at c c s e l I t e.com (remove the spaces)

If you need more help, let me know.

Have Fun
8-)
John

_________________
John Real
CodeCharge Studio Support, Training, Consulting, Development, Web based solutions
http://realsites.biz
http://ccselite.com
Other Banned IDs on this Forum. jjrjr1, jjrjr2
View profile  Send private message
pbarkley

Posts: 37
Posted: 05/01/2013, 8:12 PM

John, thanks for the reply. I checked out your discussion at your site at forums_topics_view.php?forum_topic_id=169 and found that you implemented a different uploader entirely. While that approach is interesting, I'm committed to CKFinder at this point. And I have CKEditor working fine as well. Perhaps Yes made changes after your article.

I was hoping someone out there had solved the problem of where to set the role to control access to the upload and download directories. It's a nice system and should work pretty easily, but because of the complexity of CCS, somewhere along the way that session variable is not available to CKFinder, or else CKFinder is ignoring it, which I kind of doubt. I'm guessing that I'm initializing the role session variable in the wrong place but after moving it around, CKFInder still can't see it.

Anyone have the roles working correctly? Thanks!
View profile  Send private message
bannedone


Posts: 273
Posted: 05/02/2013, 4:43 PM

Re look at the discussion. I chose the uploaded I did because it we free and ckfinder was not at the time..

In the code at the forum at ccseli you will see the change that needs to be made to cause the ckeditor and ckfinder configure file to work. Yes did not implement that in CCS.

Take a look and I hope that answers your questions and solves the problem

Have fun
8-)
_________________
John Real
CodeCharge Studio Support, Training, Consulting, Development, Web based solutions
http://realsites.biz
http://ccselite.com
Other Banned IDs on this Forum. jjrjr1, jjrjr2
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.