作者:sebwebde
项目:pimcor
public function init()
{
parent::init();
// only for admins
$this->checkPermission("adminer");
$this->adminerHome = PIMCORE_DOCUMENT_ROOT . '/vendor/vrana/adminer/';
// proxy for resources
$path = $this->getRequest()->getPathInfo();
$path = str_replace("/admin/external_adminer/", "", $path);
if (preg_match("@\\.(css|js|ico|png|jpg|gif)\$@", $path)) {
$filePath = $this->adminerHome . "/" . $path;
if (preg_match("@.css\$@", $path)) {
// it seems that css files need the right content-type (Chrome)
header("Content-Type: text/css");
}
if (file_exists($filePath)) {
echo file_get_contents($filePath);
if (preg_match("@default.css\$@", $path)) {
// append custom styles, because in Adminer everything is hardcoded
echo file_get_contents($this->adminerHome . "designs/konya/adminer.css");
echo file_get_contents(PIMCORE_DOCUMENT_ROOT . "/pimcore/static6/css/adminer-modifications.css");
}
}
exit;
}
}
作者:pimcor
项目:pimcor
public function init()
{
parent::init();
// PHP 7.0 compatibility of adminer (throws some warnings)
ini_set("display_errors", 0);
// only for admins
$this->checkPermission("adminer");
// call this to keep the session 'open' so that Adminer can write to it
$session = \Pimcore\Tool\Session::get();
$this->adminerHome = PIMCORE_DOCUMENT_ROOT . '/vendor/vrana/adminer/';
// proxy for resources
$path = $this->getRequest()->getPathInfo();
$path = str_replace("/admin/external_adminer/", "", $path);
if (preg_match("@\\.(css|js|ico|png|jpg|gif)\$@", $path)) {
$filePath = $this->adminerHome . "/" . $path;
// it seems that css files need the right content-type (Chrome)
if (preg_match("@.css\$@", $path)) {
header("Content-Type: text/css");
} elseif (preg_match("@.js\$@", $path)) {
header("Content-Type: text/javascript");
}
if (file_exists($filePath)) {
echo file_get_contents($filePath);
if (preg_match("@default.css\$@", $path)) {
// append custom styles, because in Adminer everything is hardcoded
echo file_get_contents($this->adminerHome . "designs/konya/adminer.css");
echo file_get_contents(PIMCORE_DOCUMENT_ROOT . "/pimcore/static6/css/adminer-modifications.css");
}
}
exit;
}
}
作者:sebwebde
项目:pimcor
public function init()
{
parent::init();
// only for admins
$this->checkPermission("linfo");
$this->linfoHome = PIMCORE_DOCUMENT_ROOT . '/vendor/linfo/linfo/';
}
作者:Gerhard1
项目:pimcor
public function init()
{
parent::init();
$this->checkPermission("backup");
@ini_set("memory_limit", "-1");
$this->session = \Pimcore\Tool\Session::get("pimcore_backup");
}
作者:elavarasan
项目:pimcor
public function init()
{
parent::init();
$this->protect();
// IE compatibility
//$this->getResponse()->setHeader("X-UA-Compatible", "IE=8; IE=9", true);
}
作者:emanuel-londo
项目:pimcor
/**
* @throws \Exception
*/
public function init()
{
parent::init();
// check permissions
$notRestrictedActions = array();
if (!in_array($this->getParam("action"), $notRestrictedActions)) {
$this->checkPermission("documents");
}
}
作者:pimcor
项目:pimcor
public function init()
{
parent::init();
// check permissions
$notRestrictedActions = ["get-tree", "fieldcollection-list", "fieldcollection-tree", "fieldcollection-get", "get-class-definition-for-column-config", "objectbrick-list", "objectbrick-tree", "objectbrick-get"];
if (!in_array($this->getParam("action"), $notRestrictedActions)) {
$this->checkPermission("classes");
}
}
作者:solvera
项目:pimcor
public function init()
{
parent::init();
// check permissions
$notRestrictedActions = ["persona-list"];
if (!in_array($this->getParam("action"), $notRestrictedActions)) {
$this->checkPermission("targeting");
}
}
作者:solvera
项目:pimcor
public function init()
{
parent::init();
// check permissions
$notRestrictedActions = ["get-current-user", "update-current-user", "get-available-permissions", "get-minimal", "get-image", "upload-current-user-image"];
if (!in_array($this->getParam("action"), $notRestrictedActions)) {
$this->checkPermission("users");
}
}
作者:emanuel-londo
项目:pimcor
public function init()
{
parent::init();
// recyclebin actions might take some time (save & restore)
$timeout = 600;
// 10 minutes
@ini_set("max_execution_time", $timeout);
set_time_limit($timeout);
// check permissions
$notRestrictedActions = array("add");
if (!in_array($this->getParam("action"), $notRestrictedActions)) {
$this->checkPermission("recyclebin");
}
}
作者:elavarasan
项目:pimcor
public function init()
{
parent::init();
// clear the opcache (as of PHP 5.5)
if (function_exists("opcache_reset")) {
opcache_reset();
}
// clear the APC opcode cache (<= PHP 5.4)
if (function_exists("apc_clear_cache")) {
apc_clear_cache();
}
// clear the Zend Optimizer cache (Zend Server <= PHP 5.4)
if (function_exists('accelerator_reset')) {
return accelerator_reset();
}
$this->checkPermission("update");
}
作者:solvera
项目:pimcor
public function init()
{
parent::init();
$this->dashboardHelper = new \Pimcore\Helper\Dashboard($this->getUser());
}
作者:ChristophWurs
项目:pimcor
/**
*
*/
public function init()
{
parent::init();
}
作者:sfi
项目:pimcor
public function init()
{
parent::init();
$this->checkPermission("plugins");
}
作者:ChristophWurs
项目:pimcor
public function init()
{
if ($this->getParam("action") != "script") {
parent::init();
}
}
作者:solvera
项目:pimcor
public function init()
{
parent::init();
Update::clearOPCaches();
$this->checkPermission("update");
}