<?php 


/** 
***************************************************
*欢迎使用免费版SiteTeam企业建站软件！
*这是一个专业为搜索引擎营销而设计的，极稳定、极易维护的建站软件！
*官方客服：help@php.net.cn
*官方下载网址：http://www.SiteTeam.cn 
***************************************************
**/




 if (!defined('IN_CKFINDER')) exit; class CKFinder_Connector_CommandHandler_CommandHandlerBase { protected $_connector; protected $_currentFolder; protected $_errorHandler; function __construct() { $this->_currentFolder =& CKFinder_Connector_Core_Factory::getInstance("Core_FolderHandler"); $this->_connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector"); $this->_errorHandler =& $this->_connector->getErrorHandler(); } public function getFolderHandler() { if (is_null($this->_currentFolder)) { $this->_currentFolder =& CKFinder_Connector_Core_Factory::getInstance("Core_FolderHandler"); } return $this->_currentFolder; } protected function checkConnector() { $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); if (!$_config->getIsEnabled()) { $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_CONNECTOR_DISABLED); } } protected function checkRequest() { if (preg_match(CKFINDER_REGEX_INVALID_PATH, $this->_currentFolder->getClientPath())) { $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME); } $_resourceTypeConfig = $this->_currentFolder->getResourceTypeConfig(); if (is_null($_resourceTypeConfig)) { $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE); } $_clientPath = $this->_currentFolder->getClientPath(); $_clientPathParts = explode("/", trim($_clientPath, "/")); if ($_clientPathParts) { foreach ($_clientPathParts as $_part) { if ($_resourceTypeConfig->checkIsHiddenFolder($_part)) { $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); } } } if (!is_dir($this->_currentFolder->getServerPath())) { if ($_clientPath == "/") { if (!CKFinder_Connector_Utils_FileSystem::createDirectoryRecursively($this->_currentFolder->getServerPath())) { } } else { $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FOLDER_NOT_FOUND); } } } } 