Passed
Push — master ( f418e9...b58333 )
by Anthony
04:11
created
libs/ckfinder/core/connector/php/php5/CommandHandler/DownloadFile.php 3 patches
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -27,63 +27,63 @@
 block discarded – undo
27 27
  */
28 28
 class CKFinder_Connector_CommandHandler_DownloadFile extends CKFinder_Connector_CommandHandler_CommandHandlerBase
29 29
 {
30
-    /**
31
-     * Command name
32
-     *
33
-     * @access private
34
-     * @var string
35
-     */
36
-    private $command = "DownloadFile";
30
+	/**
31
+	 * Command name
32
+	 *
33
+	 * @access private
34
+	 * @var string
35
+	 */
36
+	private $command = "DownloadFile";
37 37
 
38
-    /**
39
-     * send response (file)
40
-     * @access public
41
-     *
42
-     */
43
-    public function sendResponse()
44
-    {
45
-        if (!function_exists('ob_list_handlers') || ob_list_handlers()) {
46
-            @ob_end_clean();
47
-        }
48
-        header("Content-Encoding: none");
38
+	/**
39
+	 * send response (file)
40
+	 * @access public
41
+	 *
42
+	 */
43
+	public function sendResponse()
44
+	{
45
+		if (!function_exists('ob_list_handlers') || ob_list_handlers()) {
46
+			@ob_end_clean();
47
+		}
48
+		header("Content-Encoding: none");
49 49
 
50
-        $this->checkConnector();
51
-        $this->checkRequest();
50
+		$this->checkConnector();
51
+		$this->checkRequest();
52 52
 
53
-        if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_VIEW)) {
54
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
55
-        }
53
+		if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_VIEW)) {
54
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
55
+		}
56 56
 
57
-        $fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_GET["FileName"]);
58
-        $_resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
57
+		$fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_GET["FileName"]);
58
+		$_resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
59 59
 
60
-        if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName)) {
61
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
62
-        }
60
+		if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName)) {
61
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
62
+		}
63 63
 
64
-        if (!$_resourceTypeInfo->checkExtension($fileName, false)) {
65
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
66
-        }
64
+		if (!$_resourceTypeInfo->checkExtension($fileName, false)) {
65
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
66
+		}
67 67
 
68
-        $filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName);
69
-        if ($_resourceTypeInfo->checkIsHiddenFile($fileName) || !file_exists($filePath) || !is_file($filePath)) {
70
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND);
71
-        }
68
+		$filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName);
69
+		if ($_resourceTypeInfo->checkIsHiddenFile($fileName) || !file_exists($filePath) || !is_file($filePath)) {
70
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND);
71
+		}
72 72
 
73
-        $fileName = CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($fileName);
73
+		$fileName = CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($fileName);
74 74
 
75
-        header("Cache-Control: cache, must-revalidate");
76
-        header("Pragma: public");
77
-        header("Expires: 0");
78
-        if (!empty($_GET['format']) && $_GET['format'] == 'text') {
79
-            header("Content-Type: text/plain; charset=utf-8");
80
-        }
81
-        else {
82
-            header("Content-type: application/octet-stream; name=\"" . $fileName . "\"");
83
-            header("Content-Disposition: attachment; filename=\"" . str_replace("\"", "\\\"", $fileName). "\"");
84
-        }
85
-        header("Content-Length: " . filesize($filePath));
86
-        CKFinder_Connector_Utils_FileSystem::readfileChunked($filePath);
87
-        exit;
88
-    }
75
+		header("Cache-Control: cache, must-revalidate");
76
+		header("Pragma: public");
77
+		header("Expires: 0");
78
+		if (!empty($_GET['format']) && $_GET['format'] == 'text') {
79
+			header("Content-Type: text/plain; charset=utf-8");
80
+		}
81
+		else {
82
+			header("Content-type: application/octet-stream; name=\"" . $fileName . "\"");
83
+			header("Content-Disposition: attachment; filename=\"" . str_replace("\"", "\\\"", $fileName). "\"");
84
+		}
85
+		header("Content-Length: " . filesize($filePath));
86
+		CKFinder_Connector_Utils_FileSystem::readfileChunked($filePath);
87
+		exit;
88
+	}
89 89
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,10 +79,10 @@
 block discarded – undo
79 79
             header("Content-Type: text/plain; charset=utf-8");
80 80
         }
81 81
         else {
82
-            header("Content-type: application/octet-stream; name=\"" . $fileName . "\"");
83
-            header("Content-Disposition: attachment; filename=\"" . str_replace("\"", "\\\"", $fileName). "\"");
82
+            header("Content-type: application/octet-stream; name=\"".$fileName."\"");
83
+            header("Content-Disposition: attachment; filename=\"".str_replace("\"", "\\\"", $fileName)."\"");
84 84
         }
85
-        header("Content-Length: " . filesize($filePath));
85
+        header("Content-Length: ".filesize($filePath));
86 86
         CKFinder_Connector_Utils_FileSystem::readfileChunked($filePath);
87 87
         exit;
88 88
     }
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@  discard block
 block discarded – undo
10 10
  * modifying or distribute this file or part of its contents. The contents of
11 11
  * this file is part of the Source Code of CKFinder.
12 12
  */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
@@ -66,8 +68,7 @@  discard block
 block discarded – undo
66 68
 
67 69
             $funcNum = preg_replace("/[^0-9]/", "", $_GET['CKEditorFuncNum']);
68 70
             echo "window.parent.CKEDITOR.tools.callFunction($funcNum, '" . str_replace("'", "\\'", $sFileUrl . $sFileName) . "', '" .str_replace("'", "\\'", $errorMessage). "');";
69
-        }
70
-        else {
71
+        } else {
71 72
             if (!$uploaded) {
72 73
                 echo "window.parent.OnUploadCompleted(" . $number . ", '', '', '') ;";
73 74
             } else {
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php5/CommandHandler/Init.php 3 patches
Indentation   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -32,116 +32,116 @@
 block discarded – undo
32 32
  */
33 33
 class CKFinder_Connector_CommandHandler_Init extends CKFinder_Connector_CommandHandler_XmlCommandHandlerBase
34 34
 {
35
-    /**
36
-     * Command name
37
-     *
38
-     * @access private
39
-     * @var string
40
-     */
41
-    private $command = "Init";
42
-
43
-    protected function mustCheckRequest()
44
-    {
45
-        return false;
46
-    }
47
-
48
-    /**
49
-     * Must add CurrentFolder node?
50
-     *
51
-     * @return boolean
52
-     * @access protected
53
-     */
54
-    protected function mustAddCurrentFolderNode()
55
-    {
56
-        return false;
57
-    }
58
-
59
-    /**
60
-     * handle request and build XML
61
-     * @access protected
62
-     *
63
-     */
64
-    protected function buildXml()
65
-    {
66
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
67
-
68
-        // Create the "ConnectorInfo" node.
69
-        $_oConnInfo = new Ckfinder_Connector_Utils_XmlNode("ConnectorInfo");
70
-        $this->_connectorNode->addChild($_oConnInfo);
71
-        $_oConnInfo->addAttribute("enabled", $_config->getIsEnabled() ? "true" : "false");
72
-
73
-        if (!$_config->getIsEnabled()) {
74
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_CONNECTOR_DISABLED);
75
-        }
76
-
77
-        $_ln = '' ;
78
-        $_lc = $_config->getLicenseKey() . '                                  ' ;
79
-        if ( 1 == ( strpos( CKFINDER_CHARS, $_lc[0] ) % 5 ) )
80
-        $_ln = $_config->getLicenseName() ;
81
-
82
-        $_oConnInfo->addAttribute("s", $_ln);
83
-        $_oConnInfo->addAttribute("c", trim( $_lc[11] . $_lc[0] . $_lc [8] . $_lc[12] . $_lc[26] . $_lc[2] . $_lc[3] . $_lc[25] . $_lc[1] ));
84
-        $_thumbnailsConfig = $_config->getThumbnailsConfig();
85
-        $_thumbnailsEnabled = $_thumbnailsConfig->getIsEnabled() ;
86
-        $_oConnInfo->addAttribute("thumbsEnabled", $_thumbnailsEnabled ? "true" : "false");
87
-        if ($_thumbnailsEnabled) {
88
-            $_oConnInfo->addAttribute("thumbsUrl", $_thumbnailsConfig->getUrl());
89
-            $_oConnInfo->addAttribute("thumbsDirectAccess", $_thumbnailsConfig->getDirectAccess() ? "true" : "false" );
90
-        }
91
-        $_imagesConfig = $_config->getImagesConfig();
92
-        $_oConnInfo->addAttribute("imgWidth", $_imagesConfig->getMaxWidth());
93
-        $_oConnInfo->addAttribute("imgHeight", $_imagesConfig->getMaxHeight());
94
-
95
-        // Create the "ResourceTypes" node.
96
-        $_oResourceTypes = new Ckfinder_Connector_Utils_XmlNode("ResourceTypes");
97
-        $this->_connectorNode->addChild($_oResourceTypes);
98
-        // Create the "PluginsInfo" node.
99
-        $_oPluginsInfo = new Ckfinder_Connector_Utils_XmlNode("PluginsInfo");
100
-        $this->_connectorNode->addChild($_oPluginsInfo);
101
-
102
-        // Load the resource types in an array.
103
-        $_aTypes = $_config->getDefaultResourceTypes();
104
-
105
-        if (!sizeof($_aTypes)) {
106
-            $_aTypes = $_config->getResourceTypeNames();
107
-        }
108
-
109
-        $_aTypesSize = sizeof($_aTypes);
110
-        if ($_aTypesSize) {
111
-            for ($i = 0; $i < $_aTypesSize; $i++)
112
-            {
113
-                $_resourceTypeName = $_aTypes[$i];
114
-
115
-                $_acl = $_config->getAccessControlConfig();
116
-                $_aclMask = $_acl->getComputedMask($_resourceTypeName, "/");
117
-
118
-                if ( ($_aclMask & CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) != CKFINDER_CONNECTOR_ACL_FOLDER_VIEW ) {
119
-                    continue;
120
-                }
121
-
122
-                if (!isset($_GET['type']) || $_GET['type'] === $_resourceTypeName) {
123
-                    //print $_resourceTypeName;
124
-                    $_oTypeInfo = $_config->getResourceTypeConfig($_resourceTypeName);
125
-                    //print_r($_oTypeInfo);
126
-                    $_oResourceType[$i] = new Ckfinder_Connector_Utils_XmlNode("ResourceType");
127
-                    $_oResourceTypes->addChild($_oResourceType[$i]);
128
-
129
-                    $_oResourceType[$i]->addAttribute("name", $_resourceTypeName);
130
-                    $_oResourceType[$i]->addAttribute("url", $_oTypeInfo->getUrl());
131
-                    $_oResourceType[$i]->addAttribute("allowedExtensions", implode(",", $_oTypeInfo->getAllowedExtensions()));
132
-                    $_oResourceType[$i]->addAttribute("deniedExtensions", implode(",", $_oTypeInfo->getDeniedExtensions()));
133
-                    $_oResourceType[$i]->addAttribute("hash", substr(md5($_oTypeInfo->getDirectory()), 0, 16));
134
-                    $_oResourceType[$i]->addAttribute("hasChildren", CKFinder_Connector_Utils_FileSystem::hasChildren($_oTypeInfo->getDirectory()) ? "true" : "false");
135
-                    $_oResourceType[$i]->addAttribute("acl", $_aclMask);
136
-                }
137
-            }
138
-        }
139
-
140
-        $config = $GLOBALS['config'];
141
-        if (!empty($config['Plugins']) && is_array($config['Plugins']) ) {
142
-            $_oConnInfo->addAttribute("plugins", implode(",", $config['Plugins']));
143
-        }
144
-
145
-        CKFinder_Connector_Core_Hooks::run('InitCommand', array(&$this->_connectorNode));
146
-    }
35
+	/**
36
+	 * Command name
37
+	 *
38
+	 * @access private
39
+	 * @var string
40
+	 */
41
+	private $command = "Init";
42
+
43
+	protected function mustCheckRequest()
44
+	{
45
+		return false;
46
+	}
47
+
48
+	/**
49
+	 * Must add CurrentFolder node?
50
+	 *
51
+	 * @return boolean
52
+	 * @access protected
53
+	 */
54
+	protected function mustAddCurrentFolderNode()
55
+	{
56
+		return false;
57
+	}
58
+
59
+	/**
60
+	 * handle request and build XML
61
+	 * @access protected
62
+	 *
63
+	 */
64
+	protected function buildXml()
65
+	{
66
+		$_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
67
+
68
+		// Create the "ConnectorInfo" node.
69
+		$_oConnInfo = new Ckfinder_Connector_Utils_XmlNode("ConnectorInfo");
70
+		$this->_connectorNode->addChild($_oConnInfo);
71
+		$_oConnInfo->addAttribute("enabled", $_config->getIsEnabled() ? "true" : "false");
72
+
73
+		if (!$_config->getIsEnabled()) {
74
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_CONNECTOR_DISABLED);
75
+		}
76
+
77
+		$_ln = '' ;
78
+		$_lc = $_config->getLicenseKey() . '                                  ' ;
79
+		if ( 1 == ( strpos( CKFINDER_CHARS, $_lc[0] ) % 5 ) )
80
+		$_ln = $_config->getLicenseName() ;
81
+
82
+		$_oConnInfo->addAttribute("s", $_ln);
83
+		$_oConnInfo->addAttribute("c", trim( $_lc[11] . $_lc[0] . $_lc [8] . $_lc[12] . $_lc[26] . $_lc[2] . $_lc[3] . $_lc[25] . $_lc[1] ));
84
+		$_thumbnailsConfig = $_config->getThumbnailsConfig();
85
+		$_thumbnailsEnabled = $_thumbnailsConfig->getIsEnabled() ;
86
+		$_oConnInfo->addAttribute("thumbsEnabled", $_thumbnailsEnabled ? "true" : "false");
87
+		if ($_thumbnailsEnabled) {
88
+			$_oConnInfo->addAttribute("thumbsUrl", $_thumbnailsConfig->getUrl());
89
+			$_oConnInfo->addAttribute("thumbsDirectAccess", $_thumbnailsConfig->getDirectAccess() ? "true" : "false" );
90
+		}
91
+		$_imagesConfig = $_config->getImagesConfig();
92
+		$_oConnInfo->addAttribute("imgWidth", $_imagesConfig->getMaxWidth());
93
+		$_oConnInfo->addAttribute("imgHeight", $_imagesConfig->getMaxHeight());
94
+
95
+		// Create the "ResourceTypes" node.
96
+		$_oResourceTypes = new Ckfinder_Connector_Utils_XmlNode("ResourceTypes");
97
+		$this->_connectorNode->addChild($_oResourceTypes);
98
+		// Create the "PluginsInfo" node.
99
+		$_oPluginsInfo = new Ckfinder_Connector_Utils_XmlNode("PluginsInfo");
100
+		$this->_connectorNode->addChild($_oPluginsInfo);
101
+
102
+		// Load the resource types in an array.
103
+		$_aTypes = $_config->getDefaultResourceTypes();
104
+
105
+		if (!sizeof($_aTypes)) {
106
+			$_aTypes = $_config->getResourceTypeNames();
107
+		}
108
+
109
+		$_aTypesSize = sizeof($_aTypes);
110
+		if ($_aTypesSize) {
111
+			for ($i = 0; $i < $_aTypesSize; $i++)
112
+			{
113
+				$_resourceTypeName = $_aTypes[$i];
114
+
115
+				$_acl = $_config->getAccessControlConfig();
116
+				$_aclMask = $_acl->getComputedMask($_resourceTypeName, "/");
117
+
118
+				if ( ($_aclMask & CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) != CKFINDER_CONNECTOR_ACL_FOLDER_VIEW ) {
119
+					continue;
120
+				}
121
+
122
+				if (!isset($_GET['type']) || $_GET['type'] === $_resourceTypeName) {
123
+					//print $_resourceTypeName;
124
+					$_oTypeInfo = $_config->getResourceTypeConfig($_resourceTypeName);
125
+					//print_r($_oTypeInfo);
126
+					$_oResourceType[$i] = new Ckfinder_Connector_Utils_XmlNode("ResourceType");
127
+					$_oResourceTypes->addChild($_oResourceType[$i]);
128
+
129
+					$_oResourceType[$i]->addAttribute("name", $_resourceTypeName);
130
+					$_oResourceType[$i]->addAttribute("url", $_oTypeInfo->getUrl());
131
+					$_oResourceType[$i]->addAttribute("allowedExtensions", implode(",", $_oTypeInfo->getAllowedExtensions()));
132
+					$_oResourceType[$i]->addAttribute("deniedExtensions", implode(",", $_oTypeInfo->getDeniedExtensions()));
133
+					$_oResourceType[$i]->addAttribute("hash", substr(md5($_oTypeInfo->getDirectory()), 0, 16));
134
+					$_oResourceType[$i]->addAttribute("hasChildren", CKFinder_Connector_Utils_FileSystem::hasChildren($_oTypeInfo->getDirectory()) ? "true" : "false");
135
+					$_oResourceType[$i]->addAttribute("acl", $_aclMask);
136
+				}
137
+			}
138
+		}
139
+
140
+		$config = $GLOBALS['config'];
141
+		if (!empty($config['Plugins']) && is_array($config['Plugins']) ) {
142
+			$_oConnInfo->addAttribute("plugins", implode(",", $config['Plugins']));
143
+		}
144
+
145
+		CKFinder_Connector_Core_Hooks::run('InitCommand', array(&$this->_connectorNode));
146
+	}
147 147
 }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 /**
22 22
  * Include base XML command handler
23 23
  */
24
-require_once CKFINDER_CONNECTOR_LIB_DIR . "/CommandHandler/XmlCommandHandlerBase.php";
24
+require_once CKFINDER_CONNECTOR_LIB_DIR."/CommandHandler/XmlCommandHandlerBase.php";
25 25
 
26 26
 /**
27 27
  * Handle Init command
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     function buildXml()
65 65
     {
66
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
66
+        $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config");
67 67
 
68 68
         // Create the "ConnectorInfo" node.
69 69
         $_oConnInfo = new Ckfinder_Connector_Utils_XmlNode("ConnectorInfo");
@@ -74,19 +74,19 @@  discard block
 block discarded – undo
74 74
             $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_CONNECTOR_DISABLED);
75 75
         }
76 76
 
77
-        $_ln = '' ;
78
-        $_lc = $_config->getLicenseKey() . '                                  ' ;
79
-        if ( 1 == ( strpos( CKFINDER_CHARS, $_lc[0] ) % 5 ) )
80
-        $_ln = $_config->getLicenseName() ;
77
+        $_ln = '';
78
+        $_lc = $_config->getLicenseKey().'                                  ';
79
+        if (1 == (strpos(CKFINDER_CHARS, $_lc[0]) % 5))
80
+        $_ln = $_config->getLicenseName();
81 81
 
82 82
         $_oConnInfo->addAttribute("s", $_ln);
83
-        $_oConnInfo->addAttribute("c", trim( $_lc[11] . $_lc[0] . $_lc [8] . $_lc[12] . $_lc[26] . $_lc[2] . $_lc[3] . $_lc[25] . $_lc[1] ));
83
+        $_oConnInfo->addAttribute("c", trim($_lc[11].$_lc[0].$_lc [8].$_lc[12].$_lc[26].$_lc[2].$_lc[3].$_lc[25].$_lc[1]));
84 84
         $_thumbnailsConfig = $_config->getThumbnailsConfig();
85
-        $_thumbnailsEnabled = $_thumbnailsConfig->getIsEnabled() ;
85
+        $_thumbnailsEnabled = $_thumbnailsConfig->getIsEnabled();
86 86
         $_oConnInfo->addAttribute("thumbsEnabled", $_thumbnailsEnabled ? "true" : "false");
87 87
         if ($_thumbnailsEnabled) {
88 88
             $_oConnInfo->addAttribute("thumbsUrl", $_thumbnailsConfig->getUrl());
89
-            $_oConnInfo->addAttribute("thumbsDirectAccess", $_thumbnailsConfig->getDirectAccess() ? "true" : "false" );
89
+            $_oConnInfo->addAttribute("thumbsDirectAccess", $_thumbnailsConfig->getDirectAccess() ? "true" : "false");
90 90
         }
91 91
         $_imagesConfig = $_config->getImagesConfig();
92 92
         $_oConnInfo->addAttribute("imgWidth", $_imagesConfig->getMaxWidth());
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
                 $_acl = $_config->getAccessControlConfig();
116 116
                 $_aclMask = $_acl->getComputedMask($_resourceTypeName, "/");
117 117
 
118
-                if ( ($_aclMask & CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) != CKFINDER_CONNECTOR_ACL_FOLDER_VIEW ) {
118
+                if (($_aclMask & CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) != CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) {
119 119
                     continue;
120 120
                 }
121 121
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         }
139 139
 
140 140
         $config = $GLOBALS['config'];
141
-        if (!empty($config['Plugins']) && is_array($config['Plugins']) ) {
141
+        if (!empty($config['Plugins']) && is_array($config['Plugins'])) {
142 142
             $_oConnInfo->addAttribute("plugins", implode(",", $config['Plugins']));
143 143
         }
144 144
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@  discard block
 block discarded – undo
10 10
  * modifying or distribute this file or part of its contents. The contents of
11 11
  * this file is part of the Source Code of CKFinder.
12 12
  */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
@@ -76,8 +78,9 @@  discard block
 block discarded – undo
76 78
 
77 79
         $_ln = '' ;
78 80
         $_lc = $_config->getLicenseKey() . '                                  ' ;
79
-        if ( 1 == ( strpos( CKFINDER_CHARS, $_lc[0] ) % 5 ) )
80
-        $_ln = $_config->getLicenseName() ;
81
+        if ( 1 == ( strpos( CKFINDER_CHARS, $_lc[0] ) % 5 ) ) {
82
+                $_ln = $_config->getLicenseName() ;
83
+        }
81 84
 
82 85
         $_oConnInfo->addAttribute("s", $_ln);
83 86
         $_oConnInfo->addAttribute("c", trim( $_lc[11] . $_lc[0] . $_lc [8] . $_lc[12] . $_lc[26] . $_lc[2] . $_lc[3] . $_lc[25] . $_lc[1] ));
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php5/Core/Factory.php 3 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -27,42 +27,42 @@
 block discarded – undo
27 27
  */
28 28
 class CKFinder_Connector_Core_Factory
29 29
 {
30
-    static $instances = array();
30
+	static $instances = array();
31 31
 
32
-    /**
33
-     * Initiate factory
34
-     * @static
35
-     */
36
-    static function initFactory()
37
-    {
38
-    }
32
+	/**
33
+	 * Initiate factory
34
+	 * @static
35
+	 */
36
+	static function initFactory()
37
+	{
38
+	}
39 39
 
40
-    /**
41
-     * Get instance of specified class
42
-     * Short and Long class names are possible
43
-     * <code>
44
-     * $obj1 =& CKFinder_Connector_Core_Factory::getInstance("Ckfinder_Connector_Core_Xml");
45
-     * $obj2 =& CKFinder_Connector_Core_Factory::getInstance("Core_Xml");
46
-     * </code>
47
-     *
48
-     * @param string $className class name
49
-     * @static
50
-     * @access public
51
-     * @return object
52
-     */
53
-    public static function &getInstance($className)
54
-    {
55
-        $namespace = "CKFinder_Connector_";
40
+	/**
41
+	 * Get instance of specified class
42
+	 * Short and Long class names are possible
43
+	 * <code>
44
+	 * $obj1 =& CKFinder_Connector_Core_Factory::getInstance("Ckfinder_Connector_Core_Xml");
45
+	 * $obj2 =& CKFinder_Connector_Core_Factory::getInstance("Core_Xml");
46
+	 * </code>
47
+	 *
48
+	 * @param string $className class name
49
+	 * @static
50
+	 * @access public
51
+	 * @return object
52
+	 */
53
+	public static function &getInstance($className)
54
+	{
55
+		$namespace = "CKFinder_Connector_";
56 56
 
57
-        $baseName = str_replace($namespace,"",$className);
57
+		$baseName = str_replace($namespace,"",$className);
58 58
 
59
-        $className = $namespace.$baseName;
59
+		$className = $namespace.$baseName;
60 60
 
61
-        if (!isset(CKFinder_Connector_Core_Factory::$instances[$className])) {
62
-            require_once CKFINDER_CONNECTOR_LIB_DIR . "/" . str_replace("_","/",$baseName).".php";
63
-            CKFinder_Connector_Core_Factory::$instances[$className] = new $className;
64
-        }
61
+		if (!isset(CKFinder_Connector_Core_Factory::$instances[$className])) {
62
+			require_once CKFINDER_CONNECTOR_LIB_DIR . "/" . str_replace("_","/",$baseName).".php";
63
+			CKFinder_Connector_Core_Factory::$instances[$className] = new $className;
64
+		}
65 65
 
66
-        return CKFinder_Connector_Core_Factory::$instances[$className];
67
-    }
66
+		return CKFinder_Connector_Core_Factory::$instances[$className];
67
+	}
68 68
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,12 +54,12 @@
 block discarded – undo
54 54
     {
55 55
         $namespace = "CKFinder_Connector_";
56 56
 
57
-        $baseName = str_replace($namespace,"",$className);
57
+        $baseName = str_replace($namespace, "", $className);
58 58
 
59 59
         $className = $namespace.$baseName;
60 60
 
61 61
         if (!isset(CKFinder_Connector_Core_Factory::$instances[$className])) {
62
-            require_once CKFINDER_CONNECTOR_LIB_DIR . "/" . str_replace("_","/",$baseName).".php";
62
+            require_once CKFINDER_CONNECTOR_LIB_DIR."/".str_replace("_", "/", $baseName).".php";
63 63
             CKFinder_Connector_Core_Factory::$instances[$className] = new $className;
64 64
         }
65 65
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@
 block discarded – undo
10 10
  * modifying or distribute this file or part of its contents. The contents of
11 11
  * this file is part of the Source Code of CKFinder.
12 12
  */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php5/Core/FolderHandler.php 3 patches
Indentation   +210 added lines, -210 removed lines patch added patch discarded remove patch
@@ -30,239 +30,239 @@
 block discarded – undo
30 30
  */
31 31
 class CKFinder_Connector_Core_FolderHandler
32 32
 {
33
-    /**
34
-     * CKFinder_Connector_Core_ResourceTypeConfig object
35
-     *
36
-     * @var CKFinder_Connector_Core_ResourceTypeConfig
37
-     * @access private
38
-     */
39
-    private $_resourceTypeConfig;
40
-    /**
41
-     * ResourceType name
42
-     *
43
-     * @var string
44
-     * @access private
45
-     */
46
-    private $_resourceTypeName = "";
47
-    /**
48
-     * Client path
49
-     *
50
-     * @var string
51
-     * @access private
52
-     */
53
-    private $_clientPath = "/";
54
-    /**
55
-     * Url
56
-     *
57
-     * @var string
58
-     * @access private
59
-     */
60
-    private $_url;
61
-    /**
62
-     * Server path
63
-     *
64
-     * @var string
65
-     * @access private
66
-     */
67
-    private $_serverPath;
68
-    /**
69
-     * Thumbnails server path
70
-     *
71
-     * @var string
72
-     * @access private
73
-     */
74
-    private $_thumbsServerPath;
75
-    /**
76
-     * ACL mask
77
-     *
78
-     * @var int
79
-     * @access private
80
-     */
81
-    private $_aclMask;
82
-    /**
83
-     * Folder info
84
-     *
85
-     * @var mixed
86
-     * @access private
87
-     */
88
-    private $_folderInfo;
89
-    /**
90
-     * Thumbnails folder info
91
-     *
92
-     * @var mized
93
-     * @access private
94
-     */
95
-    private $_thumbsFolderInfo;
33
+	/**
34
+	 * CKFinder_Connector_Core_ResourceTypeConfig object
35
+	 *
36
+	 * @var CKFinder_Connector_Core_ResourceTypeConfig
37
+	 * @access private
38
+	 */
39
+	private $_resourceTypeConfig;
40
+	/**
41
+	 * ResourceType name
42
+	 *
43
+	 * @var string
44
+	 * @access private
45
+	 */
46
+	private $_resourceTypeName = "";
47
+	/**
48
+	 * Client path
49
+	 *
50
+	 * @var string
51
+	 * @access private
52
+	 */
53
+	private $_clientPath = "/";
54
+	/**
55
+	 * Url
56
+	 *
57
+	 * @var string
58
+	 * @access private
59
+	 */
60
+	private $_url;
61
+	/**
62
+	 * Server path
63
+	 *
64
+	 * @var string
65
+	 * @access private
66
+	 */
67
+	private $_serverPath;
68
+	/**
69
+	 * Thumbnails server path
70
+	 *
71
+	 * @var string
72
+	 * @access private
73
+	 */
74
+	private $_thumbsServerPath;
75
+	/**
76
+	 * ACL mask
77
+	 *
78
+	 * @var int
79
+	 * @access private
80
+	 */
81
+	private $_aclMask;
82
+	/**
83
+	 * Folder info
84
+	 *
85
+	 * @var mixed
86
+	 * @access private
87
+	 */
88
+	private $_folderInfo;
89
+	/**
90
+	 * Thumbnails folder info
91
+	 *
92
+	 * @var mized
93
+	 * @access private
94
+	 */
95
+	private $_thumbsFolderInfo;
96 96
 
97
-    function __construct()
98
-    {
99
-        if (isset($_GET["type"])) {
100
-            $this->_resourceTypeName = (string)$_GET["type"];
101
-        }
97
+	function __construct()
98
+	{
99
+		if (isset($_GET["type"])) {
100
+			$this->_resourceTypeName = (string)$_GET["type"];
101
+		}
102 102
 
103
-        if (isset($_GET["currentFolder"])) {
104
-            $this->_clientPath = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding((string)$_GET["currentFolder"]);
105
-        }
103
+		if (isset($_GET["currentFolder"])) {
104
+			$this->_clientPath = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding((string)$_GET["currentFolder"]);
105
+		}
106 106
 
107
-        if (!strlen($this->_clientPath)) {
108
-            $this->_clientPath = "/";
109
-        }
110
-        else {
111
-            if (substr($this->_clientPath, -1, 1) != "/") {
112
-                $this->_clientPath .= "/";
113
-            }
114
-            if (substr($this->_clientPath, 0, 1) != "/") {
115
-                $this->_clientPath = "/" . $this->_clientPath;
116
-            }
117
-        }
107
+		if (!strlen($this->_clientPath)) {
108
+			$this->_clientPath = "/";
109
+		}
110
+		else {
111
+			if (substr($this->_clientPath, -1, 1) != "/") {
112
+				$this->_clientPath .= "/";
113
+			}
114
+			if (substr($this->_clientPath, 0, 1) != "/") {
115
+				$this->_clientPath = "/" . $this->_clientPath;
116
+			}
117
+		}
118 118
 
119
-        $this->_aclMask = -1;
120
-    }
119
+		$this->_aclMask = -1;
120
+	}
121 121
 
122
-    /**
123
-     * Get resource type config
124
-     *
125
-     * @return CKFinder_Connector_Core_ResourceTypeConfig
126
-     * @access public
127
-     */
128
-    public function &getResourceTypeConfig()
129
-    {
130
-        if (!isset($this->_resourceTypeConfig)) {
131
-            $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
132
-            $this->_resourceTypeConfig = $_config->getResourceTypeConfig($this->_resourceTypeName);
133
-        }
122
+	/**
123
+	 * Get resource type config
124
+	 *
125
+	 * @return CKFinder_Connector_Core_ResourceTypeConfig
126
+	 * @access public
127
+	 */
128
+	public function &getResourceTypeConfig()
129
+	{
130
+		if (!isset($this->_resourceTypeConfig)) {
131
+			$_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
132
+			$this->_resourceTypeConfig = $_config->getResourceTypeConfig($this->_resourceTypeName);
133
+		}
134 134
 
135
-        if (is_null($this->_resourceTypeConfig)) {
136
-            $connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
137
-            $oErrorHandler =& $connector->getErrorHandler();
138
-            $oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
139
-        }
135
+		if (is_null($this->_resourceTypeConfig)) {
136
+			$connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
137
+			$oErrorHandler =& $connector->getErrorHandler();
138
+			$oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
139
+		}
140 140
 
141
-        return $this->_resourceTypeConfig;
142
-    }
141
+		return $this->_resourceTypeConfig;
142
+	}
143 143
 
144
-    /**
145
-     * Get resource type name
146
-     *
147
-     * @return string
148
-     * @access public
149
-     */
150
-    public function getResourceTypeName()
151
-    {
152
-        return $this->_resourceTypeName;
153
-    }
144
+	/**
145
+	 * Get resource type name
146
+	 *
147
+	 * @return string
148
+	 * @access public
149
+	 */
150
+	public function getResourceTypeName()
151
+	{
152
+		return $this->_resourceTypeName;
153
+	}
154 154
 
155
-    /**
156
-     * Get Client path
157
-     *
158
-     * @return string
159
-     * @access public
160
-     */
161
-    public function getClientPath()
162
-    {
163
-        return $this->_clientPath;
164
-    }
155
+	/**
156
+	 * Get Client path
157
+	 *
158
+	 * @return string
159
+	 * @access public
160
+	 */
161
+	public function getClientPath()
162
+	{
163
+		return $this->_clientPath;
164
+	}
165 165
 
166
-    /**
167
-     * Get Url
168
-     *
169
-     * @return string
170
-     * @access public
171
-     */
172
-    public function getUrl()
173
-    {
174
-        if (is_null($this->_url)) {
175
-            $this->_resourceTypeConfig = $this->getResourceTypeConfig();
176
-            if (is_null($this->_resourceTypeConfig)) {
177
-                $connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
178
-                $oErrorHandler =& $connector->getErrorHandler();
179
-                $oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
180
-                $this->_url = "";
181
-            }
182
-            else {
183
-                $this->_url = $this->_resourceTypeConfig->getUrl() . ltrim($this->getClientPath(), "/");
184
-            }
185
-        }
166
+	/**
167
+	 * Get Url
168
+	 *
169
+	 * @return string
170
+	 * @access public
171
+	 */
172
+	public function getUrl()
173
+	{
174
+		if (is_null($this->_url)) {
175
+			$this->_resourceTypeConfig = $this->getResourceTypeConfig();
176
+			if (is_null($this->_resourceTypeConfig)) {
177
+				$connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
178
+				$oErrorHandler =& $connector->getErrorHandler();
179
+				$oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
180
+				$this->_url = "";
181
+			}
182
+			else {
183
+				$this->_url = $this->_resourceTypeConfig->getUrl() . ltrim($this->getClientPath(), "/");
184
+			}
185
+		}
186 186
 
187
-        return $this->_url;
188
-    }
187
+		return $this->_url;
188
+	}
189 189
 
190
-    /**
191
-     * Get server path
192
-     *
193
-     * @return string
194
-     * @access public
195
-     */
196
-    public function getServerPath()
197
-    {
198
-        if (is_null($this->_serverPath)) {
199
-            $this->_resourceTypeConfig = $this->getResourceTypeConfig();
200
-            $this->_serverPath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_resourceTypeConfig->getDirectory(), ltrim($this->_clientPath, "/"));
201
-        }
190
+	/**
191
+	 * Get server path
192
+	 *
193
+	 * @return string
194
+	 * @access public
195
+	 */
196
+	public function getServerPath()
197
+	{
198
+		if (is_null($this->_serverPath)) {
199
+			$this->_resourceTypeConfig = $this->getResourceTypeConfig();
200
+			$this->_serverPath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_resourceTypeConfig->getDirectory(), ltrim($this->_clientPath, "/"));
201
+		}
202 202
 
203
-        return $this->_serverPath;
204
-    }
203
+		return $this->_serverPath;
204
+	}
205 205
 
206
-    /**
207
-     * Get server path to thumbnails directory
208
-     *
209
-     * @access public
210
-     * @return string
211
-     */
212
-    public function getThumbsServerPath()
213
-    {
214
-        if (is_null($this->_thumbsServerPath)) {
215
-            $this->_resourceTypeConfig = $this->getResourceTypeConfig();
206
+	/**
207
+	 * Get server path to thumbnails directory
208
+	 *
209
+	 * @access public
210
+	 * @return string
211
+	 */
212
+	public function getThumbsServerPath()
213
+	{
214
+		if (is_null($this->_thumbsServerPath)) {
215
+			$this->_resourceTypeConfig = $this->getResourceTypeConfig();
216 216
 
217
-            $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
218
-            $_thumbnailsConfig = $_config->getThumbnailsConfig();
217
+			$_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
218
+			$_thumbnailsConfig = $_config->getThumbnailsConfig();
219 219
 
220
-            // Get the resource type directory.
221
-            $this->_thumbsServerPath = CKFinder_Connector_Utils_FileSystem::combinePaths($_thumbnailsConfig->getDirectory(), $this->_resourceTypeConfig->getName());
220
+			// Get the resource type directory.
221
+			$this->_thumbsServerPath = CKFinder_Connector_Utils_FileSystem::combinePaths($_thumbnailsConfig->getDirectory(), $this->_resourceTypeConfig->getName());
222 222
 
223
-            // Return the resource type directory combined with the required path.
224
-            $this->_thumbsServerPath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_thumbsServerPath, ltrim($this->_clientPath, '/'));
223
+			// Return the resource type directory combined with the required path.
224
+			$this->_thumbsServerPath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_thumbsServerPath, ltrim($this->_clientPath, '/'));
225 225
 
226
-            if (!is_dir($this->_thumbsServerPath)) {
227
-                if(!CKFinder_Connector_Utils_FileSystem::createDirectoryRecursively($this->_thumbsServerPath)) {
226
+			if (!is_dir($this->_thumbsServerPath)) {
227
+				if(!CKFinder_Connector_Utils_FileSystem::createDirectoryRecursively($this->_thumbsServerPath)) {
228 228
 
229
-                }
230
-            }
231
-        }
229
+				}
230
+			}
231
+		}
232 232
 
233
-        return $this->_thumbsServerPath;
234
-    }
233
+		return $this->_thumbsServerPath;
234
+	}
235 235
 
236
-    /**
237
-     * Get ACL Mask
238
-     *
239
-     * @return int
240
-     * @access public
241
-     */
242
-    public function getAclMask()
243
-    {
244
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
245
-        $_aclConfig = $_config->getAccessControlConfig();
236
+	/**
237
+	 * Get ACL Mask
238
+	 *
239
+	 * @return int
240
+	 * @access public
241
+	 */
242
+	public function getAclMask()
243
+	{
244
+		$_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
245
+		$_aclConfig = $_config->getAccessControlConfig();
246 246
 
247
-        if ($this->_aclMask == -1) {
248
-            $this->_aclMask = $_aclConfig->getComputedMask($this->_resourceTypeName, $this->_clientPath);
249
-        }
247
+		if ($this->_aclMask == -1) {
248
+			$this->_aclMask = $_aclConfig->getComputedMask($this->_resourceTypeName, $this->_clientPath);
249
+		}
250 250
 
251
-        return $this->_aclMask;
252
-    }
251
+		return $this->_aclMask;
252
+	}
253 253
 
254
-    /**
255
-     * Check ACL
256
-     *
257
-     * @access public
258
-     * @param int $aclToCkeck
259
-     * @return boolean
260
-     */
261
-    public function checkAcl($aclToCkeck)
262
-    {
263
-        $aclToCkeck = intval($aclToCkeck);
254
+	/**
255
+	 * Check ACL
256
+	 *
257
+	 * @access public
258
+	 * @param int $aclToCkeck
259
+	 * @return boolean
260
+	 */
261
+	public function checkAcl($aclToCkeck)
262
+	{
263
+		$aclToCkeck = intval($aclToCkeck);
264 264
 
265
-        $maska = $this->getAclMask();
266
-        return (($maska & $aclToCkeck) == $aclToCkeck);
267
-    }
265
+		$maska = $this->getAclMask();
266
+		return (($maska & $aclToCkeck) == $aclToCkeck);
267
+	}
268 268
 }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 /**
22 22
  * Include file system utils class
23 23
  */
24
-require_once CKFINDER_CONNECTOR_LIB_DIR . "/Utils/FileSystem.php";
24
+require_once CKFINDER_CONNECTOR_LIB_DIR."/Utils/FileSystem.php";
25 25
 
26 26
 /**
27 27
  * @package CKFinder
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                 $this->_clientPath .= "/";
113 113
             }
114 114
             if (substr($this->_clientPath, 0, 1) != "/") {
115
-                $this->_clientPath = "/" . $this->_clientPath;
115
+                $this->_clientPath = "/".$this->_clientPath;
116 116
             }
117 117
         }
118 118
 
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
     function &getResourceTypeConfig()
129 129
     {
130 130
         if (!isset($this->_resourceTypeConfig)) {
131
-            $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
131
+            $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config");
132 132
             $this->_resourceTypeConfig = $_config->getResourceTypeConfig($this->_resourceTypeName);
133 133
         }
134 134
 
135 135
         if (is_null($this->_resourceTypeConfig)) {
136
-            $connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
137
-            $oErrorHandler =& $connector->getErrorHandler();
136
+            $connector = & CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
137
+            $oErrorHandler = & $connector->getErrorHandler();
138 138
             $oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
139 139
         }
140 140
 
@@ -174,13 +174,13 @@  discard block
 block discarded – undo
174 174
         if (is_null($this->_url)) {
175 175
             $this->_resourceTypeConfig = $this->getResourceTypeConfig();
176 176
             if (is_null($this->_resourceTypeConfig)) {
177
-                $connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
178
-                $oErrorHandler =& $connector->getErrorHandler();
177
+                $connector = & CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
178
+                $oErrorHandler = & $connector->getErrorHandler();
179 179
                 $oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
180 180
                 $this->_url = "";
181 181
             }
182 182
             else {
183
-                $this->_url = $this->_resourceTypeConfig->getUrl() . ltrim($this->getClientPath(), "/");
183
+                $this->_url = $this->_resourceTypeConfig->getUrl().ltrim($this->getClientPath(), "/");
184 184
             }
185 185
         }
186 186
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         if (is_null($this->_thumbsServerPath)) {
215 215
             $this->_resourceTypeConfig = $this->getResourceTypeConfig();
216 216
 
217
-            $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
217
+            $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config");
218 218
             $_thumbnailsConfig = $_config->getThumbnailsConfig();
219 219
 
220 220
             // Get the resource type directory.
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
             $this->_thumbsServerPath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_thumbsServerPath, ltrim($this->_clientPath, '/'));
225 225
 
226 226
             if (!is_dir($this->_thumbsServerPath)) {
227
-                if(!CKFinder_Connector_Utils_FileSystem::createDirectoryRecursively($this->_thumbsServerPath)) {
227
+                if (!CKFinder_Connector_Utils_FileSystem::createDirectoryRecursively($this->_thumbsServerPath)) {
228 228
 
229 229
                 }
230 230
             }
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
      */
242 242
     function getAclMask()
243 243
     {
244
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
244
+        $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config");
245 245
         $_aclConfig = $_config->getAccessControlConfig();
246 246
 
247 247
         if ($this->_aclMask == -1) {
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@  discard block
 block discarded – undo
10 10
  * modifying or distribute this file or part of its contents. The contents of
11 11
  * this file is part of the Source Code of CKFinder.
12 12
  */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
@@ -106,8 +108,7 @@  discard block
 block discarded – undo
106 108
 
107 109
         if (!strlen($this->_clientPath)) {
108 110
             $this->_clientPath = "/";
109
-        }
110
-        else {
111
+        } else {
111 112
             if (substr($this->_clientPath, -1, 1) != "/") {
112 113
                 $this->_clientPath .= "/";
113 114
             }
@@ -178,8 +179,7 @@  discard block
 block discarded – undo
178 179
                 $oErrorHandler =& $connector->getErrorHandler();
179 180
                 $oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
180 181
                 $this->_url = "";
181
-            }
182
-            else {
182
+            } else {
183 183
                 $this->_url = $this->_resourceTypeConfig->getUrl() . ltrim($this->getClientPath(), "/");
184 184
             }
185 185
         }
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php5/Core/ThumbnailsConfig.php 3 patches
Indentation   +163 added lines, -163 removed lines patch added patch discarded remove patch
@@ -28,193 +28,193 @@
 block discarded – undo
28 28
 class CKFinder_Connector_Core_ThumbnailsConfig
29 29
 {
30 30
 
31
-    /**
32
-     * Url to thumbnails directory
33
-     *
34
-     * @var string
35
-     * @access private
36
-     */
37
-    private $_url = "";
38
-    /**
31
+	/**
32
+	 * Url to thumbnails directory
33
+	 *
34
+	 * @var string
35
+	 * @access private
36
+	 */
37
+	private $_url = "";
38
+	/**
39 39
 	 * Directory where thumbnails are stored
40 40
 	 *
41 41
 	 * @var string
42 42
 	 * @access private
43 43
 	 */
44
-    private $_directory = "";
45
-    /**
44
+	private $_directory = "";
45
+	/**
46 46
 	 * Are thumbnails enabled
47 47
 	 *
48 48
 	 * @var boolean
49 49
 	 * @access private
50 50
 	 */
51
-    private $_isEnabled = false;
52
-    /**
51
+	private $_isEnabled = false;
52
+	/**
53 53
 	 * Direct access to thumbnails?
54 54
 	 *
55 55
 	 * @var boolean
56 56
 	 * @access private
57 57
 	 */
58
-    private $_directAccess = false;
59
-    /**
60
-     * Max width for thumbnails
61
-     *
62
-     * @var int
63
-     * @access private
64
-     */
65
-    private $_maxWidth = 100;
66
-    /**
67
-     * Max height for thumbnails
68
-     *
69
-     * @var int
70
-     * @access private
71
-     */
72
-    private $_maxHeight = 100;
73
-    /**
74
-     * Quality of thumbnails
75
-     *
76
-     * @var int
77
-     * @access private
78
-     */
79
-    private $_quality = 100;
80
-    /**
81
-     * Are thumbnails of bitmap files enabled?
82
-     *
83
-     * @var boolean
84
-     * @access private
85
-     */
86
-    private $_bmpSupported = false;
58
+	private $_directAccess = false;
59
+	/**
60
+	 * Max width for thumbnails
61
+	 *
62
+	 * @var int
63
+	 * @access private
64
+	 */
65
+	private $_maxWidth = 100;
66
+	/**
67
+	 * Max height for thumbnails
68
+	 *
69
+	 * @var int
70
+	 * @access private
71
+	 */
72
+	private $_maxHeight = 100;
73
+	/**
74
+	 * Quality of thumbnails
75
+	 *
76
+	 * @var int
77
+	 * @access private
78
+	 */
79
+	private $_quality = 100;
80
+	/**
81
+	 * Are thumbnails of bitmap files enabled?
82
+	 *
83
+	 * @var boolean
84
+	 * @access private
85
+	 */
86
+	private $_bmpSupported = false;
87 87
 
88
-    function __construct($thumbnailsNode)
89
-    {
90
-        if(extension_loaded('gd') && isset($thumbnailsNode['enabled'])) {
91
-            $this->_isEnabled = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['enabled']);
92
-        }
93
-        if( isset($thumbnailsNode['directAccess'])) {
94
-            $this->_directAccess = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['directAccess']);
95
-        }
96
-        if( isset($thumbnailsNode['bmpSupported'])) {
97
-            $this->_bmpSupported = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['bmpSupported']);
98
-        }
99
-        if(isset($thumbnailsNode['maxWidth'])) {
100
-            $_maxWidth = intval($thumbnailsNode['maxWidth']);
101
-            if($_maxWidth>=0) {
102
-                $this->_maxWidth = $_maxWidth;
103
-            }
104
-        }
105
-        if(isset($thumbnailsNode['maxHeight'])) {
106
-            $_maxHeight = intval($thumbnailsNode['maxHeight']);
107
-            if($_maxHeight>=0) {
108
-                $this->_maxHeight = $_maxHeight;
109
-            }
110
-        }
111
-        if(isset($thumbnailsNode['quality'])) {
112
-            $_quality = intval($thumbnailsNode['quality']);
113
-            if($_quality>0 && $_quality<=100) {
114
-                $this->_quality = $_quality;
115
-            }
116
-        }
88
+	function __construct($thumbnailsNode)
89
+	{
90
+		if(extension_loaded('gd') && isset($thumbnailsNode['enabled'])) {
91
+			$this->_isEnabled = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['enabled']);
92
+		}
93
+		if( isset($thumbnailsNode['directAccess'])) {
94
+			$this->_directAccess = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['directAccess']);
95
+		}
96
+		if( isset($thumbnailsNode['bmpSupported'])) {
97
+			$this->_bmpSupported = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['bmpSupported']);
98
+		}
99
+		if(isset($thumbnailsNode['maxWidth'])) {
100
+			$_maxWidth = intval($thumbnailsNode['maxWidth']);
101
+			if($_maxWidth>=0) {
102
+				$this->_maxWidth = $_maxWidth;
103
+			}
104
+		}
105
+		if(isset($thumbnailsNode['maxHeight'])) {
106
+			$_maxHeight = intval($thumbnailsNode['maxHeight']);
107
+			if($_maxHeight>=0) {
108
+				$this->_maxHeight = $_maxHeight;
109
+			}
110
+		}
111
+		if(isset($thumbnailsNode['quality'])) {
112
+			$_quality = intval($thumbnailsNode['quality']);
113
+			if($_quality>0 && $_quality<=100) {
114
+				$this->_quality = $_quality;
115
+			}
116
+		}
117 117
 
118
-        if(isset($thumbnailsNode['url'])) {
119
-            $this->_url = $thumbnailsNode['url'];
120
-        }
121
-        if (!strlen($this->_url)) {
122
-            $this->_url = "/";
123
-        }
124
-        else if(substr($this->_url,-1,1) != "/") {
125
-            $this->_url .= "/";
126
-        }
118
+		if(isset($thumbnailsNode['url'])) {
119
+			$this->_url = $thumbnailsNode['url'];
120
+		}
121
+		if (!strlen($this->_url)) {
122
+			$this->_url = "/";
123
+		}
124
+		else if(substr($this->_url,-1,1) != "/") {
125
+			$this->_url .= "/";
126
+		}
127 127
 
128
-        if(isset($thumbnailsNode['directory'])) {
129
-            $this->_directory = $thumbnailsNode['directory'];
130
-        }
131
-    }
128
+		if(isset($thumbnailsNode['directory'])) {
129
+			$this->_directory = $thumbnailsNode['directory'];
130
+		}
131
+	}
132 132
 
133
-    /**
134
-     * Get URL
135
-     *
136
-     * @access public
137
-     * @return string
138
-     */
139
-    public function getUrl()
140
-    {
141
-        return $this->_url;
142
-    }
133
+	/**
134
+	 * Get URL
135
+	 *
136
+	 * @access public
137
+	 * @return string
138
+	 */
139
+	public function getUrl()
140
+	{
141
+		return $this->_url;
142
+	}
143 143
 
144
-    /**
145
-     * Get directory
146
-     *
147
-     * @access public
148
-     * @return string
149
-     */
150
-    public function getDirectory()
151
-    {
152
-        return $this->_directory;
153
-    }
144
+	/**
145
+	 * Get directory
146
+	 *
147
+	 * @access public
148
+	 * @return string
149
+	 */
150
+	public function getDirectory()
151
+	{
152
+		return $this->_directory;
153
+	}
154 154
 
155
-    /**
156
-     * Get is enabled setting
157
-     *
158
-     * @access public
159
-     * @return boolean
160
-     */
161
-    public function getIsEnabled()
162
-    {
163
-        return $this->_isEnabled;
164
-    }
155
+	/**
156
+	 * Get is enabled setting
157
+	 *
158
+	 * @access public
159
+	 * @return boolean
160
+	 */
161
+	public function getIsEnabled()
162
+	{
163
+		return $this->_isEnabled;
164
+	}
165 165
 
166
-    /**
167
-     * Get is enabled setting
168
-     *
169
-     * @access public
170
-     * @return boolean
171
-     */
172
-    public function getBmpSupported()
173
-    {
174
-        return $this->_bmpSupported;
175
-    }
166
+	/**
167
+	 * Get is enabled setting
168
+	 *
169
+	 * @access public
170
+	 * @return boolean
171
+	 */
172
+	public function getBmpSupported()
173
+	{
174
+		return $this->_bmpSupported;
175
+	}
176 176
 
177
-    /**
178
-     * Is direct access to thumbnails allowed?
179
-     *
180
-     * @access public
181
-     * @return boolean
182
-     */
183
-    public function getDirectAccess()
184
-    {
185
-        return $this->_directAccess;
186
-    }
177
+	/**
178
+	 * Is direct access to thumbnails allowed?
179
+	 *
180
+	 * @access public
181
+	 * @return boolean
182
+	 */
183
+	public function getDirectAccess()
184
+	{
185
+		return $this->_directAccess;
186
+	}
187 187
 
188
-    /**
189
-     * Get maximum width of a thumbnail
190
-     *
191
-     * @access public
192
-     * @return int
193
-     */
194
-    public function getMaxWidth()
195
-    {
196
-        return $this->_maxWidth;
197
-    }
188
+	/**
189
+	 * Get maximum width of a thumbnail
190
+	 *
191
+	 * @access public
192
+	 * @return int
193
+	 */
194
+	public function getMaxWidth()
195
+	{
196
+		return $this->_maxWidth;
197
+	}
198 198
 
199
-    /**
200
-     * Get maximum height of a thumbnail
201
-     *
202
-     * @access public
203
-     * @return int
204
-     */
205
-    public function getMaxHeight()
206
-    {
207
-        return $this->_maxHeight;
208
-    }
199
+	/**
200
+	 * Get maximum height of a thumbnail
201
+	 *
202
+	 * @access public
203
+	 * @return int
204
+	 */
205
+	public function getMaxHeight()
206
+	{
207
+		return $this->_maxHeight;
208
+	}
209 209
 
210
-    /**
211
-     * Get quality of a thumbnail (1-100)
212
-     *
213
-     * @access public
214
-     * @return int
215
-     */
216
-    public function getQuality()
217
-    {
218
-        return $this->_quality;
219
-    }
210
+	/**
211
+	 * Get quality of a thumbnail (1-100)
212
+	 *
213
+	 * @access public
214
+	 * @return int
215
+	 */
216
+	public function getQuality()
217
+	{
218
+		return $this->_quality;
219
+	}
220 220
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -87,45 +87,45 @@
 block discarded – undo
87 87
 
88 88
     function CKFinder_Connector_Core_ThumbnailsConfig($thumbnailsNode)
89 89
     {
90
-        if(extension_loaded('gd') && isset($thumbnailsNode['enabled'])) {
90
+        if (extension_loaded('gd') && isset($thumbnailsNode['enabled'])) {
91 91
             $this->_isEnabled = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['enabled']);
92 92
         }
93
-        if( isset($thumbnailsNode['directAccess'])) {
93
+        if (isset($thumbnailsNode['directAccess'])) {
94 94
             $this->_directAccess = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['directAccess']);
95 95
         }
96
-        if( isset($thumbnailsNode['bmpSupported'])) {
96
+        if (isset($thumbnailsNode['bmpSupported'])) {
97 97
             $this->_bmpSupported = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['bmpSupported']);
98 98
         }
99
-        if(isset($thumbnailsNode['maxWidth'])) {
99
+        if (isset($thumbnailsNode['maxWidth'])) {
100 100
             $_maxWidth = intval($thumbnailsNode['maxWidth']);
101
-            if($_maxWidth>=0) {
101
+            if ($_maxWidth >= 0) {
102 102
                 $this->_maxWidth = $_maxWidth;
103 103
             }
104 104
         }
105
-        if(isset($thumbnailsNode['maxHeight'])) {
105
+        if (isset($thumbnailsNode['maxHeight'])) {
106 106
             $_maxHeight = intval($thumbnailsNode['maxHeight']);
107
-            if($_maxHeight>=0) {
107
+            if ($_maxHeight >= 0) {
108 108
                 $this->_maxHeight = $_maxHeight;
109 109
             }
110 110
         }
111
-        if(isset($thumbnailsNode['quality'])) {
111
+        if (isset($thumbnailsNode['quality'])) {
112 112
             $_quality = intval($thumbnailsNode['quality']);
113
-            if($_quality>0 && $_quality<=100) {
113
+            if ($_quality > 0 && $_quality <= 100) {
114 114
                 $this->_quality = $_quality;
115 115
             }
116 116
         }
117 117
 
118
-        if(isset($thumbnailsNode['url'])) {
118
+        if (isset($thumbnailsNode['url'])) {
119 119
             $this->_url = $thumbnailsNode['url'];
120 120
         }
121 121
         if (!strlen($this->_url)) {
122 122
             $this->_url = "/";
123 123
         }
124
-        else if(substr($this->_url,-1,1) != "/") {
124
+        else if (substr($this->_url, -1, 1) != "/") {
125 125
             $this->_url .= "/";
126 126
         }
127 127
 
128
-        if(isset($thumbnailsNode['directory'])) {
128
+        if (isset($thumbnailsNode['directory'])) {
129 129
             $this->_directory = $thumbnailsNode['directory'];
130 130
         }
131 131
     }
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@  discard block
 block discarded – undo
10 10
 * modifying or distribute this file or part of its contents. The contents of
11 11
 * this file is part of the Source Code of CKFinder.
12 12
 */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
@@ -120,8 +122,7 @@  discard block
 block discarded – undo
120 122
         }
121 123
         if (!strlen($this->_url)) {
122 124
             $this->_url = "/";
123
-        }
124
-        else if(substr($this->_url,-1,1) != "/") {
125
+        } else if(substr($this->_url,-1,1) != "/") {
125 126
             $this->_url .= "/";
126 127
         }
127 128
 
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php5/Core/Xml.php 3 patches
Indentation   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -32,99 +32,99 @@
 block discarded – undo
32 32
  */
33 33
 class CKFinder_Connector_Core_Xml
34 34
 {
35
-    /**
36
-     * Connector node (root)
37
-     *
38
-     * @var Ckfinder_Connector_Utils_XmlNode
39
-     * @access private
40
-     */
41
-    private $_connectorNode;
42
-    /**
43
-     * Error node
44
-     *
45
-     * @var Ckfinder_Connector_Utils_XmlNode
46
-     * @access private
47
-     */
48
-    private $_errorNode;
35
+	/**
36
+	 * Connector node (root)
37
+	 *
38
+	 * @var Ckfinder_Connector_Utils_XmlNode
39
+	 * @access private
40
+	 */
41
+	private $_connectorNode;
42
+	/**
43
+	 * Error node
44
+	 *
45
+	 * @var Ckfinder_Connector_Utils_XmlNode
46
+	 * @access private
47
+	 */
48
+	private $_errorNode;
49 49
 
50
-    function __construct()
51
-    {
52
-        $this->sendXmlHeaders();
53
-        echo $this->getXMLDeclaration();
54
-        $this->_connectorNode = new Ckfinder_Connector_Utils_XmlNode("Connector");
55
-        $this->_errorNode = new Ckfinder_Connector_Utils_XmlNode("Error");
56
-        $this->_connectorNode->addChild($this->_errorNode);
57
-    }
50
+	function __construct()
51
+	{
52
+		$this->sendXmlHeaders();
53
+		echo $this->getXMLDeclaration();
54
+		$this->_connectorNode = new Ckfinder_Connector_Utils_XmlNode("Connector");
55
+		$this->_errorNode = new Ckfinder_Connector_Utils_XmlNode("Error");
56
+		$this->_connectorNode->addChild($this->_errorNode);
57
+	}
58 58
 
59
-    /**
60
-     * Return connector node
61
-     *
62
-     * @return Ckfinder_Connector_Utils_XmlNode
63
-     * @access public
64
-     */
65
-    public function &getConnectorNode()
66
-    {
67
-    	return $this->_connectorNode;
68
-    }
59
+	/**
60
+	 * Return connector node
61
+	 *
62
+	 * @return Ckfinder_Connector_Utils_XmlNode
63
+	 * @access public
64
+	 */
65
+	public function &getConnectorNode()
66
+	{
67
+		return $this->_connectorNode;
68
+	}
69 69
 
70
-    /**
71
-     * Return error node
72
-     *
73
-     * @return Ckfinder_Connector_Utils_XmlNode
74
-     * @access public
75
-     */
76
-    public function &getErrorNode()
77
-    {
78
-    	return $this->_errorNode;
79
-    }
70
+	/**
71
+	 * Return error node
72
+	 *
73
+	 * @return Ckfinder_Connector_Utils_XmlNode
74
+	 * @access public
75
+	 */
76
+	public function &getErrorNode()
77
+	{
78
+		return $this->_errorNode;
79
+	}
80 80
 
81
-    /**
82
-     * Send XML headers to the browser (and force browser not to use cache)
83
-     * @access private
84
-     */
85
-    private function sendXmlHeaders()
86
-    {
87
-        // Prevent the browser from caching the result.
88
-        // Date in the past
89
-        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT') ;
90
-        // always modified
91
-        header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT') ;
92
-        // HTTP/1.1
93
-        header('Cache-Control: no-store, no-cache, must-revalidate') ;
94
-        header('Cache-Control: post-check=0, pre-check=0', false) ;
95
-        // HTTP/1.0
96
-        header('Pragma: no-cache') ;
81
+	/**
82
+	 * Send XML headers to the browser (and force browser not to use cache)
83
+	 * @access private
84
+	 */
85
+	private function sendXmlHeaders()
86
+	{
87
+		// Prevent the browser from caching the result.
88
+		// Date in the past
89
+		header('Expires: Mon, 26 Jul 1997 05:00:00 GMT') ;
90
+		// always modified
91
+		header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT') ;
92
+		// HTTP/1.1
93
+		header('Cache-Control: no-store, no-cache, must-revalidate') ;
94
+		header('Cache-Control: post-check=0, pre-check=0', false) ;
95
+		// HTTP/1.0
96
+		header('Pragma: no-cache') ;
97 97
 
98
-        // Set the response format.
99
-        header( 'Content-Type:text/xml; charset=utf-8' ) ;
100
-    }
98
+		// Set the response format.
99
+		header( 'Content-Type:text/xml; charset=utf-8' ) ;
100
+	}
101 101
 
102
-    /**
103
-     * Return XML declaration
104
-     *
105
-     * @access private
106
-     * @return string
107
-     */
108
-    private function getXMLDeclaration()
109
-    {
110
-    	return '<?xml version="1.0" encoding="utf-8"?>';
111
-    }
102
+	/**
103
+	 * Return XML declaration
104
+	 *
105
+	 * @access private
106
+	 * @return string
107
+	 */
108
+	private function getXMLDeclaration()
109
+	{
110
+		return '<?xml version="1.0" encoding="utf-8"?>';
111
+	}
112 112
 
113
-    /**
114
-     * Send error message to the browser. If error number is set to 1, $text (custom error message) will be displayed
115
-     * Don't call this function directly
116
-     *
117
-     * @access public
118
-     * @param int $number error number
119
-     * @param string $text Custom error message (optional)
120
-     */
121
-    public function raiseError( $number, $text = false)
122
-    {
123
-        $this->_errorNode->addAttribute("number", intval($number));
124
-        if (false!=$text) {
125
-            $this->_errorNode->addAttribute("text", $text);
126
-        }
113
+	/**
114
+	 * Send error message to the browser. If error number is set to 1, $text (custom error message) will be displayed
115
+	 * Don't call this function directly
116
+	 *
117
+	 * @access public
118
+	 * @param int $number error number
119
+	 * @param string $text Custom error message (optional)
120
+	 */
121
+	public function raiseError( $number, $text = false)
122
+	{
123
+		$this->_errorNode->addAttribute("number", intval($number));
124
+		if (false!=$text) {
125
+			$this->_errorNode->addAttribute("text", $text);
126
+		}
127 127
 
128
-        echo $this->_connectorNode->asXML();
129
-    }
128
+		echo $this->_connectorNode->asXML();
129
+	}
130 130
 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 /**
22 22
  * Include basic Xml library
23 23
  */
24
-require_once CKFINDER_CONNECTOR_LIB_DIR . "/Utils/XmlNode.php";
24
+require_once CKFINDER_CONNECTOR_LIB_DIR."/Utils/XmlNode.php";
25 25
 
26 26
 /**
27 27
  * XML document
@@ -86,17 +86,17 @@  discard block
 block discarded – undo
86 86
     {
87 87
         // Prevent the browser from caching the result.
88 88
         // Date in the past
89
-        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT') ;
89
+        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
90 90
         // always modified
91
-        header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT') ;
91
+        header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
92 92
         // HTTP/1.1
93
-        header('Cache-Control: no-store, no-cache, must-revalidate') ;
94
-        header('Cache-Control: post-check=0, pre-check=0', false) ;
93
+        header('Cache-Control: no-store, no-cache, must-revalidate');
94
+        header('Cache-Control: post-check=0, pre-check=0', false);
95 95
         // HTTP/1.0
96
-        header('Pragma: no-cache') ;
96
+        header('Pragma: no-cache');
97 97
 
98 98
         // Set the response format.
99
-        header( 'Content-Type:text/xml; charset=utf-8' ) ;
99
+        header('Content-Type:text/xml; charset=utf-8');
100 100
     }
101 101
 
102 102
     /**
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
      * @param int $number error number
119 119
      * @param string $text Custom error message (optional)
120 120
      */
121
-    public function raiseError( $number, $text = false)
121
+    public function raiseError($number, $text = false)
122 122
     {
123 123
         $this->_errorNode->addAttribute("number", intval($number));
124
-        if (false!=$text) {
124
+        if (false != $text) {
125 125
             $this->_errorNode->addAttribute("text", $text);
126 126
         }
127 127
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@
 block discarded – undo
10 10
  * modifying or distribute this file or part of its contents. The contents of
11 11
  * this file is part of the Source Code of CKFinder.
12 12
  */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php5/Core/Connector.php 3 patches
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -27,94 +27,94 @@
 block discarded – undo
27 27
  */
28 28
 class CKFinder_Connector_Core_Connector
29 29
 {
30
-    /**
31
-     * Registry
32
-     *
33
-     * @var CKFinder_Connector_Core_Registry
34
-     * @access private
35
-     */
36
-    private $_registry;
30
+	/**
31
+	 * Registry
32
+	 *
33
+	 * @var CKFinder_Connector_Core_Registry
34
+	 * @access private
35
+	 */
36
+	private $_registry;
37 37
 
38
-    function __construct()
39
-    {
40
-        $this->_registry =& CKFinder_Connector_Core_Factory::getInstance("Core_Registry");
41
-        $this->_registry->set("errorHandler", "ErrorHandler_Base");
42
-    }
38
+	function __construct()
39
+	{
40
+		$this->_registry =& CKFinder_Connector_Core_Factory::getInstance("Core_Registry");
41
+		$this->_registry->set("errorHandler", "ErrorHandler_Base");
42
+	}
43 43
 
44
-    /**
45
-     * Generic handler for invalid commands
46
-     * @access public
47
-     *
48
-     */
49
-    public function handleInvalidCommand()
50
-    {
51
-        $oErrorHandler =& $this->getErrorHandler();
52
-        $oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_COMMAND);
53
-    }
44
+	/**
45
+	 * Generic handler for invalid commands
46
+	 * @access public
47
+	 *
48
+	 */
49
+	public function handleInvalidCommand()
50
+	{
51
+		$oErrorHandler =& $this->getErrorHandler();
52
+		$oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_COMMAND);
53
+	}
54 54
 
55
-    /**
56
-     * Execute command
57
-     *
58
-     * @param string $command
59
-     * @access public
60
-     */
61
-    public function executeCommand($command)
62
-    {
63
-        if (!CKFinder_Connector_Core_Hooks::run('BeforeExecuteCommand', array(&$command))) {
64
-            return;
65
-        }
55
+	/**
56
+	 * Execute command
57
+	 *
58
+	 * @param string $command
59
+	 * @access public
60
+	 */
61
+	public function executeCommand($command)
62
+	{
63
+		if (!CKFinder_Connector_Core_Hooks::run('BeforeExecuteCommand', array(&$command))) {
64
+			return;
65
+		}
66 66
 
67
-        switch ($command)
68
-        {
69
-            case 'FileUpload':
70
-            $this->_registry->set("errorHandler", "ErrorHandler_FileUpload");
71
-            $obj =& CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command);
72
-            $obj->sendResponse();
73
-            break;
67
+		switch ($command)
68
+		{
69
+			case 'FileUpload':
70
+			$this->_registry->set("errorHandler", "ErrorHandler_FileUpload");
71
+			$obj =& CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command);
72
+			$obj->sendResponse();
73
+			break;
74 74
 
75
-            case 'QuickUpload':
76
-            $this->_registry->set("errorHandler", "ErrorHandler_QuickUpload");
77
-            $obj =& CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command);
78
-            $obj->sendResponse();
79
-            break;
75
+			case 'QuickUpload':
76
+			$this->_registry->set("errorHandler", "ErrorHandler_QuickUpload");
77
+			$obj =& CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command);
78
+			$obj->sendResponse();
79
+			break;
80 80
 
81
-            case 'DownloadFile':
82
-            case 'Thumbnail':
83
-            $this->_registry->set("errorHandler", "ErrorHandler_Http");
84
-            $obj =& CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command);
85
-            $obj->sendResponse();
86
-            break;
81
+			case 'DownloadFile':
82
+			case 'Thumbnail':
83
+			$this->_registry->set("errorHandler", "ErrorHandler_Http");
84
+			$obj =& CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command);
85
+			$obj->sendResponse();
86
+			break;
87 87
 
88
-            case 'CopyFiles':
89
-            case 'CreateFolder':
90
-            case 'DeleteFile':
91
-            case 'DeleteFolder':
92
-            case 'GetFiles':
93
-            case 'GetFolders':
94
-            case 'Init':
95
-            case 'MoveFiles':
96
-            case 'RenameFile':
97
-            case 'RenameFolder':
98
-            $obj =& CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command);
99
-            $obj->sendResponse();
100
-            break;
88
+			case 'CopyFiles':
89
+			case 'CreateFolder':
90
+			case 'DeleteFile':
91
+			case 'DeleteFolder':
92
+			case 'GetFiles':
93
+			case 'GetFolders':
94
+			case 'Init':
95
+			case 'MoveFiles':
96
+			case 'RenameFile':
97
+			case 'RenameFolder':
98
+			$obj =& CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command);
99
+			$obj->sendResponse();
100
+			break;
101 101
 
102
-            default:
103
-            $this->handleInvalidCommand();
104
-            break;
105
-        }
106
-    }
102
+			default:
103
+			$this->handleInvalidCommand();
104
+			break;
105
+		}
106
+	}
107 107
 
108
-    /**
109
-     * Get error handler
110
-     *
111
-     * @access public
112
-     * @return CKFinder_Connector_ErrorHandler_Base|CKFinder_Connector_ErrorHandler_FileUpload|CKFinder_Connector_ErrorHandler_Http
113
-     */
114
-    public function &getErrorHandler()
115
-    {
116
-        $_errorHandler = $this->_registry->get("errorHandler");
117
-        $oErrorHandler =& CKFinder_Connector_Core_Factory::getInstance($_errorHandler);
118
-        return $oErrorHandler;
119
-    }
108
+	/**
109
+	 * Get error handler
110
+	 *
111
+	 * @access public
112
+	 * @return CKFinder_Connector_ErrorHandler_Base|CKFinder_Connector_ErrorHandler_FileUpload|CKFinder_Connector_ErrorHandler_Http
113
+	 */
114
+	public function &getErrorHandler()
115
+	{
116
+		$_errorHandler = $this->_registry->get("errorHandler");
117
+		$oErrorHandler =& CKFinder_Connector_Core_Factory::getInstance($_errorHandler);
118
+		return $oErrorHandler;
119
+	}
120 120
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
     function CKFinder_Connector_Core_Connector()
39 39
     {
40
-        $this->_registry =& CKFinder_Connector_Core_Factory::getInstance("Core_Registry");
40
+        $this->_registry = & CKFinder_Connector_Core_Factory::getInstance("Core_Registry");
41 41
         $this->_registry->set("errorHandler", "ErrorHandler_Base");
42 42
     }
43 43
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     function handleInvalidCommand()
50 50
     {
51
-        $oErrorHandler =& $this->getErrorHandler();
51
+        $oErrorHandler = & $this->getErrorHandler();
52 52
         $oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_COMMAND);
53 53
     }
54 54
 
@@ -68,20 +68,20 @@  discard block
 block discarded – undo
68 68
         {
69 69
             case 'FileUpload':
70 70
             $this->_registry->set("errorHandler", "ErrorHandler_FileUpload");
71
-            $obj =& CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command);
71
+            $obj = & CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command);
72 72
             $obj->sendResponse();
73 73
             break;
74 74
 
75 75
             case 'QuickUpload':
76 76
             $this->_registry->set("errorHandler", "ErrorHandler_QuickUpload");
77
-            $obj =& CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command);
77
+            $obj = & CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command);
78 78
             $obj->sendResponse();
79 79
             break;
80 80
 
81 81
             case 'DownloadFile':
82 82
             case 'Thumbnail':
83 83
             $this->_registry->set("errorHandler", "ErrorHandler_Http");
84
-            $obj =& CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command);
84
+            $obj = & CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command);
85 85
             $obj->sendResponse();
86 86
             break;
87 87
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             case 'MoveFiles':
96 96
             case 'RenameFile':
97 97
             case 'RenameFolder':
98
-            $obj =& CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command);
98
+            $obj = & CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command);
99 99
             $obj->sendResponse();
100 100
             break;
101 101
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     function &getErrorHandler()
115 115
     {
116 116
         $_errorHandler = $this->_registry->get("errorHandler");
117
-        $oErrorHandler =& CKFinder_Connector_Core_Factory::getInstance($_errorHandler);
117
+        $oErrorHandler = & CKFinder_Connector_Core_Factory::getInstance($_errorHandler);
118 118
         return $oErrorHandler;
119 119
     }
120 120
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@
 block discarded – undo
10 10
  * modifying or distribute this file or part of its contents. The contents of
11 11
  * this file is part of the Source Code of CKFinder.
12 12
  */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php5/Core/AccessControlConfig.php 3 patches
Indentation   +182 added lines, -182 removed lines patch added patch discarded remove patch
@@ -40,186 +40,186 @@
 block discarded – undo
40 40
 class CKFinder_Connector_Core_AccessControlConfig
41 41
 {
42 42
 
43
-    /**
44
-     * array with ACL entries
45
-     *
46
-     * @var array[string]string
47
-     * @access private
48
-     */
49
-    private $_aclEntries = array();
50
-
51
-    function __construct($accessControlNodes)
52
-    {
53
-        foreach ($accessControlNodes as $node) {
54
-            $_folderView = isset($node['folderView']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['folderView']) : false;
55
-            $_folderCreate = isset($node['folderCreate']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['folderCreate']) : false;
56
-            $_folderRename = isset($node['folderRename']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['folderRename']) : false;
57
-            $_folderDelete = isset($node['folderDelete']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['folderDelete']) : false;
58
-            $_fileView = isset($node['fileView']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['fileView']) : false;
59
-            $_fileUpload = isset($node['fileUpload']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['fileUpload']) : false;
60
-            $_fileRename = isset($node['fileRename']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['fileRename']) : false;
61
-            $_fileDelete = isset($node['fileDelete']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['fileDelete']) : false;
62
-
63
-            $_role = isset($node['role']) ? $node['role'] : "*";
64
-            $_resourceType = isset($node['resourceType']) ? $node['resourceType'] : "*";
65
-            $_folder = isset($node['folder']) ? $node['folder'] : "/";
66
-
67
-            $this->addACLEntry($_role, $_resourceType, $_folder,
68
-            array(
69
-            $_folderView ? CKFINDER_CONNECTOR_ACL_FOLDER_VIEW : 0,
70
-            $_folderCreate ? CKFINDER_CONNECTOR_ACL_FOLDER_CREATE : 0,
71
-            $_folderRename ? CKFINDER_CONNECTOR_ACL_FOLDER_RENAME : 0,
72
-            $_folderDelete ? CKFINDER_CONNECTOR_ACL_FOLDER_DELETE : 0,
73
-            $_fileView ? CKFINDER_CONNECTOR_ACL_FILE_VIEW : 0,
74
-            $_fileUpload ? CKFINDER_CONNECTOR_ACL_FILE_UPLOAD : 0,
75
-            $_fileRename ? CKFINDER_CONNECTOR_ACL_FILE_RENAME : 0,
76
-            $_fileDelete ? CKFINDER_CONNECTOR_ACL_FILE_DELETE : 0,
77
-            ),
78
-            array(
79
-            $_folderView ? 0 : CKFINDER_CONNECTOR_ACL_FOLDER_VIEW,
80
-            $_folderCreate ? 0 : CKFINDER_CONNECTOR_ACL_FOLDER_CREATE,
81
-            $_folderRename ? 0 : CKFINDER_CONNECTOR_ACL_FOLDER_RENAME,
82
-            $_folderDelete ? 0 : CKFINDER_CONNECTOR_ACL_FOLDER_DELETE,
83
-            $_fileView ? 0 : CKFINDER_CONNECTOR_ACL_FILE_VIEW,
84
-            $_fileUpload ? 0 : CKFINDER_CONNECTOR_ACL_FILE_UPLOAD,
85
-            $_fileRename ? 0 : CKFINDER_CONNECTOR_ACL_FILE_RENAME,
86
-            $_fileDelete ? 0 : CKFINDER_CONNECTOR_ACL_FILE_DELETE,
87
-            )
88
-            );
89
-        }
90
-    }
91
-
92
-    /**
93
-     * Add ACL entry
94
-     *
95
-     * @param string $role role
96
-     * @param string $resourceType resource type
97
-     * @param string $folderPath folder path
98
-     * @param int $allowRulesMask allow rules mask
99
-     * @param int $denyRulesMask deny rules mask
100
-     * @access private
101
-     */
102
-    private function addACLEntry($role, $resourceType, $folderPath, $allowRulesMask, $denyRulesMask)
103
-    {
104
-
105
-        if (!strlen($folderPath)) {
106
-            $folderPath = '/';
107
-        }
108
-        else {
109
-            if (substr($folderPath,0,1) != '/') {
110
-                $folderPath = '/' . $folderPath;
111
-            }
112
-
113
-            if (substr($folderPath,-1,1) != '/') {
114
-                $folderPath .= '/';
115
-            }
116
-        }
117
-
118
-        $_entryKey = $role . "#@#" . $resourceType;
119
-
120
-        if (array_key_exists($folderPath,$this->_aclEntries)) {
121
-            if (array_key_exists($_entryKey, $this->_aclEntries[$folderPath])) {
122
-                $_rulesMasks = $this->_aclEntries[$folderPath][$_entryKey];
123
-                foreach ($_rulesMasks[0] as $key => $value) {
124
-                    $allowRulesMask[$key] |= $value;
125
-                }
126
-                foreach ($_rulesMasks[1] as $key => $value) {
127
-                    $denyRulesMask[$key] |= $value;
128
-                }
129
-            }
130
-        }
131
-        else {
132
-            $this->_aclEntries[$folderPath] = array();
133
-        }
134
-
135
-        $this->_aclEntries[$folderPath][$_entryKey] = array($allowRulesMask, $denyRulesMask);
136
-    }
137
-
138
-
139
-    /**
140
-     * Get computed mask
141
-     *
142
-     * @param string $resourceType
143
-     * @param string $folderPath
144
-     * @return int
145
-     */
146
-    public function getComputedMask($resourceType, $folderPath)
147
-    {
148
-        $_computedMask = 0;
149
-
150
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
151
-        $_roleSessionVar = $_config->getRoleSessionVar();
152
-
153
-        $_userRole = null;
154
-        if (strlen($_roleSessionVar) && isset($_SESSION[$_roleSessionVar])) {
155
-            $_userRole = (string)$_SESSION[$_roleSessionVar];
156
-        }
157
-        if (!is_null($_userRole) && !strlen($_userRole)) {
158
-            $_userRole = null;
159
-        }
160
-
161
-        $folderPath = trim($folderPath, "/");
162
-        $_pathParts = explode("/", $folderPath);
163
-
164
-        $_currentPath = "/";
165
-
166
-        for($i = -1; $i < sizeof($_pathParts); $i++) {
167
-            if ($i >= 0) {
168
-                if (!strlen($_pathParts[$i])) {
169
-                    continue;
170
-                }
171
-
172
-                if (array_key_exists($_currentPath . '*/', $this->_aclEntries))
173
-                $_computedMask = $this->mergePathComputedMask( $_computedMask, $resourceType, $_userRole, $_currentPath . '*/' );
174
-
175
-                $_currentPath .= $_pathParts[$i] . '/';
176
-            }
177
-
178
-            if (array_key_exists($_currentPath, $this->_aclEntries)) {
179
-                $_computedMask = $this->mergePathComputedMask( $_computedMask, $resourceType, $_userRole, $_currentPath );
180
-            }
181
-        }
182
-
183
-        return $_computedMask;
184
-    }
185
-
186
-    /**
187
-     * merge current mask with folder entries
188
-     *
189
-     * @access private
190
-     * @param int $currentMask
191
-     * @param string $resourceType
192
-     * @param string $userRole
193
-     * @param string $path
194
-     * @return int
195
-     */
196
-    private function mergePathComputedMask( $currentMask, $resourceType, $userRole, $path )
197
-    {
198
-        $_folderEntries = $this->_aclEntries[$path];
199
-
200
-        $_possibleEntries = array();
201
-
202
-        $_possibleEntries[0] = "*#@#*";
203
-        $_possibleEntries[1] = "*#@#" . $resourceType;
204
-
205
-        if (!is_null($userRole))
206
-        {
207
-            $_possibleEntries[2] = $userRole . "#@#*";
208
-            $_possibleEntries[3] = $userRole . "#@#" . $resourceType;
209
-        }
210
-
211
-        for ($r = 0; $r < sizeof($_possibleEntries); $r++)
212
-        {
213
-            $_possibleKey = $_possibleEntries[$r];
214
-            if (array_key_exists($_possibleKey, $_folderEntries))
215
-            {
216
-                $_rulesMasks = $_folderEntries[$_possibleKey];
217
-
218
-                $currentMask |= array_sum($_rulesMasks[0]);
219
-                $currentMask ^= ($currentMask & array_sum($_rulesMasks[1]));
220
-            }
221
-        }
222
-
223
-        return $currentMask;
224
-    }
43
+	/**
44
+	 * array with ACL entries
45
+	 *
46
+	 * @var array[string]string
47
+	 * @access private
48
+	 */
49
+	private $_aclEntries = array();
50
+
51
+	function __construct($accessControlNodes)
52
+	{
53
+		foreach ($accessControlNodes as $node) {
54
+			$_folderView = isset($node['folderView']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['folderView']) : false;
55
+			$_folderCreate = isset($node['folderCreate']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['folderCreate']) : false;
56
+			$_folderRename = isset($node['folderRename']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['folderRename']) : false;
57
+			$_folderDelete = isset($node['folderDelete']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['folderDelete']) : false;
58
+			$_fileView = isset($node['fileView']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['fileView']) : false;
59
+			$_fileUpload = isset($node['fileUpload']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['fileUpload']) : false;
60
+			$_fileRename = isset($node['fileRename']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['fileRename']) : false;
61
+			$_fileDelete = isset($node['fileDelete']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['fileDelete']) : false;
62
+
63
+			$_role = isset($node['role']) ? $node['role'] : "*";
64
+			$_resourceType = isset($node['resourceType']) ? $node['resourceType'] : "*";
65
+			$_folder = isset($node['folder']) ? $node['folder'] : "/";
66
+
67
+			$this->addACLEntry($_role, $_resourceType, $_folder,
68
+			array(
69
+			$_folderView ? CKFINDER_CONNECTOR_ACL_FOLDER_VIEW : 0,
70
+			$_folderCreate ? CKFINDER_CONNECTOR_ACL_FOLDER_CREATE : 0,
71
+			$_folderRename ? CKFINDER_CONNECTOR_ACL_FOLDER_RENAME : 0,
72
+			$_folderDelete ? CKFINDER_CONNECTOR_ACL_FOLDER_DELETE : 0,
73
+			$_fileView ? CKFINDER_CONNECTOR_ACL_FILE_VIEW : 0,
74
+			$_fileUpload ? CKFINDER_CONNECTOR_ACL_FILE_UPLOAD : 0,
75
+			$_fileRename ? CKFINDER_CONNECTOR_ACL_FILE_RENAME : 0,
76
+			$_fileDelete ? CKFINDER_CONNECTOR_ACL_FILE_DELETE : 0,
77
+			),
78
+			array(
79
+			$_folderView ? 0 : CKFINDER_CONNECTOR_ACL_FOLDER_VIEW,
80
+			$_folderCreate ? 0 : CKFINDER_CONNECTOR_ACL_FOLDER_CREATE,
81
+			$_folderRename ? 0 : CKFINDER_CONNECTOR_ACL_FOLDER_RENAME,
82
+			$_folderDelete ? 0 : CKFINDER_CONNECTOR_ACL_FOLDER_DELETE,
83
+			$_fileView ? 0 : CKFINDER_CONNECTOR_ACL_FILE_VIEW,
84
+			$_fileUpload ? 0 : CKFINDER_CONNECTOR_ACL_FILE_UPLOAD,
85
+			$_fileRename ? 0 : CKFINDER_CONNECTOR_ACL_FILE_RENAME,
86
+			$_fileDelete ? 0 : CKFINDER_CONNECTOR_ACL_FILE_DELETE,
87
+			)
88
+			);
89
+		}
90
+	}
91
+
92
+	/**
93
+	 * Add ACL entry
94
+	 *
95
+	 * @param string $role role
96
+	 * @param string $resourceType resource type
97
+	 * @param string $folderPath folder path
98
+	 * @param int $allowRulesMask allow rules mask
99
+	 * @param int $denyRulesMask deny rules mask
100
+	 * @access private
101
+	 */
102
+	private function addACLEntry($role, $resourceType, $folderPath, $allowRulesMask, $denyRulesMask)
103
+	{
104
+
105
+		if (!strlen($folderPath)) {
106
+			$folderPath = '/';
107
+		}
108
+		else {
109
+			if (substr($folderPath,0,1) != '/') {
110
+				$folderPath = '/' . $folderPath;
111
+			}
112
+
113
+			if (substr($folderPath,-1,1) != '/') {
114
+				$folderPath .= '/';
115
+			}
116
+		}
117
+
118
+		$_entryKey = $role . "#@#" . $resourceType;
119
+
120
+		if (array_key_exists($folderPath,$this->_aclEntries)) {
121
+			if (array_key_exists($_entryKey, $this->_aclEntries[$folderPath])) {
122
+				$_rulesMasks = $this->_aclEntries[$folderPath][$_entryKey];
123
+				foreach ($_rulesMasks[0] as $key => $value) {
124
+					$allowRulesMask[$key] |= $value;
125
+				}
126
+				foreach ($_rulesMasks[1] as $key => $value) {
127
+					$denyRulesMask[$key] |= $value;
128
+				}
129
+			}
130
+		}
131
+		else {
132
+			$this->_aclEntries[$folderPath] = array();
133
+		}
134
+
135
+		$this->_aclEntries[$folderPath][$_entryKey] = array($allowRulesMask, $denyRulesMask);
136
+	}
137
+
138
+
139
+	/**
140
+	 * Get computed mask
141
+	 *
142
+	 * @param string $resourceType
143
+	 * @param string $folderPath
144
+	 * @return int
145
+	 */
146
+	public function getComputedMask($resourceType, $folderPath)
147
+	{
148
+		$_computedMask = 0;
149
+
150
+		$_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
151
+		$_roleSessionVar = $_config->getRoleSessionVar();
152
+
153
+		$_userRole = null;
154
+		if (strlen($_roleSessionVar) && isset($_SESSION[$_roleSessionVar])) {
155
+			$_userRole = (string)$_SESSION[$_roleSessionVar];
156
+		}
157
+		if (!is_null($_userRole) && !strlen($_userRole)) {
158
+			$_userRole = null;
159
+		}
160
+
161
+		$folderPath = trim($folderPath, "/");
162
+		$_pathParts = explode("/", $folderPath);
163
+
164
+		$_currentPath = "/";
165
+
166
+		for($i = -1; $i < sizeof($_pathParts); $i++) {
167
+			if ($i >= 0) {
168
+				if (!strlen($_pathParts[$i])) {
169
+					continue;
170
+				}
171
+
172
+				if (array_key_exists($_currentPath . '*/', $this->_aclEntries))
173
+				$_computedMask = $this->mergePathComputedMask( $_computedMask, $resourceType, $_userRole, $_currentPath . '*/' );
174
+
175
+				$_currentPath .= $_pathParts[$i] . '/';
176
+			}
177
+
178
+			if (array_key_exists($_currentPath, $this->_aclEntries)) {
179
+				$_computedMask = $this->mergePathComputedMask( $_computedMask, $resourceType, $_userRole, $_currentPath );
180
+			}
181
+		}
182
+
183
+		return $_computedMask;
184
+	}
185
+
186
+	/**
187
+	 * merge current mask with folder entries
188
+	 *
189
+	 * @access private
190
+	 * @param int $currentMask
191
+	 * @param string $resourceType
192
+	 * @param string $userRole
193
+	 * @param string $path
194
+	 * @return int
195
+	 */
196
+	private function mergePathComputedMask( $currentMask, $resourceType, $userRole, $path )
197
+	{
198
+		$_folderEntries = $this->_aclEntries[$path];
199
+
200
+		$_possibleEntries = array();
201
+
202
+		$_possibleEntries[0] = "*#@#*";
203
+		$_possibleEntries[1] = "*#@#" . $resourceType;
204
+
205
+		if (!is_null($userRole))
206
+		{
207
+			$_possibleEntries[2] = $userRole . "#@#*";
208
+			$_possibleEntries[3] = $userRole . "#@#" . $resourceType;
209
+		}
210
+
211
+		for ($r = 0; $r < sizeof($_possibleEntries); $r++)
212
+		{
213
+			$_possibleKey = $_possibleEntries[$r];
214
+			if (array_key_exists($_possibleKey, $_folderEntries))
215
+			{
216
+				$_rulesMasks = $_folderEntries[$_possibleKey];
217
+
218
+				$currentMask |= array_sum($_rulesMasks[0]);
219
+				$currentMask ^= ($currentMask & array_sum($_rulesMasks[1]));
220
+			}
221
+		}
222
+
223
+		return $currentMask;
224
+	}
225 225
 }
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
 /**
22 22
  * Folder view mask
23 23
  */
24
-define('CKFINDER_CONNECTOR_ACL_FOLDER_VIEW',1);
25
-define('CKFINDER_CONNECTOR_ACL_FOLDER_CREATE',2);
26
-define('CKFINDER_CONNECTOR_ACL_FOLDER_RENAME',4);
27
-define('CKFINDER_CONNECTOR_ACL_FOLDER_DELETE',8);
28
-define('CKFINDER_CONNECTOR_ACL_FILE_VIEW',16);
29
-define('CKFINDER_CONNECTOR_ACL_FILE_UPLOAD',32);
30
-define('CKFINDER_CONNECTOR_ACL_FILE_RENAME',64);
31
-define('CKFINDER_CONNECTOR_ACL_FILE_DELETE',128);
24
+define('CKFINDER_CONNECTOR_ACL_FOLDER_VIEW', 1);
25
+define('CKFINDER_CONNECTOR_ACL_FOLDER_CREATE', 2);
26
+define('CKFINDER_CONNECTOR_ACL_FOLDER_RENAME', 4);
27
+define('CKFINDER_CONNECTOR_ACL_FOLDER_DELETE', 8);
28
+define('CKFINDER_CONNECTOR_ACL_FILE_VIEW', 16);
29
+define('CKFINDER_CONNECTOR_ACL_FILE_UPLOAD', 32);
30
+define('CKFINDER_CONNECTOR_ACL_FILE_RENAME', 64);
31
+define('CKFINDER_CONNECTOR_ACL_FILE_DELETE', 128);
32 32
 
33 33
 /**
34 34
  * This class keeps ACL configuration
@@ -106,18 +106,18 @@  discard block
 block discarded – undo
106 106
             $folderPath = '/';
107 107
         }
108 108
         else {
109
-            if (substr($folderPath,0,1) != '/') {
110
-                $folderPath = '/' . $folderPath;
109
+            if (substr($folderPath, 0, 1) != '/') {
110
+                $folderPath = '/'.$folderPath;
111 111
             }
112 112
 
113
-            if (substr($folderPath,-1,1) != '/') {
113
+            if (substr($folderPath, -1, 1) != '/') {
114 114
                 $folderPath .= '/';
115 115
             }
116 116
         }
117 117
 
118
-        $_entryKey = $role . "#@#" . $resourceType;
118
+        $_entryKey = $role."#@#".$resourceType;
119 119
 
120
-        if (array_key_exists($folderPath,$this->_aclEntries)) {
120
+        if (array_key_exists($folderPath, $this->_aclEntries)) {
121 121
             if (array_key_exists($_entryKey, $this->_aclEntries[$folderPath])) {
122 122
                 $_rulesMasks = $this->_aclEntries[$folderPath][$_entryKey];
123 123
                 foreach ($_rulesMasks[0] as $key => $value) {
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     {
148 148
         $_computedMask = 0;
149 149
 
150
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
150
+        $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config");
151 151
         $_roleSessionVar = $_config->getRoleSessionVar();
152 152
 
153 153
         $_userRole = null;
@@ -163,20 +163,20 @@  discard block
 block discarded – undo
163 163
 
164 164
         $_currentPath = "/";
165 165
 
166
-        for($i = -1; $i < sizeof($_pathParts); $i++) {
166
+        for ($i = -1; $i < sizeof($_pathParts); $i++) {
167 167
             if ($i >= 0) {
168 168
                 if (!strlen($_pathParts[$i])) {
169 169
                     continue;
170 170
                 }
171 171
 
172
-                if (array_key_exists($_currentPath . '*/', $this->_aclEntries))
173
-                $_computedMask = $this->mergePathComputedMask( $_computedMask, $resourceType, $_userRole, $_currentPath . '*/' );
172
+                if (array_key_exists($_currentPath.'*/', $this->_aclEntries))
173
+                $_computedMask = $this->mergePathComputedMask($_computedMask, $resourceType, $_userRole, $_currentPath.'*/');
174 174
 
175
-                $_currentPath .= $_pathParts[$i] . '/';
175
+                $_currentPath .= $_pathParts[$i].'/';
176 176
             }
177 177
 
178 178
             if (array_key_exists($_currentPath, $this->_aclEntries)) {
179
-                $_computedMask = $this->mergePathComputedMask( $_computedMask, $resourceType, $_userRole, $_currentPath );
179
+                $_computedMask = $this->mergePathComputedMask($_computedMask, $resourceType, $_userRole, $_currentPath);
180 180
             }
181 181
         }
182 182
 
@@ -193,19 +193,19 @@  discard block
 block discarded – undo
193 193
      * @param string $path
194 194
      * @return int
195 195
      */
196
-    private function mergePathComputedMask( $currentMask, $resourceType, $userRole, $path )
196
+    private function mergePathComputedMask($currentMask, $resourceType, $userRole, $path)
197 197
     {
198 198
         $_folderEntries = $this->_aclEntries[$path];
199 199
 
200 200
         $_possibleEntries = array();
201 201
 
202 202
         $_possibleEntries[0] = "*#@#*";
203
-        $_possibleEntries[1] = "*#@#" . $resourceType;
203
+        $_possibleEntries[1] = "*#@#".$resourceType;
204 204
 
205 205
         if (!is_null($userRole))
206 206
         {
207
-            $_possibleEntries[2] = $userRole . "#@#*";
208
-            $_possibleEntries[3] = $userRole . "#@#" . $resourceType;
207
+            $_possibleEntries[2] = $userRole."#@#*";
208
+            $_possibleEntries[3] = $userRole."#@#".$resourceType;
209 209
         }
210 210
 
211 211
         for ($r = 0; $r < sizeof($_possibleEntries); $r++)
Please login to merge, or discard this patch.
Braces   +8 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@  discard block
 block discarded – undo
10 10
  * modifying or distribute this file or part of its contents. The contents of
11 11
  * this file is part of the Source Code of CKFinder.
12 12
  */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
@@ -104,8 +106,7 @@  discard block
 block discarded – undo
104 106
 
105 107
         if (!strlen($folderPath)) {
106 108
             $folderPath = '/';
107
-        }
108
-        else {
109
+        } else {
109 110
             if (substr($folderPath,0,1) != '/') {
110 111
                 $folderPath = '/' . $folderPath;
111 112
             }
@@ -127,8 +128,7 @@  discard block
 block discarded – undo
127 128
                     $denyRulesMask[$key] |= $value;
128 129
                 }
129 130
             }
130
-        }
131
-        else {
131
+        } else {
132 132
             $this->_aclEntries[$folderPath] = array();
133 133
         }
134 134
 
@@ -169,8 +169,9 @@  discard block
 block discarded – undo
169 169
                     continue;
170 170
                 }
171 171
 
172
-                if (array_key_exists($_currentPath . '*/', $this->_aclEntries))
173
-                $_computedMask = $this->mergePathComputedMask( $_computedMask, $resourceType, $_userRole, $_currentPath . '*/' );
172
+                if (array_key_exists($_currentPath . '*/', $this->_aclEntries)) {
173
+                                $_computedMask = $this->mergePathComputedMask( $_computedMask, $resourceType, $_userRole, $_currentPath . '*/' );
174
+                }
174 175
 
175 176
                 $_currentPath .= $_pathParts[$i] . '/';
176 177
             }
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php5/Core/ImagesConfig.php 3 patches
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -27,80 +27,80 @@
 block discarded – undo
27 27
  */
28 28
 class CKFinder_Connector_Core_ImagesConfig
29 29
 {
30
-    /**
31
-     * Max width for images, 0 to disable resizing
32
-     *
33
-     * @var int
34
-     * @access private
35
-     */
36
-    private $_maxWidth = 0;
37
-    /**
38
-     * Max height for images, 0 to disable resizing
39
-     *
40
-     * @var int
41
-     * @access private
42
-     */
43
-    private $_maxHeight = 0;
44
-    /**
45
-     * Quality of thumbnails
46
-     *
47
-     * @var int
48
-     * @access private
49
-     */
50
-    private $_quality = 80;
30
+	/**
31
+	 * Max width for images, 0 to disable resizing
32
+	 *
33
+	 * @var int
34
+	 * @access private
35
+	 */
36
+	private $_maxWidth = 0;
37
+	/**
38
+	 * Max height for images, 0 to disable resizing
39
+	 *
40
+	 * @var int
41
+	 * @access private
42
+	 */
43
+	private $_maxHeight = 0;
44
+	/**
45
+	 * Quality of thumbnails
46
+	 *
47
+	 * @var int
48
+	 * @access private
49
+	 */
50
+	private $_quality = 80;
51 51
 
52
-    function __construct($imagesNode)
53
-    {
54
-        if(isset($imagesNode['maxWidth'])) {
55
-            $_maxWidth = intval($imagesNode['maxWidth']);
56
-            if($_maxWidth>=0) {
57
-                $this->_maxWidth = $_maxWidth;
58
-            }
59
-        }
60
-        if(isset($imagesNode['maxHeight'])) {
61
-            $_maxHeight = intval($imagesNode['maxHeight']);
62
-            if($_maxHeight>=0) {
63
-                $this->_maxHeight = $_maxHeight;
64
-            }
65
-        }
66
-        if(isset($imagesNode['quality'])) {
67
-            $_quality = intval($imagesNode['quality']);
68
-            if($_quality>0 && $_quality<=100) {
69
-                $this->_quality = $_quality;
70
-            }
71
-        }
72
-    }
52
+	function __construct($imagesNode)
53
+	{
54
+		if(isset($imagesNode['maxWidth'])) {
55
+			$_maxWidth = intval($imagesNode['maxWidth']);
56
+			if($_maxWidth>=0) {
57
+				$this->_maxWidth = $_maxWidth;
58
+			}
59
+		}
60
+		if(isset($imagesNode['maxHeight'])) {
61
+			$_maxHeight = intval($imagesNode['maxHeight']);
62
+			if($_maxHeight>=0) {
63
+				$this->_maxHeight = $_maxHeight;
64
+			}
65
+		}
66
+		if(isset($imagesNode['quality'])) {
67
+			$_quality = intval($imagesNode['quality']);
68
+			if($_quality>0 && $_quality<=100) {
69
+				$this->_quality = $_quality;
70
+			}
71
+		}
72
+	}
73 73
 
74
-    /**
75
-     * Get maximum width of a thumbnail
76
-     *
77
-     * @access public
78
-     * @return int
79
-     */
80
-    public function getMaxWidth()
81
-    {
82
-    	return $this->_maxWidth;
83
-    }
74
+	/**
75
+	 * Get maximum width of a thumbnail
76
+	 *
77
+	 * @access public
78
+	 * @return int
79
+	 */
80
+	public function getMaxWidth()
81
+	{
82
+		return $this->_maxWidth;
83
+	}
84 84
 
85
-    /**
86
-     * Get maximum height of a thumbnail
87
-     *
88
-     * @access public
89
-     * @return int
90
-     */
91
-    public function getMaxHeight()
92
-    {
93
-    	return $this->_maxHeight;
94
-    }
85
+	/**
86
+	 * Get maximum height of a thumbnail
87
+	 *
88
+	 * @access public
89
+	 * @return int
90
+	 */
91
+	public function getMaxHeight()
92
+	{
93
+		return $this->_maxHeight;
94
+	}
95 95
 
96
-    /**
97
-     * Get quality of a thumbnail (1-100)
98
-     *
99
-     * @access public
100
-     * @return int
101
-     */
102
-    public function getQuality()
103
-    {
104
-    	return $this->_quality;
105
-    }
96
+	/**
97
+	 * Get quality of a thumbnail (1-100)
98
+	 *
99
+	 * @access public
100
+	 * @return int
101
+	 */
102
+	public function getQuality()
103
+	{
104
+		return $this->_quality;
105
+	}
106 106
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,21 +51,21 @@
 block discarded – undo
51 51
 
52 52
     function CKFinder_Connector_Core_ImagesConfig($imagesNode)
53 53
     {
54
-        if(isset($imagesNode['maxWidth'])) {
54
+        if (isset($imagesNode['maxWidth'])) {
55 55
             $_maxWidth = intval($imagesNode['maxWidth']);
56
-            if($_maxWidth>=0) {
56
+            if ($_maxWidth >= 0) {
57 57
                 $this->_maxWidth = $_maxWidth;
58 58
             }
59 59
         }
60
-        if(isset($imagesNode['maxHeight'])) {
60
+        if (isset($imagesNode['maxHeight'])) {
61 61
             $_maxHeight = intval($imagesNode['maxHeight']);
62
-            if($_maxHeight>=0) {
62
+            if ($_maxHeight >= 0) {
63 63
                 $this->_maxHeight = $_maxHeight;
64 64
             }
65 65
         }
66
-        if(isset($imagesNode['quality'])) {
66
+        if (isset($imagesNode['quality'])) {
67 67
             $_quality = intval($imagesNode['quality']);
68
-            if($_quality>0 && $_quality<=100) {
68
+            if ($_quality > 0 && $_quality <= 100) {
69 69
                 $this->_quality = $_quality;
70 70
             }
71 71
         }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@
 block discarded – undo
10 10
  * modifying or distribute this file or part of its contents. The contents of
11 11
  * this file is part of the Source Code of CKFinder.
12 12
  */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
Please login to merge, or discard this patch.