コード例 #1
0
ファイル: Reports.php プロジェクト: ngocanh/pimcore
 public function init()
 {
     parent::init();
     // add include paths
     $includePaths = array(PIMCORE_PATH . "/modules/reports/lib", get_include_path());
     set_include_path(implode(PATH_SEPARATOR, $includePaths));
 }
コード例 #2
0
 public function init()
 {
     parent::init();
     $this->protect();
     // IE compatibility
     $this->getResponse()->setHeader("X-UA-Compatible", "IE=8; IE=9", true);
 }
コード例 #3
0
ファイル: SettingsController.php プロジェクト: jv10/pimpon
 public function init()
 {
     parent::init();
     // check if data folder exists
     $this->dataDir = dirname(PimPon_Plugin::getConfigFile());
     if (!is_dir($this->dataDir)) {
         mkdir($this->dataDir, 0755, true);
     }
 }
コード例 #4
0
 public function init()
 {
     parent::init();
     if (!$this->getUser()->isAllowed("plugins")) {
         if ($this->getUser() != null) {
             Logger::err("user [" . $this->getUser()->getId() . "] attempted to install plugin, but has no permission to do so.");
         } else {
             Logger::err("attempt to install plugin, but no user in session.");
         }
     }
 }
コード例 #5
0
 public function init()
 {
     parent::init();
     // check permissions
     $notRestrictedActions = array();
     if (!in_array($this->_getParam("action"), $notRestrictedActions)) {
         if (!$this->getUser()->isAllowed("documents")) {
             $this->_redirect("/admin/login");
             die;
         }
     }
 }
コード例 #6
0
 public function init()
 {
     parent::init();
     // check permissions
     $notRestrictedActions = array("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)) {
         if (!$this->getUser()->isAllowed("classes")) {
             $this->_redirect("/admin/login");
             die;
         }
     }
 }
コード例 #7
0
ファイル: UserController.php プロジェクト: ngocanh/pimcore
 public function init()
 {
     parent::init();
     // check permissions
     $notRestrictedActions = array("get-current-user", "update-current-user", "get-all-users", "get-available-permissions", "tree-get-childs-by-id", "get-minimal");
     if (!in_array($this->_getParam("action"), $notRestrictedActions)) {
         if (!$this->getUser()->isAllowed("users")) {
             $this->_redirect("/admin/login");
             die;
         }
     }
 }
コード例 #8
0
 public function init()
 {
     parent::init();
     // check permissions
     $notRestrictedActions = array("get-image-thumbnail");
     if (!in_array($this->_getParam("action"), $notRestrictedActions)) {
         if (!$this->getUser()->isAllowed("assets")) {
             $this->_redirect("/admin/login");
             die;
         }
     }
     $this->_assetService = new Asset_Service($this->getUser());
 }
コード例 #9
0
 public function init()
 {
     parent::init();
     //        // check permissions
     //
     //        $notRestrictedActions = array("get-tree");
     //
     //        if (!in_array($this->_getParam("action"), $notRestrictedActions)) {
     //
     //            if (!$this->getUser()->isAllowed("classes")) {
     //
     //
     //
     //                $this->_redirect("/admin/login");
     //
     //                die();
     //
     //            }
     //
     //        }
 }
コード例 #10
0
ファイル: LoginController.php プロジェクト: nblackman/pimcore
 public function init()
 {
     parent::init();
     $this->protect();
 }
コード例 #11
0
 public function init()
 {
     parent::init();
     @ini_set("memory_limit", "-1");
     $this->session = new Zend_Session_Namespace("pimcore_backup");
 }
コード例 #12
0
ファイル: Admin.php プロジェクト: shanky0110/pimcore-custom
 public function init()
 {
     parent::init();
     // set language
     if (Zend_Registry::isRegistered("Zend_Locale")) {
         $locale = Zend_Registry::get("Zend_Locale");
         $this->setLanguage($locale->getLanguage());
     } else {
         if ($this->_getParam("language")) {
             $this->setLanguage($this->_getParam("language"));
         } else {
             $config = Pimcore_Config::getSystemConfig();
             $this->setLanguage($config->general->language);
             // try to set browser-language (validation if installed is in $this->setLanguage() )
             $this->setLanguage(new Zend_Locale());
         }
     }
     if (self::$adminInitialized) {
         // this will be executed on every call to this init() method
         try {
             $this->setUser(Zend_Registry::get("pimcore_admin_user"));
         } catch (Exception $e) {
             Logger::emerg("adminInitialized was set to true although there was no user set in the registry -> to be save the process was killed");
             exit;
         }
     } else {
         // the following code is only called once, even when there are some subcalls (eg. with $this->action, ... )
         $this->disableBrowserCache();
         // general definitions
         Document::setHideUnpublished(false);
         Object_Abstract::setHideUnpublished(false);
         Object_Abstract::setGetInheritedValues(false);
         Pimcore::setAdminMode();
         // init translations
         self::initTranslations($this);
         // init zend action helpers
         Zend_Controller_Action_HelperBroker::addPrefix('Pimcore_Controller_Action_Helper');
         // this is to make it possible to use the session id as a part of the route (ZF default route) used for pixlr.com editors, etc.
         if ($this->_getParam("pimcore_admin_sid")) {
             $_REQUEST["pimcore_admin_sid"] = $this->_getParam("pimcore_admin_sid");
         }
         // authenticate user, first try to authenticate with session information
         $user = Pimcore_Tool_Authentication::authenticateSession();
         if ($user instanceof User) {
             $this->setUser($user);
             if ($this->getUser()->getLanguage()) {
                 $this->setLanguage($this->getUser()->getLanguage());
             }
         } else {
             // try to authenticate with digest, but this is only allowed for WebDAV
             if ($this->_getParam("module") == "admin" && $this->_getParam("controller") == "asset" && $this->_getParam("action") == "webdav") {
                 $user = Pimcore_Tool_Authentication::authenticateDigest();
                 if ($user instanceof User) {
                     $this->setUser($user);
                     self::$adminInitialized = true;
                     return;
                 }
             }
         }
         // redirect to the login-page if the user isn't authenticated
         if (!$this->getUser() instanceof User && !($this->_getParam("module") == "admin" && $this->_getParam("controller") == "login")) {
             // put a detailed message into the debug.log
             Logger::warn("Prevented access to " . $_SERVER["REQUEST_URI"] . " because there is no user in the session!");
             Logger::warn(array("server" => $_SERVER, "get" => $_GET, "post" => $_POST, "session" => $_SESSION, "cookie" => $_COOKIE));
             // send a auth header for the client (is covered by the ajax object in javascript)
             $this->getResponse()->setHeader("X-Pimcore-Auth", "required");
             // redirect to login page
             $this->_redirect("/admin/login");
             // exit the execution -> just to be sure
             exit;
         }
         // we're now authenticated so we can remove the default error handler so that we get just the normal PHP errors
         if ($this->_getParam("controller") != "login") {
             $front = Zend_Controller_Front::getInstance();
             $front->unregisterPlugin("Pimcore_Controller_Plugin_ErrorHandler");
             $front->throwExceptions(true);
             @ini_set("display_errors", "On");
             @ini_set("display_startup_errors", "On");
         }
         Zend_Registry::set("pimcore_admin_user", $this->getUser());
         self::$adminInitialized = true;
     }
 }
コード例 #13
0
 public function init()
 {
     parent::init();
 }
コード例 #14
0
 public function init()
 {
     parent::init();
     $this->config = SearchPhp_Plugin::getSearchConfigArray();
 }
 public function init()
 {
     parent::init();
     $this->config = new SphinxSearch_Config();
 }
コード例 #16
0
ファイル: BackupController.php プロジェクト: ngocanh/pimcore
 public function init()
 {
     parent::init();
     $this->session = new Zend_Session_Namespace("pimcore_backup");
 }