Inheritance: extends Pimcore\Controller\Action
Example #1
0
 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;
     }
 }
Example #2
0
 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;
     }
 }
Example #3
0
 public function init()
 {
     parent::init();
     // only for admins
     $this->checkPermission("linfo");
     $this->linfoHome = PIMCORE_DOCUMENT_ROOT . '/vendor/linfo/linfo/';
 }
Example #4
0
 public function init()
 {
     parent::init();
     $this->checkPermission("backup");
     @ini_set("memory_limit", "-1");
     $this->session = \Pimcore\Tool\Session::get("pimcore_backup");
 }
Example #5
0
 public function init()
 {
     parent::init();
     $this->protect();
     // IE compatibility
     //$this->getResponse()->setHeader("X-UA-Compatible", "IE=8; IE=9", true);
 }
Example #6
0
 /**
  * @throws \Exception
  */
 public function init()
 {
     parent::init();
     // check permissions
     $notRestrictedActions = array();
     if (!in_array($this->getParam("action"), $notRestrictedActions)) {
         $this->checkPermission("documents");
     }
 }
Example #7
0
 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");
     }
 }
Example #8
0
 public function init()
 {
     parent::init();
     // check permissions
     $notRestrictedActions = ["persona-list"];
     if (!in_array($this->getParam("action"), $notRestrictedActions)) {
         $this->checkPermission("targeting");
     }
 }
Example #9
0
 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");
     }
 }
 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");
     }
 }
Example #11
0
 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");
 }
Example #12
0
 public function init()
 {
     parent::init();
     $this->dashboardHelper = new \Pimcore\Helper\Dashboard($this->getUser());
 }
Example #13
0
 /**
  *
  */
 public function init()
 {
     parent::init();
 }
Example #14
0
 public function init()
 {
     parent::init();
     $this->protect();
 }
Example #15
0
 public function init()
 {
     parent::init();
     $this->checkPermission("plugins");
 }
 public function init()
 {
     if ($this->getParam("action") != "script") {
         parent::init();
     }
 }
Example #17
0
 public function init()
 {
     parent::init();
     Update::clearOPCaches();
     $this->checkPermission("update");
 }
Example #18
0
 public function init()
 {
     parent::init();
     // only for admins
     $this->checkPermission("opcache");
 }