Ausdruck von: Alexander-Kaletsch.de -> Blog -> Snippets
URL: http://www.alexander-kaletsch.de/en-blog-10.html
Zurück zur Startseite
Integrating CKFinder into your symfony Application
Patrick Weinstein am 20. Oktober 2010 um 10:49

When integrating CKEditor and CKFinder into your symfony application, you have to modify the ckfinder/config.php-file, to check if the user has the permissions to use the CKFinder als file-browser.

It's that easy (we asume, CKFinder is located in /web/js/ckfinder):

function CheckAuthentication()
{
require_once(dirname(__FILE__).'/../../../config/ProjectConfiguration.class.php');
$configuration = ProjectConfiguration::getApplicationConfiguration('yourApplicationName', 'prod', false);
$context = sfContext::createInstance($configuration);

if ($context->getUser()->functionToCheckPermission())
return true;
else
return false;
}

So finally you just have to implement a method in your myUser.class.php-file, that checks whether the user may or may not use CKFinder!

alexander-kaletsch.de
Bookmark bei: Del.icio.us Bookmark bei: Google Drucken