Passed
Branch master (ef3387)
by Anthony
09:36
created
libs/ckfinder/core/connector/php/php4/CommandHandler/CreateFolder.php 3 patches
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -32,67 +32,67 @@
 block discarded – undo
32 32
  */
33 33
 class CKFinder_Connector_CommandHandler_CreateFolder extends CKFinder_Connector_CommandHandler_XmlCommandHandlerBase
34 34
 {
35
-    /**
36
-     * Command name
37
-     *
38
-     * @access private
39
-     * @var string
40
-     */
41
-    var $command = "CreateFolder";
35
+	/**
36
+	 * Command name
37
+	 *
38
+	 * @access private
39
+	 * @var string
40
+	 */
41
+	var $command = "CreateFolder";
42 42
 
43
-    /**
44
-     * handle request and build XML
45
-     * @access protected
46
-     *
47
-     */
48
-    function buildXml()
49
-    {
50
-        if (empty($_POST['CKFinderCommand']) || $_POST['CKFinderCommand'] != 'true') {
51
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
52
-        }
43
+	/**
44
+	 * handle request and build XML
45
+	 * @access protected
46
+	 *
47
+	 */
48
+	function buildXml()
49
+	{
50
+		if (empty($_POST['CKFinderCommand']) || $_POST['CKFinderCommand'] != 'true') {
51
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
52
+		}
53 53
 
54
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
55
-        if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FOLDER_CREATE)) {
56
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
57
-        }
54
+		$_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
55
+		if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FOLDER_CREATE)) {
56
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
57
+		}
58 58
 
59
-        $_resourceTypeConfig = $this->_currentFolder->getResourceTypeConfig();
60
-        $sNewFolderName = isset($_GET["NewFolderName"]) ? $_GET["NewFolderName"] : "";
61
-        $sNewFolderName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($sNewFolderName);
62
-        if ($_config->forceAscii()) {
63
-            $sNewFolderName = CKFinder_Connector_Utils_FileSystem::convertToAscii($sNewFolderName);
64
-        }
59
+		$_resourceTypeConfig = $this->_currentFolder->getResourceTypeConfig();
60
+		$sNewFolderName = isset($_GET["NewFolderName"]) ? $_GET["NewFolderName"] : "";
61
+		$sNewFolderName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($sNewFolderName);
62
+		if ($_config->forceAscii()) {
63
+			$sNewFolderName = CKFinder_Connector_Utils_FileSystem::convertToAscii($sNewFolderName);
64
+		}
65 65
 
66
-        if (!CKFinder_Connector_Utils_FileSystem::checkFileName($sNewFolderName) || $_resourceTypeConfig->checkIsHiddenFolder($sNewFolderName)) {
67
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
68
-        }
66
+		if (!CKFinder_Connector_Utils_FileSystem::checkFileName($sNewFolderName) || $_resourceTypeConfig->checkIsHiddenFolder($sNewFolderName)) {
67
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
68
+		}
69 69
 
70
-        $sServerDir = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $sNewFolderName);
71
-        if (!is_writeable($this->_currentFolder->getServerPath())) {
72
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
73
-        }
70
+		$sServerDir = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $sNewFolderName);
71
+		if (!is_writeable($this->_currentFolder->getServerPath())) {
72
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
73
+		}
74 74
 
75
-        $bCreated = false;
75
+		$bCreated = false;
76 76
 
77
-        if (file_exists($sServerDir)) {
78
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ALREADY_EXIST);
79
-        }
77
+		if (file_exists($sServerDir)) {
78
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ALREADY_EXIST);
79
+		}
80 80
 
81
-        if ($perms = $_config->getChmodFolders()) {
82
-            $oldUmask = umask(0);
83
-            $bCreated = @mkdir($sServerDir, $perms);
84
-            umask($oldUmask);
85
-        }
86
-        else {
87
-            $bCreated = @mkdir($sServerDir);
88
-        }
81
+		if ($perms = $_config->getChmodFolders()) {
82
+			$oldUmask = umask(0);
83
+			$bCreated = @mkdir($sServerDir, $perms);
84
+			umask($oldUmask);
85
+		}
86
+		else {
87
+			$bCreated = @mkdir($sServerDir);
88
+		}
89 89
 
90
-        if (!$bCreated) {
91
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
92
-        } else {
93
-            $oNewFolderNode = new Ckfinder_Connector_Utils_XmlNode("NewFolder");
94
-            $this->_connectorNode->addChild($oNewFolderNode);
95
-            $oNewFolderNode->addAttribute("name", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($sNewFolderName));
96
-        }
97
-    }
90
+		if (!$bCreated) {
91
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
92
+		} else {
93
+			$oNewFolderNode = new Ckfinder_Connector_Utils_XmlNode("NewFolder");
94
+			$this->_connectorNode->addChild($oNewFolderNode);
95
+			$oNewFolderNode->addAttribute("name", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($sNewFolderName));
96
+		}
97
+	}
98 98
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 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 CreateFolder command
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
52 52
         }
53 53
 
54
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
54
+        $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config");
55 55
         if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FOLDER_CREATE)) {
56 56
             $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
57 57
         }
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
@@ -82,8 +84,7 @@  discard block
 block discarded – undo
82 84
             $oldUmask = umask(0);
83 85
             $bCreated = @mkdir($sServerDir, $perms);
84 86
             umask($oldUmask);
85
-        }
86
-        else {
87
+        } else {
87 88
             $bCreated = @mkdir($sServerDir);
88 89
         }
89 90
 
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php4/CommandHandler/QuickUpload.php 3 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -32,19 +32,19 @@
 block discarded – undo
32 32
  */
33 33
 class CKFinder_Connector_CommandHandler_QuickUpload extends CKFinder_Connector_CommandHandler_FileUpload
34 34
 {
35
-    /**
36
-     * Command name
37
-     *
38
-     * @access protected
39
-     * @var string
40
-     */
41
-    var $command = "QuickUpload";
35
+	/**
36
+	 * Command name
37
+	 *
38
+	 * @access protected
39
+	 * @var string
40
+	 */
41
+	var $command = "QuickUpload";
42 42
 
43
-    function sendResponse()
44
-    {
45
-        $oRegistry =& CKFinder_Connector_Core_Factory::getInstance("Core_Registry");
46
-        $oRegistry->set("FileUpload_url", $this->_currentFolder->getUrl());
43
+	function sendResponse()
44
+	{
45
+		$oRegistry =& CKFinder_Connector_Core_Factory::getInstance("Core_Registry");
46
+		$oRegistry->set("FileUpload_url", $this->_currentFolder->getUrl());
47 47
 
48
-        return parent::sendResponse();
49
-    }
48
+		return parent::sendResponse();
49
+	}
50 50
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 /**
22 22
  * Include file upload command handler
23 23
  */
24
-require_once CKFINDER_CONNECTOR_LIB_DIR . "/CommandHandler/FileUpload.php";
24
+require_once CKFINDER_CONNECTOR_LIB_DIR."/CommandHandler/FileUpload.php";
25 25
 
26 26
 /**
27 27
  * Handle QuickUpload command
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     function sendResponse()
44 44
     {
45
-        $oRegistry =& CKFinder_Connector_Core_Factory::getInstance("Core_Registry");
45
+        $oRegistry = & CKFinder_Connector_Core_Factory::getInstance("Core_Registry");
46 46
         $oRegistry->set("FileUpload_url", $this->_currentFolder->getUrl());
47 47
 
48 48
         return parent::sendResponse();
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/php4/CommandHandler/GetFolders.php 3 patches
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -32,74 +32,74 @@
 block discarded – undo
32 32
  */
33 33
 class CKFinder_Connector_CommandHandler_GetFolders extends CKFinder_Connector_CommandHandler_XmlCommandHandlerBase
34 34
 {
35
-    /**
36
-     * Command name
37
-     *
38
-     * @access private
39
-     * @var string
40
-     */
41
-    var $command = "GetFolders";
35
+	/**
36
+	 * Command name
37
+	 *
38
+	 * @access private
39
+	 * @var string
40
+	 */
41
+	var $command = "GetFolders";
42 42
 
43
-    /**
44
-     * handle request and build XML
45
-     * @access protected
46
-     *
47
-     */
48
-    function buildXml()
49
-    {
50
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
51
-        if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FOLDER_VIEW)) {
52
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
53
-        }
43
+	/**
44
+	 * handle request and build XML
45
+	 * @access protected
46
+	 *
47
+	 */
48
+	function buildXml()
49
+	{
50
+		$_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
51
+		if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FOLDER_VIEW)) {
52
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
53
+		}
54 54
 
55
-        // Map the virtual path to the local server path.
56
-        $_sServerDir = $this->_currentFolder->getServerPath();
55
+		// Map the virtual path to the local server path.
56
+		$_sServerDir = $this->_currentFolder->getServerPath();
57 57
 
58
-        if (!is_dir($_sServerDir)) {
59
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FOLDER_NOT_FOUND);
60
-        }
58
+		if (!is_dir($_sServerDir)) {
59
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FOLDER_NOT_FOUND);
60
+		}
61 61
 
62
-        // Create the "Folders" node.
63
-        $oFoldersNode = new Ckfinder_Connector_Utils_XmlNode("Folders");
64
-        $this->_connectorNode->addChild($oFoldersNode);
62
+		// Create the "Folders" node.
63
+		$oFoldersNode = new Ckfinder_Connector_Utils_XmlNode("Folders");
64
+		$this->_connectorNode->addChild($oFoldersNode);
65 65
 
66
-        $files = array();
67
-        if ($dh = @opendir($_sServerDir)) {
68
-            while (($file = readdir($dh)) !== false) {
69
-                if ($file != "." && $file != ".." && is_dir($_sServerDir . $file)) {
70
-                    $files[] = $file;
71
-                }
72
-            }
73
-            closedir($dh);
74
-        } else {
75
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
76
-        }
66
+		$files = array();
67
+		if ($dh = @opendir($_sServerDir)) {
68
+			while (($file = readdir($dh)) !== false) {
69
+				if ($file != "." && $file != ".." && is_dir($_sServerDir . $file)) {
70
+					$files[] = $file;
71
+				}
72
+			}
73
+			closedir($dh);
74
+		} else {
75
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
76
+		}
77 77
 
78
-        $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
78
+		$resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
79 79
 
80
-        if (sizeof($files)>0) {
81
-            natcasesort($files);
82
-            $i=0;
83
-            foreach ($files as $file) {
84
-                $oAcl = $_config->getAccessControlConfig();
85
-                $aclMask = $oAcl->getComputedMask($this->_currentFolder->getResourceTypeName(), $this->_currentFolder->getClientPath() . $file . "/");
80
+		if (sizeof($files)>0) {
81
+			natcasesort($files);
82
+			$i=0;
83
+			foreach ($files as $file) {
84
+				$oAcl = $_config->getAccessControlConfig();
85
+				$aclMask = $oAcl->getComputedMask($this->_currentFolder->getResourceTypeName(), $this->_currentFolder->getClientPath() . $file . "/");
86 86
 
87
-                if (($aclMask & CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) != CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) {
88
-                    continue;
89
-                }
90
-                if ($resourceTypeInfo->checkIsHiddenFolder($file)) {
91
-                    continue;
92
-                }
87
+				if (($aclMask & CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) != CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) {
88
+					continue;
89
+				}
90
+				if ($resourceTypeInfo->checkIsHiddenFolder($file)) {
91
+					continue;
92
+				}
93 93
 
94
-                // Create the "Folder" node.
95
-                $oFolderNode[$i] = new Ckfinder_Connector_Utils_XmlNode("Folder");
96
-                $oFoldersNode->addChild($oFolderNode[$i]);
97
-                $oFolderNode[$i]->addAttribute("name", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($file));
98
-                $oFolderNode[$i]->addAttribute("hasChildren", CKFinder_Connector_Utils_FileSystem::hasChildren($_sServerDir . $file) ? "true" : "false");
99
-                $oFolderNode[$i]->addAttribute("acl", $aclMask);
94
+				// Create the "Folder" node.
95
+				$oFolderNode[$i] = new Ckfinder_Connector_Utils_XmlNode("Folder");
96
+				$oFoldersNode->addChild($oFolderNode[$i]);
97
+				$oFolderNode[$i]->addAttribute("name", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($file));
98
+				$oFolderNode[$i]->addAttribute("hasChildren", CKFinder_Connector_Utils_FileSystem::hasChildren($_sServerDir . $file) ? "true" : "false");
99
+				$oFolderNode[$i]->addAttribute("acl", $aclMask);
100 100
 
101
-                $i++;
102
-            }
103
-        }
104
-    }
101
+				$i++;
102
+			}
103
+		}
104
+	}
105 105
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 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 GetFolders command
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     function buildXml()
49 49
     {
50
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
50
+        $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config");
51 51
         if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FOLDER_VIEW)) {
52 52
             $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
53 53
         }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         $files = array();
67 67
         if ($dh = @opendir($_sServerDir)) {
68 68
             while (($file = readdir($dh)) !== false) {
69
-                if ($file != "." && $file != ".." && is_dir($_sServerDir . $file)) {
69
+                if ($file != "." && $file != ".." && is_dir($_sServerDir.$file)) {
70 70
                     $files[] = $file;
71 71
                 }
72 72
             }
@@ -77,12 +77,12 @@  discard block
 block discarded – undo
77 77
 
78 78
         $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
79 79
 
80
-        if (sizeof($files)>0) {
80
+        if (sizeof($files) > 0) {
81 81
             natcasesort($files);
82
-            $i=0;
82
+            $i = 0;
83 83
             foreach ($files as $file) {
84 84
                 $oAcl = $_config->getAccessControlConfig();
85
-                $aclMask = $oAcl->getComputedMask($this->_currentFolder->getResourceTypeName(), $this->_currentFolder->getClientPath() . $file . "/");
85
+                $aclMask = $oAcl->getComputedMask($this->_currentFolder->getResourceTypeName(), $this->_currentFolder->getClientPath().$file."/");
86 86
 
87 87
                 if (($aclMask & CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) != CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) {
88 88
                     continue;
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                 $oFolderNode[$i] = new Ckfinder_Connector_Utils_XmlNode("Folder");
96 96
                 $oFoldersNode->addChild($oFolderNode[$i]);
97 97
                 $oFolderNode[$i]->addAttribute("name", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($file));
98
-                $oFolderNode[$i]->addAttribute("hasChildren", CKFinder_Connector_Utils_FileSystem::hasChildren($_sServerDir . $file) ? "true" : "false");
98
+                $oFolderNode[$i]->addAttribute("hasChildren", CKFinder_Connector_Utils_FileSystem::hasChildren($_sServerDir.$file) ? "true" : "false");
99 99
                 $oFolderNode[$i]->addAttribute("acl", $aclMask);
100 100
 
101 101
                 $i++;
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/php4/CommandHandler/DeleteFile.php 3 patches
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -32,69 +32,69 @@
 block discarded – undo
32 32
  */
33 33
 class CKFinder_Connector_CommandHandler_DeleteFile extends CKFinder_Connector_CommandHandler_XmlCommandHandlerBase
34 34
 {
35
-    /**
36
-     * Command name
37
-     *
38
-     * @access private
39
-     * @var string
40
-     */
41
-    var $command = "DeleteFile";
35
+	/**
36
+	 * Command name
37
+	 *
38
+	 * @access private
39
+	 * @var string
40
+	 */
41
+	var $command = "DeleteFile";
42 42
 
43 43
 
44
-    /**
45
-     * handle request and build XML
46
-     * @access protected
47
-     *
48
-     */
49
-    function buildXml()
50
-    {
51
-        if (empty($_POST['CKFinderCommand']) || $_POST['CKFinderCommand'] != 'true') {
52
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
53
-        }
44
+	/**
45
+	 * handle request and build XML
46
+	 * @access protected
47
+	 *
48
+	 */
49
+	function buildXml()
50
+	{
51
+		if (empty($_POST['CKFinderCommand']) || $_POST['CKFinderCommand'] != 'true') {
52
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
53
+		}
54 54
 
55
-        if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_DELETE)) {
56
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
57
-        }
55
+		if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_DELETE)) {
56
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
57
+		}
58 58
 
59
-        if (!isset($_GET["FileName"])) {
60
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
61
-        }
59
+		if (!isset($_GET["FileName"])) {
60
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
61
+		}
62 62
 
63
-        $fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_GET["FileName"]);
63
+		$fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_GET["FileName"]);
64 64
 
65
-        $_resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
65
+		$_resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
66 66
 
67
-        if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName) || $_resourceTypeInfo->checkIsHiddenFile($fileName)) {
68
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
69
-        }
67
+		if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName) || $_resourceTypeInfo->checkIsHiddenFile($fileName)) {
68
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
69
+		}
70 70
 
71
-        if (!$_resourceTypeInfo->checkExtension($fileName, false)) {
72
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
73
-        }
71
+		if (!$_resourceTypeInfo->checkExtension($fileName, false)) {
72
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
73
+		}
74 74
 
75
-        $filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName);
75
+		$filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName);
76 76
 
77
-        $bDeleted = false;
77
+		$bDeleted = false;
78 78
 
79
-        if (!file_exists($filePath)) {
80
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND);
81
-        }
79
+		if (!file_exists($filePath)) {
80
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND);
81
+		}
82 82
 
83
-        if (!@unlink($filePath)) {
84
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
85
-        } else {
86
-            $bDeleted = true;
87
-        }
83
+		if (!@unlink($filePath)) {
84
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
85
+		} else {
86
+			$bDeleted = true;
87
+		}
88 88
 
89
-        if ($bDeleted) {
90
-            $thumbPath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getThumbsServerPath(), $fileName);
89
+		if ($bDeleted) {
90
+			$thumbPath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getThumbsServerPath(), $fileName);
91 91
 
92
-            @unlink($thumbPath);
92
+			@unlink($thumbPath);
93 93
 
94
-            $oDeleteFileNode = new Ckfinder_Connector_Utils_XmlNode("DeletedFile");
95
-            $this->_connectorNode->addChild($oDeleteFileNode);
94
+			$oDeleteFileNode = new Ckfinder_Connector_Utils_XmlNode("DeletedFile");
95
+			$this->_connectorNode->addChild($oDeleteFileNode);
96 96
 
97
-            $oDeleteFileNode->addAttribute("name", $fileName);
98
-        }
99
-    }
97
+			$oDeleteFileNode->addAttribute("name", $fileName);
98
+		}
99
+	}
100 100
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 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 DeleteFile command
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/php4/CommandHandler/RenameFolder.php 3 patches
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -32,83 +32,83 @@
 block discarded – undo
32 32
  */
33 33
 class CKFinder_Connector_CommandHandler_RenameFolder extends CKFinder_Connector_CommandHandler_XmlCommandHandlerBase
34 34
 {
35
-    /**
36
-     * Command name
37
-     *
38
-     * @access private
39
-     * @var string
40
-     */
41
-    var $command = "RenameFolder";
42
-
43
-
44
-    /**
45
-     * handle request and build XML
46
-     * @access protected
47
-     *
48
-     */
49
-    function buildXml()
50
-    {
51
-        if (empty($_POST['CKFinderCommand']) || $_POST['CKFinderCommand'] != 'true') {
52
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
53
-        }
54
-
55
-        if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FOLDER_RENAME)) {
56
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
57
-        }
58
-
59
-        if (!isset($_GET["NewFolderName"])) {
60
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
61
-        }
62
-
63
-        $newFolderName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_GET["NewFolderName"]);
64
-        $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
65
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
66
-        if ($_config->forceAscii()) {
67
-            $newFolderName = CKFinder_Connector_Utils_FileSystem::convertToAscii($newFolderName);
68
-        }
69
-
70
-        if (!CKFinder_Connector_Utils_FileSystem::checkFileName($newFolderName) || $resourceTypeInfo->checkIsHiddenFolder($newFolderName)) {
71
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
72
-        }
73
-
74
-        // The root folder cannot be deleted.
75
-        if ($this->_currentFolder->getClientPath() == "/") {
76
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
77
-        }
78
-
79
-        $oldFolderPath = $this->_currentFolder->getServerPath();
80
-        $bMoved = false;
81
-
82
-        if (!is_dir($oldFolderPath)) {
83
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
84
-        }
85
-
86
-        //let's calculate new folder name
87
-        $newFolderPath = dirname($oldFolderPath).DIRECTORY_SEPARATOR.$newFolderName.DIRECTORY_SEPARATOR;
88
-
89
-        if (file_exists(rtrim($newFolderPath, DIRECTORY_SEPARATOR))) {
90
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ALREADY_EXIST);
91
-        }
92
-
93
-        $bMoved = @rename($oldFolderPath, $newFolderPath);
94
-
95
-        if (!$bMoved) {
96
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
97
-        } else {
98
-            $newThumbsServerPath = dirname($this->_currentFolder->getThumbsServerPath()) . '/' . $newFolderName . '/';
99
-            if (!@rename($this->_currentFolder->getThumbsServerPath(), $newThumbsServerPath)) {
100
-                CKFinder_Connector_Utils_FileSystem::unlink($this->_currentFolder->getThumbsServerPath());
101
-            }
102
-        }
103
-
104
-        $newFolderPath = preg_replace(",[^/]+/?$,", $newFolderName, $this->_currentFolder->getClientPath()) . '/';
105
-        $newFolderUrl = $resourceTypeInfo->getUrl() . ltrim($newFolderPath, '/');
106
-
107
-        $oRenameNode = new Ckfinder_Connector_Utils_XmlNode("RenamedFolder");
108
-        $this->_connectorNode->addChild($oRenameNode);
109
-
110
-        $oRenameNode->addAttribute("newName", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($newFolderName));
111
-        $oRenameNode->addAttribute("newPath", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($newFolderPath));
112
-        $oRenameNode->addAttribute("newUrl", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($newFolderUrl));
113
-    }
35
+	/**
36
+	 * Command name
37
+	 *
38
+	 * @access private
39
+	 * @var string
40
+	 */
41
+	var $command = "RenameFolder";
42
+
43
+
44
+	/**
45
+	 * handle request and build XML
46
+	 * @access protected
47
+	 *
48
+	 */
49
+	function buildXml()
50
+	{
51
+		if (empty($_POST['CKFinderCommand']) || $_POST['CKFinderCommand'] != 'true') {
52
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
53
+		}
54
+
55
+		if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FOLDER_RENAME)) {
56
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
57
+		}
58
+
59
+		if (!isset($_GET["NewFolderName"])) {
60
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
61
+		}
62
+
63
+		$newFolderName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_GET["NewFolderName"]);
64
+		$resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
65
+		$_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
66
+		if ($_config->forceAscii()) {
67
+			$newFolderName = CKFinder_Connector_Utils_FileSystem::convertToAscii($newFolderName);
68
+		}
69
+
70
+		if (!CKFinder_Connector_Utils_FileSystem::checkFileName($newFolderName) || $resourceTypeInfo->checkIsHiddenFolder($newFolderName)) {
71
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
72
+		}
73
+
74
+		// The root folder cannot be deleted.
75
+		if ($this->_currentFolder->getClientPath() == "/") {
76
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
77
+		}
78
+
79
+		$oldFolderPath = $this->_currentFolder->getServerPath();
80
+		$bMoved = false;
81
+
82
+		if (!is_dir($oldFolderPath)) {
83
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
84
+		}
85
+
86
+		//let's calculate new folder name
87
+		$newFolderPath = dirname($oldFolderPath).DIRECTORY_SEPARATOR.$newFolderName.DIRECTORY_SEPARATOR;
88
+
89
+		if (file_exists(rtrim($newFolderPath, DIRECTORY_SEPARATOR))) {
90
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ALREADY_EXIST);
91
+		}
92
+
93
+		$bMoved = @rename($oldFolderPath, $newFolderPath);
94
+
95
+		if (!$bMoved) {
96
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
97
+		} else {
98
+			$newThumbsServerPath = dirname($this->_currentFolder->getThumbsServerPath()) . '/' . $newFolderName . '/';
99
+			if (!@rename($this->_currentFolder->getThumbsServerPath(), $newThumbsServerPath)) {
100
+				CKFinder_Connector_Utils_FileSystem::unlink($this->_currentFolder->getThumbsServerPath());
101
+			}
102
+		}
103
+
104
+		$newFolderPath = preg_replace(",[^/]+/?$,", $newFolderName, $this->_currentFolder->getClientPath()) . '/';
105
+		$newFolderUrl = $resourceTypeInfo->getUrl() . ltrim($newFolderPath, '/');
106
+
107
+		$oRenameNode = new Ckfinder_Connector_Utils_XmlNode("RenamedFolder");
108
+		$this->_connectorNode->addChild($oRenameNode);
109
+
110
+		$oRenameNode->addAttribute("newName", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($newFolderName));
111
+		$oRenameNode->addAttribute("newPath", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($newFolderPath));
112
+		$oRenameNode->addAttribute("newUrl", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($newFolderUrl));
113
+	}
114 114
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 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 RenameFolder command
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
         $newFolderName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_GET["NewFolderName"]);
64 64
         $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
65
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
65
+        $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config");
66 66
         if ($_config->forceAscii()) {
67 67
             $newFolderName = CKFinder_Connector_Utils_FileSystem::convertToAscii($newFolderName);
68 68
         }
@@ -95,14 +95,14 @@  discard block
 block discarded – undo
95 95
         if (!$bMoved) {
96 96
             $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
97 97
         } else {
98
-            $newThumbsServerPath = dirname($this->_currentFolder->getThumbsServerPath()) . '/' . $newFolderName . '/';
98
+            $newThumbsServerPath = dirname($this->_currentFolder->getThumbsServerPath()).'/'.$newFolderName.'/';
99 99
             if (!@rename($this->_currentFolder->getThumbsServerPath(), $newThumbsServerPath)) {
100 100
                 CKFinder_Connector_Utils_FileSystem::unlink($this->_currentFolder->getThumbsServerPath());
101 101
             }
102 102
         }
103 103
 
104
-        $newFolderPath = preg_replace(",[^/]+/?$,", $newFolderName, $this->_currentFolder->getClientPath()) . '/';
105
-        $newFolderUrl = $resourceTypeInfo->getUrl() . ltrim($newFolderPath, '/');
104
+        $newFolderPath = preg_replace(",[^/]+/?$,", $newFolderName, $this->_currentFolder->getClientPath()).'/';
105
+        $newFolderUrl = $resourceTypeInfo->getUrl().ltrim($newFolderPath, '/');
106 106
 
107 107
         $oRenameNode = new Ckfinder_Connector_Utils_XmlNode("RenamedFolder");
108 108
         $this->_connectorNode->addChild($oRenameNode);
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/php4/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
-    var $command = "Init";
42
-
43
-    function mustCheckRequest()
44
-    {
45
-        return false;
46
-    }
47
-
48
-    /**
49
-     * Must add CurrentFolder node?
50
-     *
51
-     * @return boolean
52
-     * @access protected
53
-     */
54
-    function mustAddCurrentFolderNode()
55
-    {
56
-        return false;
57
-    }
58
-
59
-    /**
60
-     * handle request and build XML
61
-     * @access protected
62
-     *
63
-     */
64
-    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
+	var $command = "Init";
42
+
43
+	function mustCheckRequest()
44
+	{
45
+		return false;
46
+	}
47
+
48
+	/**
49
+	 * Must add CurrentFolder node?
50
+	 *
51
+	 * @return boolean
52
+	 * @access protected
53
+	 */
54
+	function mustAddCurrentFolderNode()
55
+	{
56
+		return false;
57
+	}
58
+
59
+	/**
60
+	 * handle request and build XML
61
+	 * @access protected
62
+	 *
63
+	 */
64
+	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/php4/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
-    var $command = "DownloadFile";
30
+	/**
31
+	 * Command name
32
+	 *
33
+	 * @access private
34
+	 * @var string
35
+	 */
36
+	var $command = "DownloadFile";
37 37
 
38
-    /**
39
-     * send response (file)
40
-     * @access public
41
-     *
42
-     */
43
-    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
+	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
@@ -77,8 +79,7 @@  discard block
 block discarded – undo
77 79
         header("Expires: 0");
78 80
         if (!empty($_GET['format']) && $_GET['format'] == 'text') {
79 81
             header("Content-Type: text/plain; charset=utf-8");
80
-        }
81
-        else {
82
+        } else {
82 83
             header("Content-type: application/octet-stream; name=\"" . $fileName . "\"");
83 84
             header("Content-Disposition: attachment; filename=\"" . str_replace("\"", "\\\"", $fileName). "\"");
84 85
         }
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php4/CommandHandler/GetFiles.php 3 patches
Indentation   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -32,98 +32,98 @@
 block discarded – undo
32 32
  */
33 33
 class CKFinder_Connector_CommandHandler_GetFiles extends CKFinder_Connector_CommandHandler_XmlCommandHandlerBase
34 34
 {
35
-    /**
36
-     * Command name
37
-     *
38
-     * @access private
39
-     * @var string
40
-     */
41
-    var $command = "GetFiles";
35
+	/**
36
+	 * Command name
37
+	 *
38
+	 * @access private
39
+	 * @var string
40
+	 */
41
+	var $command = "GetFiles";
42 42
 
43
-    /**
44
-     * build XML
45
-     * @access protected
46
-     *
47
-     */
48
-    function buildXml()
49
-    {
50
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
51
-        if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_VIEW)) {
52
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
53
-        }
43
+	/**
44
+	 * build XML
45
+	 * @access protected
46
+	 *
47
+	 */
48
+	function buildXml()
49
+	{
50
+		$_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
51
+		if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_VIEW)) {
52
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
53
+		}
54 54
 
55
-        // Map the virtual path to the local server path.
56
-        $_sServerDir = $this->_currentFolder->getServerPath();
55
+		// Map the virtual path to the local server path.
56
+		$_sServerDir = $this->_currentFolder->getServerPath();
57 57
 
58
-        // Create the "Files" node.
59
-        $oFilesNode = new Ckfinder_Connector_Utils_XmlNode("Files");
60
-        $this->_connectorNode->addChild($oFilesNode);
58
+		// Create the "Files" node.
59
+		$oFilesNode = new Ckfinder_Connector_Utils_XmlNode("Files");
60
+		$this->_connectorNode->addChild($oFilesNode);
61 61
 
62
-        if (!is_dir($_sServerDir)) {
63
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FOLDER_NOT_FOUND);
64
-        }
62
+		if (!is_dir($_sServerDir)) {
63
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FOLDER_NOT_FOUND);
64
+		}
65 65
 
66
-        $files = array();
67
-        $thumbFiles = array();
66
+		$files = array();
67
+		$thumbFiles = array();
68 68
 
69
-        if ($dh = @opendir($_sServerDir)) {
70
-            while (($file = readdir($dh)) !== false) {
71
-                if ($file != "." && $file != ".." && !is_dir($_sServerDir . $file)) {
72
-                    $files[] = $file;
73
-                }
74
-            }
75
-            closedir($dh);
76
-        } else {
77
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
78
-        }
69
+		if ($dh = @opendir($_sServerDir)) {
70
+			while (($file = readdir($dh)) !== false) {
71
+				if ($file != "." && $file != ".." && !is_dir($_sServerDir . $file)) {
72
+					$files[] = $file;
73
+				}
74
+			}
75
+			closedir($dh);
76
+		} else {
77
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
78
+		}
79 79
 
80
-        $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
80
+		$resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
81 81
 
82
-        if (sizeof($files)>0) {
83
-            $_thumbnailsConfig = $_config->getThumbnailsConfig();
84
-            $_thumbServerPath = '';
85
-            $_showThumbs = (!empty($_GET['showThumbs']) && $_GET['showThumbs'] == 1);
86
-            if ($_thumbnailsConfig->getIsEnabled() && ($_thumbnailsConfig->getDirectAccess() || $_showThumbs)) {
87
-                $_thumbServerPath = $this->_currentFolder->getThumbsServerPath();
88
-            }
82
+		if (sizeof($files)>0) {
83
+			$_thumbnailsConfig = $_config->getThumbnailsConfig();
84
+			$_thumbServerPath = '';
85
+			$_showThumbs = (!empty($_GET['showThumbs']) && $_GET['showThumbs'] == 1);
86
+			if ($_thumbnailsConfig->getIsEnabled() && ($_thumbnailsConfig->getDirectAccess() || $_showThumbs)) {
87
+				$_thumbServerPath = $this->_currentFolder->getThumbsServerPath();
88
+			}
89 89
 
90
-            natcasesort($files);
91
-            $i=0;
92
-            foreach ($files as $file) {
93
-                $filemtime = @filemtime($_sServerDir . $file);
90
+			natcasesort($files);
91
+			$i=0;
92
+			foreach ($files as $file) {
93
+				$filemtime = @filemtime($_sServerDir . $file);
94 94
 
95
-                //otherwise file doesn't exist or we can't get it's filename properly
96
-                if ($filemtime !== false) {
97
-                    $filename = CKFinder_Connector_Utils_Misc::mbBasename($file);
98
-                    if (!$resourceTypeInfo->checkExtension($filename, false)) {
99
-                        continue;
100
-                    }
101
-                    if ($resourceTypeInfo->checkIsHiddenFile($filename)) {
102
-                        continue;
103
-                    }
104
-                    $oFileNode[$i] = new Ckfinder_Connector_Utils_XmlNode("File");
105
-                    $oFilesNode->addChild($oFileNode[$i]);
106
-                    $oFileNode[$i]->addAttribute("name", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding(CKFinder_Connector_Utils_Misc::mbBasename($file)));
107
-                    $oFileNode[$i]->addAttribute("date", date("YmdHi", $filemtime));
108
-                    if (!empty($_thumbServerPath) && preg_match(CKFINDER_REGEX_IMAGES_EXT, $filename)) {
109
-                        if (file_exists($_thumbServerPath . $filename)) {
110
-                            $oFileNode[$i]->addAttribute("thumb", $filename);
111
-                        }
112
-                        elseif ($_showThumbs) {
113
-                            $oFileNode[$i]->addAttribute("thumb", "?" . $filename);
114
-                        }
115
-                    }
116
-                    $size = filesize($_sServerDir . $file);
117
-                    if ($size && $size<1024) {
118
-                        $size = 1;
119
-                    }
120
-                    else {
121
-                        $size = (int)round($size / 1024);
122
-                    }
123
-                    $oFileNode[$i]->addAttribute("size", $size);
124
-                    $i++;
125
-                }
126
-            }
127
-        }
128
-    }
95
+				//otherwise file doesn't exist or we can't get it's filename properly
96
+				if ($filemtime !== false) {
97
+					$filename = CKFinder_Connector_Utils_Misc::mbBasename($file);
98
+					if (!$resourceTypeInfo->checkExtension($filename, false)) {
99
+						continue;
100
+					}
101
+					if ($resourceTypeInfo->checkIsHiddenFile($filename)) {
102
+						continue;
103
+					}
104
+					$oFileNode[$i] = new Ckfinder_Connector_Utils_XmlNode("File");
105
+					$oFilesNode->addChild($oFileNode[$i]);
106
+					$oFileNode[$i]->addAttribute("name", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding(CKFinder_Connector_Utils_Misc::mbBasename($file)));
107
+					$oFileNode[$i]->addAttribute("date", date("YmdHi", $filemtime));
108
+					if (!empty($_thumbServerPath) && preg_match(CKFINDER_REGEX_IMAGES_EXT, $filename)) {
109
+						if (file_exists($_thumbServerPath . $filename)) {
110
+							$oFileNode[$i]->addAttribute("thumb", $filename);
111
+						}
112
+						elseif ($_showThumbs) {
113
+							$oFileNode[$i]->addAttribute("thumb", "?" . $filename);
114
+						}
115
+					}
116
+					$size = filesize($_sServerDir . $file);
117
+					if ($size && $size<1024) {
118
+						$size = 1;
119
+					}
120
+					else {
121
+						$size = (int)round($size / 1024);
122
+					}
123
+					$oFileNode[$i]->addAttribute("size", $size);
124
+					$i++;
125
+				}
126
+			}
127
+		}
128
+	}
129 129
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 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 GetFiles command
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     function buildXml()
49 49
     {
50
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
50
+        $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config");
51 51
         if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_VIEW)) {
52 52
             $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
53 53
         }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
         if ($dh = @opendir($_sServerDir)) {
70 70
             while (($file = readdir($dh)) !== false) {
71
-                if ($file != "." && $file != ".." && !is_dir($_sServerDir . $file)) {
71
+                if ($file != "." && $file != ".." && !is_dir($_sServerDir.$file)) {
72 72
                     $files[] = $file;
73 73
                 }
74 74
             }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
         $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
81 81
 
82
-        if (sizeof($files)>0) {
82
+        if (sizeof($files) > 0) {
83 83
             $_thumbnailsConfig = $_config->getThumbnailsConfig();
84 84
             $_thumbServerPath = '';
85 85
             $_showThumbs = (!empty($_GET['showThumbs']) && $_GET['showThumbs'] == 1);
@@ -88,9 +88,9 @@  discard block
 block discarded – undo
88 88
             }
89 89
 
90 90
             natcasesort($files);
91
-            $i=0;
91
+            $i = 0;
92 92
             foreach ($files as $file) {
93
-                $filemtime = @filemtime($_sServerDir . $file);
93
+                $filemtime = @filemtime($_sServerDir.$file);
94 94
 
95 95
                 //otherwise file doesn't exist or we can't get it's filename properly
96 96
                 if ($filemtime !== false) {
@@ -106,15 +106,15 @@  discard block
 block discarded – undo
106 106
                     $oFileNode[$i]->addAttribute("name", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding(CKFinder_Connector_Utils_Misc::mbBasename($file)));
107 107
                     $oFileNode[$i]->addAttribute("date", date("YmdHi", $filemtime));
108 108
                     if (!empty($_thumbServerPath) && preg_match(CKFINDER_REGEX_IMAGES_EXT, $filename)) {
109
-                        if (file_exists($_thumbServerPath . $filename)) {
109
+                        if (file_exists($_thumbServerPath.$filename)) {
110 110
                             $oFileNode[$i]->addAttribute("thumb", $filename);
111 111
                         }
112 112
                         elseif ($_showThumbs) {
113
-                            $oFileNode[$i]->addAttribute("thumb", "?" . $filename);
113
+                            $oFileNode[$i]->addAttribute("thumb", "?".$filename);
114 114
                         }
115 115
                     }
116
-                    $size = filesize($_sServerDir . $file);
117
-                    if ($size && $size<1024) {
116
+                    $size = filesize($_sServerDir.$file);
117
+                    if ($size && $size < 1024) {
118 118
                         $size = 1;
119 119
                     }
120 120
                     else {
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
@@ -108,16 +110,14 @@  discard block
 block discarded – undo
108 110
                     if (!empty($_thumbServerPath) && preg_match(CKFINDER_REGEX_IMAGES_EXT, $filename)) {
109 111
                         if (file_exists($_thumbServerPath . $filename)) {
110 112
                             $oFileNode[$i]->addAttribute("thumb", $filename);
111
-                        }
112
-                        elseif ($_showThumbs) {
113
+                        } elseif ($_showThumbs) {
113 114
                             $oFileNode[$i]->addAttribute("thumb", "?" . $filename);
114 115
                         }
115 116
                     }
116 117
                     $size = filesize($_sServerDir . $file);
117 118
                     if ($size && $size<1024) {
118 119
                         $size = 1;
119
-                    }
120
-                    else {
120
+                    } else {
121 121
                         $size = (int)round($size / 1024);
122 122
                     }
123 123
                     $oFileNode[$i]->addAttribute("size", $size);
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php4/Utils/Security.php 3 patches
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -26,50 +26,50 @@
 block discarded – undo
26 26
 class CKFinder_Connector_Utils_Security
27 27
 {
28 28
 
29
-    /**
30
-     * Strip quotes from global arrays
31
-     * @access public
32
-     */
33
-    function getRidOfMagicQuotes()
34
-    {
35
-        if (get_magic_quotes_gpc()) {
36
-            if (!empty($_GET)) {
37
-                $this->stripQuotes($_GET);
38
-            }
39
-            if (!empty($_POST)) {
40
-                $this->stripQuotes($_POST);
41
-            }
42
-            if (!empty($_COOKIE)) {
43
-                $this->stripQuotes($_COOKIE);
44
-            }
45
-            if (!empty($_FILES)) {
46
-                while (list($k,$v) = each($_FILES)) {
47
-                    if (isset($_FILES[$k]['name'])) {
48
-                        $this->stripQuotes($_FILES[$k]['name']);
49
-                    }
50
-                }
51
-            }
52
-        }
53
-    }
29
+	/**
30
+	 * Strip quotes from global arrays
31
+	 * @access public
32
+	 */
33
+	function getRidOfMagicQuotes()
34
+	{
35
+		if (get_magic_quotes_gpc()) {
36
+			if (!empty($_GET)) {
37
+				$this->stripQuotes($_GET);
38
+			}
39
+			if (!empty($_POST)) {
40
+				$this->stripQuotes($_POST);
41
+			}
42
+			if (!empty($_COOKIE)) {
43
+				$this->stripQuotes($_COOKIE);
44
+			}
45
+			if (!empty($_FILES)) {
46
+				while (list($k,$v) = each($_FILES)) {
47
+					if (isset($_FILES[$k]['name'])) {
48
+						$this->stripQuotes($_FILES[$k]['name']);
49
+					}
50
+				}
51
+			}
52
+		}
53
+	}
54 54
 
55
-    /**
56
-     * Strip quotes from variable
57
-     *
58
-     * @access public
59
-     * @param mixed $var
60
-     * @param int $depth current depth
61
-     * @param int $howDeep maximum depth
62
-     */
63
-    function stripQuotes(&$var, $depth=0, $howDeep=5)
64
-    {
65
-        if (is_array($var)) {
66
-            if ($depth++<$howDeep) {
67
-                while (list($k,$v) = each($var)) {
68
-                    $this->stripQuotes($var[$k], $depth, $howDeep);
69
-                }
70
-            }
71
-        } else {
72
-            $var = stripslashes($var);
73
-        }
74
-    }
55
+	/**
56
+	 * Strip quotes from variable
57
+	 *
58
+	 * @access public
59
+	 * @param mixed $var
60
+	 * @param int $depth current depth
61
+	 * @param int $howDeep maximum depth
62
+	 */
63
+	function stripQuotes(&$var, $depth=0, $howDeep=5)
64
+	{
65
+		if (is_array($var)) {
66
+			if ($depth++<$howDeep) {
67
+				while (list($k,$v) = each($var)) {
68
+					$this->stripQuotes($var[$k], $depth, $howDeep);
69
+				}
70
+			}
71
+		} else {
72
+			$var = stripslashes($var);
73
+		}
74
+	}
75 75
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
                 $this->stripQuotes($_COOKIE);
44 44
             }
45 45
             if (!empty($_FILES)) {
46
-                while (list($k,$v) = each($_FILES)) {
46
+                while (list($k, $v) = each($_FILES)) {
47 47
                     if (isset($_FILES[$k]['name'])) {
48 48
                         $this->stripQuotes($_FILES[$k]['name']);
49 49
                     }
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
      * @param int $depth current depth
61 61
      * @param int $howDeep maximum depth
62 62
      */
63
-    function stripQuotes(&$var, $depth=0, $howDeep=5)
63
+    function stripQuotes(&$var, $depth = 0, $howDeep = 5)
64 64
     {
65 65
         if (is_array($var)) {
66
-            if ($depth++<$howDeep) {
67
-                while (list($k,$v) = each($var)) {
66
+            if ($depth++ < $howDeep) {
67
+                while (list($k, $v) = each($var)) {
68 68
                     $this->stripQuotes($var[$k], $depth, $howDeep);
69 69
                 }
70 70
             }
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.