示例#1
0
$securityContext = $httpKernel->getContainer()->get('thelia.securityContext');
// We just check the current user has the ADMIN role.
$isGranted = $securityContext->isGranted(array('ADMIN'), array(), array(), array());
if (false === $isGranted) {
    echo "Sorry, it seems that you're not allowed to use this function. ADMIN role is required.";
    exit;
}
//------------------------------------------------------------------------------
// DO NOT COPY THESE VARIABLES IN FOLDERS config.php FILES
//------------------------------------------------------------------------------
//**********************
//Path configuration
//**********************
// In this configuration the media folder is located in the /web directory.
// base url of site (without final /). if you prefer relative urls leave empty.
$base_url = rtrim(ConfigQuery::getConfiguredShopUrl(), '/');
// Argh, url_site is not defined ?!
if (empty($base_url)) {
    // A we did not used the router to access this dialog, we cannot use the URL class. Use the good old method.
    $base_url = $request->getSchemeAndHttpHost() . preg_replace('!/tinymce/filemanager/dialog.php.*$!', '', $_SERVER['REQUEST_URI']);
}
// path from base_url to base of upload folder (with start and final /)
$upload_dir = '/media/upload/';
// path from base_url to base of upload folder (with start and final /)
$thumbs_dir = '/media/thumbs/';
// path from base_url to filemanager folder (with start and final /)
$filemanager_dir = '/tinymce/filemanager/';
// path to file manager folder to upload folder (with final /)
$current_path = THELIA_WEB_DIR . DS . 'media' . DS . 'upload' . DS;
// path to file manager folder to thumbs folder (with final /)
// WARNING: thumbs folder should not be inside the upload folder