Example #1
0
 /**
  * 检查资源空间大小
  */
 public function checkResourceSpaceSize()
 {
     if (is_null($this->_config)) {
         $this->_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
     }
     $resource_space_size = $this->_config->getResource_Space_Size();
     $unit_type = $resource_space_size['unit_type'];
     $level = $resource_space_size['vip_type'];
     $total_size = $resource_space_size['member_level'][$level];
     $_REQUEST['resource_space_size'] = $total_size . strtoupper($unit_type);
     $resource_root_dir = $this->_config->getResource_Root_Dir();
     if (is_dir($resource_root_dir)) {
         $current_resource_space = $this->_get_real_size($this->_get_dir_size($resource_root_dir), $unit_type);
         $current_resource_space = explode(' ', $current_resource_space);
         $current_size = $current_resource_space[0];
         $unit = $current_resource_space[1];
         if (is_numeric($current_size) && $total_size > $current_size) {
             $_REQUEST['remain_space_size'] = $total_size - $current_size . $unit;
             return TURE;
         } else {
             return FALSE;
         }
     } else {
         return FALSE;
     }
 }
 /**
  * Check given file name
  * Return true if file name matches hidden file names list
  *
  * @param string $fileName
  * @access public
  * @return boolean
  */
 function checkIsHiddenFile($fileName)
 {
     if (is_null($this->_config)) {
         $this->_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
     }
     $regex = $this->_config->getHideFilesRegex();
     if ($regex) {
         return preg_match($regex, $fileName);
     }
     return false;
 }