Beispiel #1
0
 function __construct($accessControlNodes)
 {
     foreach ($accessControlNodes as $node) {
         $_folderView = isset($node['folderView']) ? QFinder_Connector_Utils_Misc::booleanValue($node['folderView']) : false;
         $_folderCreate = isset($node['folderCreate']) ? QFinder_Connector_Utils_Misc::booleanValue($node['folderCreate']) : false;
         $_folderRename = isset($node['folderRename']) ? QFinder_Connector_Utils_Misc::booleanValue($node['folderRename']) : false;
         $_folderDelete = isset($node['folderDelete']) ? QFinder_Connector_Utils_Misc::booleanValue($node['folderDelete']) : false;
         $_fileView = isset($node['fileView']) ? QFinder_Connector_Utils_Misc::booleanValue($node['fileView']) : false;
         $_fileUpload = isset($node['fileUpload']) ? QFinder_Connector_Utils_Misc::booleanValue($node['fileUpload']) : false;
         $_fileRename = isset($node['fileRename']) ? QFinder_Connector_Utils_Misc::booleanValue($node['fileRename']) : false;
         $_fileDelete = isset($node['fileDelete']) ? QFinder_Connector_Utils_Misc::booleanValue($node['fileDelete']) : false;
         $_role = isset($node['role']) ? $node['role'] : "*";
         $_resourceType = isset($node['resourceType']) ? $node['resourceType'] : "*";
         $_folder = isset($node['folder']) ? $node['folder'] : "/";
         $this->addACLEntry($_role, $_resourceType, $_folder, array($_folderView ? QFINDER_CONNECTOR_ACL_FOLDER_VIEW : 0, $_folderCreate ? QFINDER_CONNECTOR_ACL_FOLDER_CREATE : 0, $_folderRename ? QFINDER_CONNECTOR_ACL_FOLDER_RENAME : 0, $_folderDelete ? QFINDER_CONNECTOR_ACL_FOLDER_DELETE : 0, $_fileView ? QFINDER_CONNECTOR_ACL_FILE_VIEW : 0, $_fileUpload ? QFINDER_CONNECTOR_ACL_FILE_UPLOAD : 0, $_fileRename ? QFINDER_CONNECTOR_ACL_FILE_RENAME : 0, $_fileDelete ? QFINDER_CONNECTOR_ACL_FILE_DELETE : 0), array($_folderView ? 0 : QFINDER_CONNECTOR_ACL_FOLDER_VIEW, $_folderCreate ? 0 : QFINDER_CONNECTOR_ACL_FOLDER_CREATE, $_folderRename ? 0 : QFINDER_CONNECTOR_ACL_FOLDER_RENAME, $_folderDelete ? 0 : QFINDER_CONNECTOR_ACL_FOLDER_DELETE, $_fileView ? 0 : QFINDER_CONNECTOR_ACL_FILE_VIEW, $_fileUpload ? 0 : QFINDER_CONNECTOR_ACL_FILE_UPLOAD, $_fileRename ? 0 : QFINDER_CONNECTOR_ACL_FILE_RENAME, $_fileDelete ? 0 : QFINDER_CONNECTOR_ACL_FILE_DELETE));
     }
 }
Beispiel #2
0
 function __construct($thumbnailsNode)
 {
     if (extension_loaded('gd') && isset($thumbnailsNode['enabled'])) {
         $this->_isEnabled = QFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['enabled']);
     }
     if (isset($thumbnailsNode['directAccess'])) {
         $this->_directAccess = QFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['directAccess']);
     }
     if (isset($thumbnailsNode['bmpSupported'])) {
         $this->_bmpSupported = QFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['bmpSupported']);
     }
     if (isset($thumbnailsNode['maxWidth'])) {
         $_maxWidth = intval($thumbnailsNode['maxWidth']);
         if ($_maxWidth >= 0) {
             $this->_maxWidth = $_maxWidth;
         }
     }
     if (isset($thumbnailsNode['maxHeight'])) {
         $_maxHeight = intval($thumbnailsNode['maxHeight']);
         if ($_maxHeight >= 0) {
             $this->_maxHeight = $_maxHeight;
         }
     }
     if (isset($thumbnailsNode['quality'])) {
         $_quality = intval($thumbnailsNode['quality']);
         if ($_quality > 0 && $_quality <= 100) {
             $this->_quality = $_quality;
         }
     }
     if (isset($thumbnailsNode['url'])) {
         $this->_url = $thumbnailsNode['url'];
     }
     if (!strlen($this->_url)) {
         $this->_url = "/";
     } else {
         if (substr($this->_url, -1, 1) != "/") {
             $this->_url .= "/";
         }
     }
     if (isset($thumbnailsNode['directory'])) {
         $this->_directory = $thumbnailsNode['directory'];
     }
 }
Beispiel #3
0
 /**
  * Load values from config
  *
  * @access private
  */
 private function loadValues()
 {
     if (function_exists('CheckAuthentication')) {
         $this->_isEnabled = CheckAuthentication();
     }
     if (isset($GLOBALS['config']['LicenseName'])) {
         $this->_licenseName = (string) $GLOBALS['config']['LicenseName'];
     }
     if (isset($GLOBALS['config']['LicenseKey'])) {
         $this->_licenseKey = (string) $GLOBALS['config']['LicenseKey'];
     }
     if (isset($GLOBALS['config']['FilesystemEncoding'])) {
         $this->_filesystemEncoding = (string) $GLOBALS['config']['FilesystemEncoding'];
     }
     if (isset($GLOBALS['config']['RoleSessionVar'])) {
         $this->_roleSessionVar = (string) $GLOBALS['config']['RoleSessionVar'];
     }
     if (isset($GLOBALS['config']['CheckDoubleExtension'])) {
         $this->_checkDoubleExtension = QFinder_Connector_Utils_Misc::booleanValue($GLOBALS['config']['CheckDoubleExtension']);
     }
     if (isset($GLOBALS['config']['DisallowUnsafeCharacters'])) {
         $this->_disallowUnsafeCharacters = QFinder_Connector_Utils_Misc::booleanValue($GLOBALS['config']['DisallowUnsafeCharacters']);
     }
     if (isset($GLOBALS['config']['SecureImageUploads'])) {
         $this->_secureImageUploads = QFinder_Connector_Utils_Misc::booleanValue($GLOBALS['config']['SecureImageUploads']);
     }
     if (isset($GLOBALS['config']['CheckSizeAfterScaling'])) {
         $this->_checkSizeAfterScaling = QFinder_Connector_Utils_Misc::booleanValue($GLOBALS['config']['CheckSizeAfterScaling']);
     }
     if (isset($GLOBALS['config']['ForceAscii'])) {
         $this->_forceAscii = QFinder_Connector_Utils_Misc::booleanValue($GLOBALS['config']['ForceAscii']);
     }
     if (isset($GLOBALS['config']['HtmlExtensions'])) {
         $this->_htmlExtensions = (array) $GLOBALS['config']['HtmlExtensions'];
     }
     if (isset($GLOBALS['config']['HideFolders'])) {
         $this->_hideFolders = (array) $GLOBALS['config']['HideFolders'];
     }
     if (isset($GLOBALS['config']['HideFiles'])) {
         $this->_hideFiles = (array) $GLOBALS['config']['HideFiles'];
     }
     if (isset($GLOBALS['config']['ChmodFiles'])) {
         $this->_chmodFiles = $GLOBALS['config']['ChmodFiles'];
     }
     if (isset($GLOBALS['config']['ChmodFolders'])) {
         $this->_chmodFolders = $GLOBALS['config']['ChmodFolders'];
     }
     if (isset($GLOBALS['config']['DefaultResourceTypes'])) {
         $_defaultResourceTypes = (string) $GLOBALS['config']['DefaultResourceTypes'];
         if (strlen($_defaultResourceTypes)) {
             $this->_defaultResourceTypes = explode(",", $_defaultResourceTypes);
         }
     }
     if (isset($GLOBALS['config']['TempDirectory'])) {
         $this->_tempDirectory = $GLOBALS['config']['TempDirectory'];
     }
     if (isset($GLOBALS['config']['XSendfile'])) {
         $this->_xsendfile = QFinder_Connector_Utils_Misc::booleanValue($GLOBALS['config']['XSendfile']);
     }
     if (isset($GLOBALS['config']['XSendfileNginx'])) {
         $this->_xsendfileNginx = (array) $GLOBALS['config']['XSendfileNginx'];
     }
 }