示例#1
0
 /**
  * @param KernelInterface $kernel
  * @param string          $module The module wherefore this is the configuration-file.
  */
 public function __construct(KernelInterface $kernel, $module)
 {
     parent::__construct($kernel);
     $this->module = (string) $module;
     // read the possible actions based on the files
     $this->setPossibleActions();
 }
示例#2
0
 /**
  * @param KernelInterface $kernel
  * @param string          $action The action to use.
  * @param string          $module The module to use.
  */
 public function __construct(KernelInterface $kernel, $action, $module)
 {
     parent::__construct($kernel);
     // store the current module and action (we grab them from the URL)
     $this->setModule($module);
     $this->setAction($action);
 }
示例#3
0
文件: Url.php 项目: forkcms/forkcms
 /**
  * @param KernelInterface $kernel
  *
  * @throws RedirectException
  */
 public function __construct(KernelInterface $kernel)
 {
     parent::__construct($kernel);
     // add ourself to the reference so other classes can retrieve us
     $this->getContainer()->set('url', $this);
     // fetch the request object from the container
     $this->request = $this->get('request');
     // if there is a trailing slash we permanent redirect to the page without slash
     if (mb_strlen($this->request->getRequestUri()) != 1 && mb_substr($this->request->getRequestUri(), -1) == '/') {
         throw new RedirectException('Redirect', new RedirectResponse(mb_substr($this->request->getRequestUri(), 0, -1), 301));
     }
     // set query-string and parameters for later use
     $this->parameters = $this->request->query->all();
     // process URL
     $this->processQueryString();
 }
示例#4
0
 /**
  * The constructor will set some properties, it populates the parameter array with urldecoded
  * values for ease of use.
  *
  * @param KernelInterface $kernel
  */
 public function __construct(KernelInterface $kernel)
 {
     parent::__construct($kernel);
     $this->tpl = $this->getContainer()->get('template');
     $this->header = $this->getContainer()->get('header');
 }
示例#5
0
 *     3. Create the CheckAuthentication() function that enables CKFinder for authenticated users;
 *
 * Other settings may be left with their default values, or used to control
 * advanced features of CKFinder.
 */
/*
 * Create a Kernel and load the DI container to be able to access the Backend Model methods and
 * the configuration. This should be refactored in time.
 */
require_once '../../../../../../../../autoload.php';
require_once '../../../../../../../../app/AppKernel.php';
require_once '../../../../../../../../app/KernelLoader.php';
$env = getenv('FORK_ENV') ?: 'prod';
$debug = getenv('FORK_DEBUG') === '1';
$kernel = new AppKernel($env, $debug);
$loader = new KernelLoader($kernel);
$loader->passContainerToModels();
// after registring autoloaders, let's add use statements for our needed classes
use Backend\Core\Engine\Authentication as BackendAuthentication;
use Backend\Core\Engine\Model as BackendModel;
/**
 * This function must check the user session to be sure that he/she is
 * authorized to upload and access files in the File Browser.
 *
 * @return boolean
 */
function CheckAuthentication()
{
    // WARNING : DO NOT simply return "true". By doing so, you are allowing
    // "anyone" to upload and list the files in your server. You must implement
    // some kind of session validation here. Even something very simple as...
示例#6
0
 public static function configure(array $map)
 {
     self::$_map = $map;
 }
示例#7
0
 /**
  * It will grab stuff from the reference.
  *
  * @param KernelInterface $kernel
  */
 public function __construct(KernelInterface $kernel)
 {
     parent::__construct($kernel);
     $this->tpl = $this->getContainer()->get('templating');
     $this->URL = $this->getContainer()->get('url');
 }