@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | <script src="<?=LIBSWEBROOT?>popup/js/popup.js"></script> |
| 9 | 9 | <link rel="stylesheet" type="text/css" href="<?=LIBSWEBROOT?>checkbox/css/style.css"> |
| 10 | 10 | <script src="<?=LIBSWEBROOT?>checkbox/js/anim.js"></script> |
| 11 | -<?php require_once('header.php');?> |
|
| 11 | +<?php require_once('header.php'); ?> |
|
| 12 | 12 | |
| 13 | 13 | <div class="inner"> |
| 14 | 14 | <a class="submit-contenu supprimer-page link" href="<?=ADMWEBROOT?>configuration/index"><i class="fa fa-times"></i>Annuler</a> |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | <td>Le site est il toujours en développement</td> |
| 21 | 21 | <td> |
| 22 | 22 | <label for="developpement" class="checkbox-perso switched"> |
| 23 | - <input type="checkbox" class="test-check" id="developpement" name="developpement" <?php if ($developpement == 1): ?>checked<?php endif;?>> |
|
| 23 | + <input type="checkbox" class="test-check" id="developpement" name="developpement" <?php if ($developpement == 1): ?>checked<?php endif; ?>> |
|
| 24 | 24 | </label> |
| 25 | 25 | </td> |
| 26 | 26 | </tr> |
@@ -22,13 +22,13 @@ discard block |
||
| 22 | 22 | </tr> |
| 23 | 23 | </thead> |
| 24 | 24 | <tbody> |
| 25 | - <?php for ($i=0 ; $i<count($gestion_module->getNom()) ; $i++):?> |
|
| 25 | + <?php for ($i = 0; $i < count($gestion_module->getNom()); $i++):?> |
|
| 26 | 26 | <tr> |
| 27 | 27 | <td><?=$gestion_module->getNom()[$i]?></td> |
| 28 | 28 | <td><?=$gestion_module->getVersion()[$i]?></td> |
| 29 | 29 | <td><?=$gestion_module->getOnlineVersion()[$i]?></td> |
| 30 | 30 | </tr> |
| 31 | - <?php endfor;?> |
|
| 31 | + <?php endfor; ?> |
|
| 32 | 32 | </tbody> |
| 33 | 33 | </table> |
| 34 | 34 | |
@@ -37,6 +37,6 @@ discard block |
||
| 37 | 37 | soit par le menu ou en cliquant sur le lien ci-dessous. |
| 38 | 38 | </p> |
| 39 | 39 | <a href="<?=ADMWEBROOT?>configuration/module" class="submit-contenu submit-standard no-shadow inline ml0">Configuration des modules</a> |
| 40 | - <?php endif;?> |
|
| 40 | + <?php endif; ?> |
|
| 41 | 41 | </div> |
| 42 | 42 | </div> |
| 43 | 43 | \ No newline at end of file |
@@ -15,174 +15,174 @@ |
||
| 15 | 15 | |
| 16 | 16 | class Watermark |
| 17 | 17 | { |
| 18 | - function onAfterFileUpload($currentFolder, $uploadedFile, $sFilePath) |
|
| 19 | - { |
|
| 20 | - global $config; |
|
| 21 | - $watermarkSettings = $config['Plugin_Watermark']; |
|
| 18 | + function onAfterFileUpload($currentFolder, $uploadedFile, $sFilePath) |
|
| 19 | + { |
|
| 20 | + global $config; |
|
| 21 | + $watermarkSettings = $config['Plugin_Watermark']; |
|
| 22 | 22 | |
| 23 | - $this->createWatermark($sFilePath, $watermarkSettings['source'], $watermarkSettings['marginRight'], |
|
| 24 | - $watermarkSettings['marginBottom'], $watermarkSettings['quality'], $watermarkSettings['transparency']); |
|
| 23 | + $this->createWatermark($sFilePath, $watermarkSettings['source'], $watermarkSettings['marginRight'], |
|
| 24 | + $watermarkSettings['marginBottom'], $watermarkSettings['quality'], $watermarkSettings['transparency']); |
|
| 25 | 25 | |
| 26 | - return true; |
|
| 27 | - } |
|
| 26 | + return true; |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - function createWatermark($sourceFile, $watermarkFile, $marginLeft = 5, $marginBottom = 5, $quality = 90, $transparency = 100) |
|
| 30 | - { |
|
| 31 | - if (!file_exists($watermarkFile)) { |
|
| 32 | - $watermarkFile = dirname(__FILE__) . "/" . $watermarkFile; |
|
| 33 | - } |
|
| 34 | - if (!file_exists($watermarkFile)) { |
|
| 35 | - return false; |
|
| 36 | - } |
|
| 29 | + function createWatermark($sourceFile, $watermarkFile, $marginLeft = 5, $marginBottom = 5, $quality = 90, $transparency = 100) |
|
| 30 | + { |
|
| 31 | + if (!file_exists($watermarkFile)) { |
|
| 32 | + $watermarkFile = dirname(__FILE__) . "/" . $watermarkFile; |
|
| 33 | + } |
|
| 34 | + if (!file_exists($watermarkFile)) { |
|
| 35 | + return false; |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - $watermarkImageAttr = @getimagesize($watermarkFile); |
|
| 39 | - $sourceImageAttr = @getimagesize($sourceFile); |
|
| 40 | - if ($sourceImageAttr === false || $watermarkImageAttr === false) { |
|
| 41 | - return false; |
|
| 42 | - } |
|
| 38 | + $watermarkImageAttr = @getimagesize($watermarkFile); |
|
| 39 | + $sourceImageAttr = @getimagesize($sourceFile); |
|
| 40 | + if ($sourceImageAttr === false || $watermarkImageAttr === false) { |
|
| 41 | + return false; |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - switch ($watermarkImageAttr['mime']) |
|
| 45 | - { |
|
| 46 | - case 'image/gif': |
|
| 47 | - { |
|
| 48 | - if (@imagetypes() & IMG_GIF) { |
|
| 49 | - $oWatermarkImage = @imagecreatefromgif($watermarkFile); |
|
| 50 | - } else { |
|
| 51 | - $ermsg = 'GIF images are not supported'; |
|
| 52 | - } |
|
| 53 | - } |
|
| 54 | - break; |
|
| 55 | - case 'image/jpeg': |
|
| 56 | - { |
|
| 57 | - if (@imagetypes() & IMG_JPG) { |
|
| 58 | - $oWatermarkImage = @imagecreatefromjpeg($watermarkFile) ; |
|
| 59 | - } else { |
|
| 60 | - $ermsg = 'JPEG images are not supported'; |
|
| 61 | - } |
|
| 62 | - } |
|
| 63 | - break; |
|
| 64 | - case 'image/png': |
|
| 65 | - { |
|
| 66 | - if (@imagetypes() & IMG_PNG) { |
|
| 67 | - $oWatermarkImage = @imagecreatefrompng($watermarkFile) ; |
|
| 68 | - } else { |
|
| 69 | - $ermsg = 'PNG images are not supported'; |
|
| 70 | - } |
|
| 71 | - } |
|
| 72 | - break; |
|
| 73 | - case 'image/wbmp': |
|
| 74 | - { |
|
| 75 | - if (@imagetypes() & IMG_WBMP) { |
|
| 76 | - $oWatermarkImage = @imagecreatefromwbmp($watermarkFile); |
|
| 77 | - } else { |
|
| 78 | - $ermsg = 'WBMP images are not supported'; |
|
| 79 | - } |
|
| 80 | - } |
|
| 81 | - break; |
|
| 82 | - default: |
|
| 83 | - $ermsg = $watermarkImageAttr['mime'].' images are not supported'; |
|
| 84 | - break; |
|
| 85 | - } |
|
| 44 | + switch ($watermarkImageAttr['mime']) |
|
| 45 | + { |
|
| 46 | + case 'image/gif': |
|
| 47 | + { |
|
| 48 | + if (@imagetypes() & IMG_GIF) { |
|
| 49 | + $oWatermarkImage = @imagecreatefromgif($watermarkFile); |
|
| 50 | + } else { |
|
| 51 | + $ermsg = 'GIF images are not supported'; |
|
| 52 | + } |
|
| 53 | + } |
|
| 54 | + break; |
|
| 55 | + case 'image/jpeg': |
|
| 56 | + { |
|
| 57 | + if (@imagetypes() & IMG_JPG) { |
|
| 58 | + $oWatermarkImage = @imagecreatefromjpeg($watermarkFile) ; |
|
| 59 | + } else { |
|
| 60 | + $ermsg = 'JPEG images are not supported'; |
|
| 61 | + } |
|
| 62 | + } |
|
| 63 | + break; |
|
| 64 | + case 'image/png': |
|
| 65 | + { |
|
| 66 | + if (@imagetypes() & IMG_PNG) { |
|
| 67 | + $oWatermarkImage = @imagecreatefrompng($watermarkFile) ; |
|
| 68 | + } else { |
|
| 69 | + $ermsg = 'PNG images are not supported'; |
|
| 70 | + } |
|
| 71 | + } |
|
| 72 | + break; |
|
| 73 | + case 'image/wbmp': |
|
| 74 | + { |
|
| 75 | + if (@imagetypes() & IMG_WBMP) { |
|
| 76 | + $oWatermarkImage = @imagecreatefromwbmp($watermarkFile); |
|
| 77 | + } else { |
|
| 78 | + $ermsg = 'WBMP images are not supported'; |
|
| 79 | + } |
|
| 80 | + } |
|
| 81 | + break; |
|
| 82 | + default: |
|
| 83 | + $ermsg = $watermarkImageAttr['mime'].' images are not supported'; |
|
| 84 | + break; |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | - switch ($sourceImageAttr['mime']) |
|
| 88 | - { |
|
| 89 | - case 'image/gif': |
|
| 90 | - { |
|
| 91 | - if (@imagetypes() & IMG_GIF) { |
|
| 92 | - $oImage = @imagecreatefromgif($sourceFile); |
|
| 93 | - } else { |
|
| 94 | - $ermsg = 'GIF images are not supported'; |
|
| 95 | - } |
|
| 96 | - } |
|
| 97 | - break; |
|
| 98 | - case 'image/jpeg': |
|
| 99 | - { |
|
| 100 | - if (@imagetypes() & IMG_JPG) { |
|
| 101 | - $oImage = @imagecreatefromjpeg($sourceFile) ; |
|
| 102 | - } else { |
|
| 103 | - $ermsg = 'JPEG images are not supported'; |
|
| 104 | - } |
|
| 105 | - } |
|
| 106 | - break; |
|
| 107 | - case 'image/png': |
|
| 108 | - { |
|
| 109 | - if (@imagetypes() & IMG_PNG) { |
|
| 110 | - $oImage = @imagecreatefrompng($sourceFile) ; |
|
| 111 | - } else { |
|
| 112 | - $ermsg = 'PNG images are not supported'; |
|
| 113 | - } |
|
| 114 | - } |
|
| 115 | - break; |
|
| 116 | - case 'image/wbmp': |
|
| 117 | - { |
|
| 118 | - if (@imagetypes() & IMG_WBMP) { |
|
| 119 | - $oImage = @imagecreatefromwbmp($sourceFile); |
|
| 120 | - } else { |
|
| 121 | - $ermsg = 'WBMP images are not supported'; |
|
| 122 | - } |
|
| 123 | - } |
|
| 124 | - break; |
|
| 125 | - default: |
|
| 126 | - $ermsg = $sourceImageAttr['mime'].' images are not supported'; |
|
| 127 | - break; |
|
| 128 | - } |
|
| 87 | + switch ($sourceImageAttr['mime']) |
|
| 88 | + { |
|
| 89 | + case 'image/gif': |
|
| 90 | + { |
|
| 91 | + if (@imagetypes() & IMG_GIF) { |
|
| 92 | + $oImage = @imagecreatefromgif($sourceFile); |
|
| 93 | + } else { |
|
| 94 | + $ermsg = 'GIF images are not supported'; |
|
| 95 | + } |
|
| 96 | + } |
|
| 97 | + break; |
|
| 98 | + case 'image/jpeg': |
|
| 99 | + { |
|
| 100 | + if (@imagetypes() & IMG_JPG) { |
|
| 101 | + $oImage = @imagecreatefromjpeg($sourceFile) ; |
|
| 102 | + } else { |
|
| 103 | + $ermsg = 'JPEG images are not supported'; |
|
| 104 | + } |
|
| 105 | + } |
|
| 106 | + break; |
|
| 107 | + case 'image/png': |
|
| 108 | + { |
|
| 109 | + if (@imagetypes() & IMG_PNG) { |
|
| 110 | + $oImage = @imagecreatefrompng($sourceFile) ; |
|
| 111 | + } else { |
|
| 112 | + $ermsg = 'PNG images are not supported'; |
|
| 113 | + } |
|
| 114 | + } |
|
| 115 | + break; |
|
| 116 | + case 'image/wbmp': |
|
| 117 | + { |
|
| 118 | + if (@imagetypes() & IMG_WBMP) { |
|
| 119 | + $oImage = @imagecreatefromwbmp($sourceFile); |
|
| 120 | + } else { |
|
| 121 | + $ermsg = 'WBMP images are not supported'; |
|
| 122 | + } |
|
| 123 | + } |
|
| 124 | + break; |
|
| 125 | + default: |
|
| 126 | + $ermsg = $sourceImageAttr['mime'].' images are not supported'; |
|
| 127 | + break; |
|
| 128 | + } |
|
| 129 | 129 | |
| 130 | - if (isset($ermsg) || false === $oImage || false === $oWatermarkImage) { |
|
| 131 | - return false; |
|
| 132 | - } |
|
| 130 | + if (isset($ermsg) || false === $oImage || false === $oWatermarkImage) { |
|
| 131 | + return false; |
|
| 132 | + } |
|
| 133 | 133 | |
| 134 | - $watermark_width = $watermarkImageAttr[0]; |
|
| 135 | - $watermark_height = $watermarkImageAttr[1]; |
|
| 136 | - $dest_x = $sourceImageAttr[0] - $watermark_width - $marginLeft; |
|
| 137 | - $dest_y = $sourceImageAttr[1] - $watermark_height - $marginBottom; |
|
| 134 | + $watermark_width = $watermarkImageAttr[0]; |
|
| 135 | + $watermark_height = $watermarkImageAttr[1]; |
|
| 136 | + $dest_x = $sourceImageAttr[0] - $watermark_width - $marginLeft; |
|
| 137 | + $dest_y = $sourceImageAttr[1] - $watermark_height - $marginBottom; |
|
| 138 | 138 | |
| 139 | - if ( $sourceImageAttr['mime'] == 'image/png') |
|
| 140 | - { |
|
| 141 | - if(function_exists('imagesavealpha') && function_exists('imagecolorallocatealpha') ) |
|
| 142 | - { |
|
| 143 | - $bg = imagecolorallocatealpha($oImage, 255, 255, 255, 127); // (PHP 4 >= 4.3.2, PHP 5) |
|
| 144 | - imagefill($oImage, 0, 0 , $bg); |
|
| 145 | - imagealphablending($oImage, false); |
|
| 146 | - imagesavealpha($oImage, true); // (PHP 4 >= 4.3.2, PHP 5) |
|
| 147 | - } |
|
| 148 | - } |
|
| 149 | - if ($watermarkImageAttr['mime'] == 'image/png') { |
|
| 150 | - imagecopy($oImage, $oWatermarkImage, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height); |
|
| 151 | - } |
|
| 152 | - else { |
|
| 153 | - imagecopymerge($oImage, $oWatermarkImage, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, $transparency); |
|
| 154 | - } |
|
| 139 | + if ( $sourceImageAttr['mime'] == 'image/png') |
|
| 140 | + { |
|
| 141 | + if(function_exists('imagesavealpha') && function_exists('imagecolorallocatealpha') ) |
|
| 142 | + { |
|
| 143 | + $bg = imagecolorallocatealpha($oImage, 255, 255, 255, 127); // (PHP 4 >= 4.3.2, PHP 5) |
|
| 144 | + imagefill($oImage, 0, 0 , $bg); |
|
| 145 | + imagealphablending($oImage, false); |
|
| 146 | + imagesavealpha($oImage, true); // (PHP 4 >= 4.3.2, PHP 5) |
|
| 147 | + } |
|
| 148 | + } |
|
| 149 | + if ($watermarkImageAttr['mime'] == 'image/png') { |
|
| 150 | + imagecopy($oImage, $oWatermarkImage, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height); |
|
| 151 | + } |
|
| 152 | + else { |
|
| 153 | + imagecopymerge($oImage, $oWatermarkImage, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, $transparency); |
|
| 154 | + } |
|
| 155 | 155 | |
| 156 | - switch ($sourceImageAttr['mime']) |
|
| 157 | - { |
|
| 158 | - case 'image/gif': |
|
| 159 | - imagegif($oImage, $sourceFile); |
|
| 160 | - break; |
|
| 161 | - case 'image/jpeg': |
|
| 162 | - imagejpeg($oImage, $sourceFile, $quality); |
|
| 163 | - break; |
|
| 164 | - case 'image/png': |
|
| 165 | - imagepng($oImage, $sourceFile); |
|
| 166 | - break; |
|
| 167 | - case 'image/wbmp': |
|
| 168 | - imagewbmp($oImage, $sourceFile); |
|
| 169 | - break; |
|
| 170 | - } |
|
| 156 | + switch ($sourceImageAttr['mime']) |
|
| 157 | + { |
|
| 158 | + case 'image/gif': |
|
| 159 | + imagegif($oImage, $sourceFile); |
|
| 160 | + break; |
|
| 161 | + case 'image/jpeg': |
|
| 162 | + imagejpeg($oImage, $sourceFile, $quality); |
|
| 163 | + break; |
|
| 164 | + case 'image/png': |
|
| 165 | + imagepng($oImage, $sourceFile); |
|
| 166 | + break; |
|
| 167 | + case 'image/wbmp': |
|
| 168 | + imagewbmp($oImage, $sourceFile); |
|
| 169 | + break; |
|
| 170 | + } |
|
| 171 | 171 | |
| 172 | - imageDestroy($oImage); |
|
| 173 | - imageDestroy($oWatermarkImage); |
|
| 174 | - } |
|
| 172 | + imageDestroy($oImage); |
|
| 173 | + imageDestroy($oWatermarkImage); |
|
| 174 | + } |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | $watermark = new Watermark(); |
| 178 | 178 | $config['Hooks']['AfterFileUpload'][] = array($watermark, 'onAfterFileUpload'); |
| 179 | 179 | if (empty($config['Plugin_Watermark'])) |
| 180 | 180 | { |
| 181 | - $config['Plugin_Watermark'] = array( |
|
| 182 | - "source" => "logo.gif", |
|
| 183 | - "marginRight" => 5, |
|
| 184 | - "marginBottom" => 5, |
|
| 185 | - "quality" => 90, |
|
| 186 | - "transparency" => 80, |
|
| 187 | - ); |
|
| 181 | + $config['Plugin_Watermark'] = array( |
|
| 182 | + "source" => "logo.gif", |
|
| 183 | + "marginRight" => 5, |
|
| 184 | + "marginBottom" => 5, |
|
| 185 | + "quality" => 90, |
|
| 186 | + "transparency" => 80, |
|
| 187 | + ); |
|
| 188 | 188 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | function createWatermark($sourceFile, $watermarkFile, $marginLeft = 5, $marginBottom = 5, $quality = 90, $transparency = 100) |
| 30 | 30 | { |
| 31 | 31 | if (!file_exists($watermarkFile)) { |
| 32 | - $watermarkFile = dirname(__FILE__) . "/" . $watermarkFile; |
|
| 32 | + $watermarkFile = dirname(__FILE__)."/".$watermarkFile; |
|
| 33 | 33 | } |
| 34 | 34 | if (!file_exists($watermarkFile)) { |
| 35 | 35 | return false; |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | case 'image/jpeg': |
| 56 | 56 | { |
| 57 | 57 | if (@imagetypes() & IMG_JPG) { |
| 58 | - $oWatermarkImage = @imagecreatefromjpeg($watermarkFile) ; |
|
| 58 | + $oWatermarkImage = @imagecreatefromjpeg($watermarkFile); |
|
| 59 | 59 | } else { |
| 60 | 60 | $ermsg = 'JPEG images are not supported'; |
| 61 | 61 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | case 'image/png': |
| 65 | 65 | { |
| 66 | 66 | if (@imagetypes() & IMG_PNG) { |
| 67 | - $oWatermarkImage = @imagecreatefrompng($watermarkFile) ; |
|
| 67 | + $oWatermarkImage = @imagecreatefrompng($watermarkFile); |
|
| 68 | 68 | } else { |
| 69 | 69 | $ermsg = 'PNG images are not supported'; |
| 70 | 70 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | case 'image/jpeg': |
| 99 | 99 | { |
| 100 | 100 | if (@imagetypes() & IMG_JPG) { |
| 101 | - $oImage = @imagecreatefromjpeg($sourceFile) ; |
|
| 101 | + $oImage = @imagecreatefromjpeg($sourceFile); |
|
| 102 | 102 | } else { |
| 103 | 103 | $ermsg = 'JPEG images are not supported'; |
| 104 | 104 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | case 'image/png': |
| 108 | 108 | { |
| 109 | 109 | if (@imagetypes() & IMG_PNG) { |
| 110 | - $oImage = @imagecreatefrompng($sourceFile) ; |
|
| 110 | + $oImage = @imagecreatefrompng($sourceFile); |
|
| 111 | 111 | } else { |
| 112 | 112 | $ermsg = 'PNG images are not supported'; |
| 113 | 113 | } |
@@ -136,14 +136,14 @@ discard block |
||
| 136 | 136 | $dest_x = $sourceImageAttr[0] - $watermark_width - $marginLeft; |
| 137 | 137 | $dest_y = $sourceImageAttr[1] - $watermark_height - $marginBottom; |
| 138 | 138 | |
| 139 | - if ( $sourceImageAttr['mime'] == 'image/png') |
|
| 139 | + if ($sourceImageAttr['mime'] == 'image/png') |
|
| 140 | 140 | { |
| 141 | - if(function_exists('imagesavealpha') && function_exists('imagecolorallocatealpha') ) |
|
| 141 | + if (function_exists('imagesavealpha') && function_exists('imagecolorallocatealpha')) |
|
| 142 | 142 | { |
| 143 | 143 | $bg = imagecolorallocatealpha($oImage, 255, 255, 255, 127); // (PHP 4 >= 4.3.2, PHP 5) |
| 144 | - imagefill($oImage, 0, 0 , $bg); |
|
| 144 | + imagefill($oImage, 0, 0, $bg); |
|
| 145 | 145 | imagealphablending($oImage, false); |
| 146 | - imagesavealpha($oImage, true); // (PHP 4 >= 4.3.2, PHP 5) |
|
| 146 | + imagesavealpha($oImage, true); // (PHP 4 >= 4.3.2, PHP 5) |
|
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | if ($watermarkImageAttr['mime'] == 'image/png') { |
@@ -148,8 +148,7 @@ |
||
| 148 | 148 | } |
| 149 | 149 | if ($watermarkImageAttr['mime'] == 'image/png') { |
| 150 | 150 | imagecopy($oImage, $oWatermarkImage, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height); |
| 151 | - } |
|
| 152 | - else { |
|
| 151 | + } else { |
|
| 153 | 152 | imagecopymerge($oImage, $oWatermarkImage, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, $transparency); |
| 154 | 153 | } |
| 155 | 154 | |
@@ -21,221 +21,221 @@ |
||
| 21 | 21 | |
| 22 | 22 | class CKFinder_Connector_CommandHandler_ImageResize extends CKFinder_Connector_CommandHandler_XmlCommandHandlerBase |
| 23 | 23 | { |
| 24 | - /** |
|
| 25 | - * @access private |
|
| 26 | - */ |
|
| 27 | - function getConfig() |
|
| 28 | - { |
|
| 29 | - $config = array(); |
|
| 30 | - if (isset($GLOBALS['config']['plugin_imageresize'])) { |
|
| 31 | - $config = $GLOBALS['config']['plugin_imageresize']; |
|
| 32 | - } |
|
| 33 | - if (!isset($config['smallThumb'])) { |
|
| 34 | - $config['smallThumb'] = "90x90"; |
|
| 35 | - } |
|
| 36 | - if (!isset($config['mediumThumb'])) { |
|
| 37 | - $config['mediumThumb'] = "120x120"; |
|
| 38 | - } |
|
| 39 | - if (!isset($config['largeThumb'])) { |
|
| 40 | - $config['largeThumb'] = "180x180"; |
|
| 41 | - } |
|
| 42 | - return $config; |
|
| 43 | - } |
|
| 44 | - |
|
| 45 | - /** |
|
| 46 | - * handle request and build XML |
|
| 47 | - * @access protected |
|
| 48 | - * |
|
| 49 | - */ |
|
| 50 | - function buildXml() |
|
| 51 | - { |
|
| 52 | - if (empty($_POST['CKFinderCommand']) || $_POST['CKFinderCommand'] != 'true') { |
|
| 53 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 54 | - } |
|
| 55 | - |
|
| 56 | - $this->checkConnector(); |
|
| 57 | - $this->checkRequest(); |
|
| 58 | - |
|
| 59 | - //resizing to 1x1 is almost equal to deleting a file, that's why FILE_DELETE permissions are required |
|
| 60 | - if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_DELETE) || !$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_UPLOAD)) { |
|
| 61 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED); |
|
| 62 | - } |
|
| 63 | - |
|
| 64 | - $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); |
|
| 65 | - $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig(); |
|
| 66 | - |
|
| 67 | - if (!isset($_POST["fileName"])) { |
|
| 68 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME); |
|
| 69 | - } |
|
| 70 | - |
|
| 71 | - $fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_POST["fileName"]); |
|
| 72 | - |
|
| 73 | - if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName) || $resourceTypeInfo->checkIsHiddenFile($fileName)) { |
|
| 74 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - if (!$resourceTypeInfo->checkExtension($fileName, false)) { |
|
| 78 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 79 | - } |
|
| 80 | - |
|
| 81 | - $filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName); |
|
| 82 | - |
|
| 83 | - if (!file_exists($filePath) || !is_file($filePath)) { |
|
| 84 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND); |
|
| 85 | - } |
|
| 86 | - |
|
| 87 | - $newWidth = trim($_POST['width']); |
|
| 88 | - $newHeight = trim($_POST['height']); |
|
| 89 | - $quality = 80; |
|
| 90 | - $resizeOriginal = !empty($_POST['width']) && !empty($_POST['height']); |
|
| 91 | - |
|
| 92 | - if ($resizeOriginal) { |
|
| 93 | - if (!preg_match("/^\d+$/", $newWidth) || !preg_match("/^\d+$/", $newHeight) || !preg_match("/^\d+$/", $newWidth)) { |
|
| 94 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 95 | - } |
|
| 96 | - if (!isset($_POST["newFileName"])) { |
|
| 97 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME); |
|
| 98 | - } |
|
| 99 | - $newFileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_POST["newFileName"]); |
|
| 100 | - if (!$resourceTypeInfo->checkExtension($newFileName)) { |
|
| 101 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_EXTENSION); |
|
| 102 | - } |
|
| 103 | - if (!CKFinder_Connector_Utils_FileSystem::checkFileName($newFileName) || $resourceTypeInfo->checkIsHiddenFile($newFileName)) { |
|
| 104 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME); |
|
| 105 | - } |
|
| 106 | - $newFilePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $newFileName); |
|
| 107 | - if (!is_writable(dirname($newFilePath))) { |
|
| 108 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED); |
|
| 109 | - } |
|
| 110 | - if ($_POST['overwrite'] != "1" && file_exists($newFilePath)) { |
|
| 111 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ALREADY_EXIST); |
|
| 112 | - } |
|
| 113 | - $_imagesConfig = $_config->getImagesConfig(); |
|
| 114 | - $maxWidth = $_imagesConfig->getMaxWidth(); |
|
| 115 | - $maxHeight = $_imagesConfig->getMaxHeight(); |
|
| 116 | - // Shouldn't happen as the JavaScript validation should not allow this. |
|
| 117 | - if ( ( $maxWidth > 0 && $newWidth > $maxWidth ) || ( $maxHeight > 0 && $newHeight > $maxHeight ) ) { |
|
| 118 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 119 | - } |
|
| 120 | - } |
|
| 121 | - |
|
| 122 | - require_once CKFINDER_CONNECTOR_LIB_DIR . "/CommandHandler/Thumbnail.php"; |
|
| 123 | - |
|
| 124 | - if ($resizeOriginal) { |
|
| 125 | - $result = CKFinder_Connector_CommandHandler_Thumbnail::createThumb($filePath, $newFilePath, $newWidth, $newHeight, $quality, false) ; |
|
| 126 | - if (!$result) { |
|
| 127 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED); |
|
| 128 | - } |
|
| 129 | - } |
|
| 130 | - |
|
| 131 | - $config = $this->getConfig(); |
|
| 132 | - $nameWithoutExt = preg_replace("/^(.+)\_\d+x\d+$/", "$1", CKFinder_Connector_Utils_FileSystem::getFileNameWithoutExtension($fileName)); |
|
| 133 | - $extension = CKFinder_Connector_Utils_FileSystem::getExtension($fileName); |
|
| 134 | - foreach (array('small', 'medium', 'large') as $size) { |
|
| 135 | - if (!empty($_POST[$size]) && $_POST[$size] == '1') { |
|
| 136 | - $thumbName = $nameWithoutExt."_".$size.".".$extension; |
|
| 137 | - $newFilePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $thumbName); |
|
| 138 | - if (!empty($config[$size.'Thumb'])) { |
|
| 139 | - if (preg_match("/^(\d+)x(\d+)$/", $config[$size.'Thumb'], $matches)) { |
|
| 140 | - CKFinder_Connector_CommandHandler_Thumbnail::createThumb($filePath, $newFilePath, $matches[1], $matches[2], $quality, true) ; |
|
| 141 | - } |
|
| 142 | - } |
|
| 143 | - } |
|
| 144 | - } |
|
| 145 | - |
|
| 146 | - } |
|
| 147 | - |
|
| 148 | - /** |
|
| 149 | - * @access public |
|
| 150 | - */ |
|
| 151 | - function onInitCommand( &$connectorNode ) |
|
| 152 | - { |
|
| 153 | - // "@" protects against E_STRICT (Only variables should be assigned by reference) |
|
| 154 | - @$pluginsInfo = &$connectorNode->getChild("PluginsInfo"); |
|
| 155 | - $imageresize = new CKFinder_Connector_Utils_XmlNode("imageresize"); |
|
| 156 | - $pluginsInfo->addChild($imageresize); |
|
| 157 | - $config = $this->getConfig(); |
|
| 158 | - foreach (array('small', 'medium', 'large') as $size) { |
|
| 159 | - if (!empty($config[$size.'Thumb'])) { |
|
| 160 | - $imageresize->addAttribute($size.'Thumb', $config[$size.'Thumb']); |
|
| 161 | - } |
|
| 162 | - } |
|
| 163 | - return true ; |
|
| 164 | - } |
|
| 165 | - |
|
| 166 | - /** |
|
| 167 | - * @access public |
|
| 168 | - */ |
|
| 169 | - function onBeforeExecuteCommand( &$command ) |
|
| 170 | - { |
|
| 171 | - if ( $command == 'ImageResize' ) |
|
| 172 | - { |
|
| 173 | - $this->sendResponse(); |
|
| 174 | - return false; |
|
| 175 | - } |
|
| 176 | - |
|
| 177 | - return true ; |
|
| 178 | - } |
|
| 24 | + /** |
|
| 25 | + * @access private |
|
| 26 | + */ |
|
| 27 | + function getConfig() |
|
| 28 | + { |
|
| 29 | + $config = array(); |
|
| 30 | + if (isset($GLOBALS['config']['plugin_imageresize'])) { |
|
| 31 | + $config = $GLOBALS['config']['plugin_imageresize']; |
|
| 32 | + } |
|
| 33 | + if (!isset($config['smallThumb'])) { |
|
| 34 | + $config['smallThumb'] = "90x90"; |
|
| 35 | + } |
|
| 36 | + if (!isset($config['mediumThumb'])) { |
|
| 37 | + $config['mediumThumb'] = "120x120"; |
|
| 38 | + } |
|
| 39 | + if (!isset($config['largeThumb'])) { |
|
| 40 | + $config['largeThumb'] = "180x180"; |
|
| 41 | + } |
|
| 42 | + return $config; |
|
| 43 | + } |
|
| 44 | + |
|
| 45 | + /** |
|
| 46 | + * handle request and build XML |
|
| 47 | + * @access protected |
|
| 48 | + * |
|
| 49 | + */ |
|
| 50 | + function buildXml() |
|
| 51 | + { |
|
| 52 | + if (empty($_POST['CKFinderCommand']) || $_POST['CKFinderCommand'] != 'true') { |
|
| 53 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 54 | + } |
|
| 55 | + |
|
| 56 | + $this->checkConnector(); |
|
| 57 | + $this->checkRequest(); |
|
| 58 | + |
|
| 59 | + //resizing to 1x1 is almost equal to deleting a file, that's why FILE_DELETE permissions are required |
|
| 60 | + if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_DELETE) || !$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_UPLOAD)) { |
|
| 61 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED); |
|
| 62 | + } |
|
| 63 | + |
|
| 64 | + $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); |
|
| 65 | + $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig(); |
|
| 66 | + |
|
| 67 | + if (!isset($_POST["fileName"])) { |
|
| 68 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME); |
|
| 69 | + } |
|
| 70 | + |
|
| 71 | + $fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_POST["fileName"]); |
|
| 72 | + |
|
| 73 | + if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName) || $resourceTypeInfo->checkIsHiddenFile($fileName)) { |
|
| 74 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + if (!$resourceTypeInfo->checkExtension($fileName, false)) { |
|
| 78 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 79 | + } |
|
| 80 | + |
|
| 81 | + $filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName); |
|
| 82 | + |
|
| 83 | + if (!file_exists($filePath) || !is_file($filePath)) { |
|
| 84 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND); |
|
| 85 | + } |
|
| 86 | + |
|
| 87 | + $newWidth = trim($_POST['width']); |
|
| 88 | + $newHeight = trim($_POST['height']); |
|
| 89 | + $quality = 80; |
|
| 90 | + $resizeOriginal = !empty($_POST['width']) && !empty($_POST['height']); |
|
| 91 | + |
|
| 92 | + if ($resizeOriginal) { |
|
| 93 | + if (!preg_match("/^\d+$/", $newWidth) || !preg_match("/^\d+$/", $newHeight) || !preg_match("/^\d+$/", $newWidth)) { |
|
| 94 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 95 | + } |
|
| 96 | + if (!isset($_POST["newFileName"])) { |
|
| 97 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME); |
|
| 98 | + } |
|
| 99 | + $newFileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_POST["newFileName"]); |
|
| 100 | + if (!$resourceTypeInfo->checkExtension($newFileName)) { |
|
| 101 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_EXTENSION); |
|
| 102 | + } |
|
| 103 | + if (!CKFinder_Connector_Utils_FileSystem::checkFileName($newFileName) || $resourceTypeInfo->checkIsHiddenFile($newFileName)) { |
|
| 104 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME); |
|
| 105 | + } |
|
| 106 | + $newFilePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $newFileName); |
|
| 107 | + if (!is_writable(dirname($newFilePath))) { |
|
| 108 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED); |
|
| 109 | + } |
|
| 110 | + if ($_POST['overwrite'] != "1" && file_exists($newFilePath)) { |
|
| 111 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ALREADY_EXIST); |
|
| 112 | + } |
|
| 113 | + $_imagesConfig = $_config->getImagesConfig(); |
|
| 114 | + $maxWidth = $_imagesConfig->getMaxWidth(); |
|
| 115 | + $maxHeight = $_imagesConfig->getMaxHeight(); |
|
| 116 | + // Shouldn't happen as the JavaScript validation should not allow this. |
|
| 117 | + if ( ( $maxWidth > 0 && $newWidth > $maxWidth ) || ( $maxHeight > 0 && $newHeight > $maxHeight ) ) { |
|
| 118 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 119 | + } |
|
| 120 | + } |
|
| 121 | + |
|
| 122 | + require_once CKFINDER_CONNECTOR_LIB_DIR . "/CommandHandler/Thumbnail.php"; |
|
| 123 | + |
|
| 124 | + if ($resizeOriginal) { |
|
| 125 | + $result = CKFinder_Connector_CommandHandler_Thumbnail::createThumb($filePath, $newFilePath, $newWidth, $newHeight, $quality, false) ; |
|
| 126 | + if (!$result) { |
|
| 127 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED); |
|
| 128 | + } |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + $config = $this->getConfig(); |
|
| 132 | + $nameWithoutExt = preg_replace("/^(.+)\_\d+x\d+$/", "$1", CKFinder_Connector_Utils_FileSystem::getFileNameWithoutExtension($fileName)); |
|
| 133 | + $extension = CKFinder_Connector_Utils_FileSystem::getExtension($fileName); |
|
| 134 | + foreach (array('small', 'medium', 'large') as $size) { |
|
| 135 | + if (!empty($_POST[$size]) && $_POST[$size] == '1') { |
|
| 136 | + $thumbName = $nameWithoutExt."_".$size.".".$extension; |
|
| 137 | + $newFilePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $thumbName); |
|
| 138 | + if (!empty($config[$size.'Thumb'])) { |
|
| 139 | + if (preg_match("/^(\d+)x(\d+)$/", $config[$size.'Thumb'], $matches)) { |
|
| 140 | + CKFinder_Connector_CommandHandler_Thumbnail::createThumb($filePath, $newFilePath, $matches[1], $matches[2], $quality, true) ; |
|
| 141 | + } |
|
| 142 | + } |
|
| 143 | + } |
|
| 144 | + } |
|
| 145 | + |
|
| 146 | + } |
|
| 147 | + |
|
| 148 | + /** |
|
| 149 | + * @access public |
|
| 150 | + */ |
|
| 151 | + function onInitCommand( &$connectorNode ) |
|
| 152 | + { |
|
| 153 | + // "@" protects against E_STRICT (Only variables should be assigned by reference) |
|
| 154 | + @$pluginsInfo = &$connectorNode->getChild("PluginsInfo"); |
|
| 155 | + $imageresize = new CKFinder_Connector_Utils_XmlNode("imageresize"); |
|
| 156 | + $pluginsInfo->addChild($imageresize); |
|
| 157 | + $config = $this->getConfig(); |
|
| 158 | + foreach (array('small', 'medium', 'large') as $size) { |
|
| 159 | + if (!empty($config[$size.'Thumb'])) { |
|
| 160 | + $imageresize->addAttribute($size.'Thumb', $config[$size.'Thumb']); |
|
| 161 | + } |
|
| 162 | + } |
|
| 163 | + return true ; |
|
| 164 | + } |
|
| 165 | + |
|
| 166 | + /** |
|
| 167 | + * @access public |
|
| 168 | + */ |
|
| 169 | + function onBeforeExecuteCommand( &$command ) |
|
| 170 | + { |
|
| 171 | + if ( $command == 'ImageResize' ) |
|
| 172 | + { |
|
| 173 | + $this->sendResponse(); |
|
| 174 | + return false; |
|
| 175 | + } |
|
| 176 | + |
|
| 177 | + return true ; |
|
| 178 | + } |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | class CKFinder_Connector_CommandHandler_ImageResizeInfo extends CKFinder_Connector_CommandHandler_XmlCommandHandlerBase |
| 182 | 182 | { |
| 183 | - /** |
|
| 184 | - * handle request and build XML |
|
| 185 | - * @access protected |
|
| 186 | - * |
|
| 187 | - */ |
|
| 188 | - function buildXml() |
|
| 189 | - { |
|
| 190 | - $this->checkConnector(); |
|
| 191 | - $this->checkRequest(); |
|
| 192 | - |
|
| 193 | - if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_VIEW)) { |
|
| 194 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED); |
|
| 195 | - } |
|
| 196 | - |
|
| 197 | - $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig(); |
|
| 198 | - |
|
| 199 | - if (!isset($_GET["fileName"])) { |
|
| 200 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME); |
|
| 201 | - } |
|
| 202 | - |
|
| 203 | - $fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_GET["fileName"]); |
|
| 204 | - |
|
| 205 | - if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName) || $resourceTypeInfo->checkIsHiddenFile($fileName)) { |
|
| 206 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 207 | - } |
|
| 208 | - |
|
| 209 | - if (!$resourceTypeInfo->checkExtension($fileName, false)) { |
|
| 210 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 211 | - } |
|
| 212 | - |
|
| 213 | - $filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName); |
|
| 214 | - |
|
| 215 | - if (!file_exists($filePath) || !is_file($filePath)) { |
|
| 216 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND); |
|
| 217 | - } |
|
| 218 | - |
|
| 219 | - list($width, $height) = getimagesize($filePath); |
|
| 220 | - $oNode = new Ckfinder_Connector_Utils_XmlNode("ImageInfo"); |
|
| 221 | - $oNode->addAttribute("width", $width); |
|
| 222 | - $oNode->addAttribute("height", $height); |
|
| 223 | - $this->_connectorNode->addChild($oNode); |
|
| 224 | - } |
|
| 225 | - |
|
| 226 | - /** |
|
| 227 | - * @access public |
|
| 228 | - */ |
|
| 229 | - function onBeforeExecuteCommand( &$command ) |
|
| 230 | - { |
|
| 231 | - if ( $command == 'ImageResizeInfo' ) |
|
| 232 | - { |
|
| 233 | - $this->sendResponse(); |
|
| 234 | - return false; |
|
| 235 | - } |
|
| 236 | - |
|
| 237 | - return true ; |
|
| 238 | - } |
|
| 183 | + /** |
|
| 184 | + * handle request and build XML |
|
| 185 | + * @access protected |
|
| 186 | + * |
|
| 187 | + */ |
|
| 188 | + function buildXml() |
|
| 189 | + { |
|
| 190 | + $this->checkConnector(); |
|
| 191 | + $this->checkRequest(); |
|
| 192 | + |
|
| 193 | + if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_VIEW)) { |
|
| 194 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED); |
|
| 195 | + } |
|
| 196 | + |
|
| 197 | + $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig(); |
|
| 198 | + |
|
| 199 | + if (!isset($_GET["fileName"])) { |
|
| 200 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME); |
|
| 201 | + } |
|
| 202 | + |
|
| 203 | + $fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_GET["fileName"]); |
|
| 204 | + |
|
| 205 | + if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName) || $resourceTypeInfo->checkIsHiddenFile($fileName)) { |
|
| 206 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 207 | + } |
|
| 208 | + |
|
| 209 | + if (!$resourceTypeInfo->checkExtension($fileName, false)) { |
|
| 210 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 211 | + } |
|
| 212 | + |
|
| 213 | + $filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName); |
|
| 214 | + |
|
| 215 | + if (!file_exists($filePath) || !is_file($filePath)) { |
|
| 216 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND); |
|
| 217 | + } |
|
| 218 | + |
|
| 219 | + list($width, $height) = getimagesize($filePath); |
|
| 220 | + $oNode = new Ckfinder_Connector_Utils_XmlNode("ImageInfo"); |
|
| 221 | + $oNode->addAttribute("width", $width); |
|
| 222 | + $oNode->addAttribute("height", $height); |
|
| 223 | + $this->_connectorNode->addChild($oNode); |
|
| 224 | + } |
|
| 225 | + |
|
| 226 | + /** |
|
| 227 | + * @access public |
|
| 228 | + */ |
|
| 229 | + function onBeforeExecuteCommand( &$command ) |
|
| 230 | + { |
|
| 231 | + if ( $command == 'ImageResizeInfo' ) |
|
| 232 | + { |
|
| 233 | + $this->sendResponse(); |
|
| 234 | + return false; |
|
| 235 | + } |
|
| 236 | + |
|
| 237 | + return true ; |
|
| 238 | + } |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | if (function_exists('imagecreate')) { |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * Include base XML command handler |
| 19 | 19 | */ |
| 20 | -require_once CKFINDER_CONNECTOR_LIB_DIR . "/CommandHandler/XmlCommandHandlerBase.php"; |
|
| 20 | +require_once CKFINDER_CONNECTOR_LIB_DIR."/CommandHandler/XmlCommandHandlerBase.php"; |
|
| 21 | 21 | |
| 22 | 22 | class CKFinder_Connector_CommandHandler_ImageResize extends CKFinder_Connector_CommandHandler_XmlCommandHandlerBase |
| 23 | 23 | { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); |
|
| 64 | + $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config"); |
|
| 65 | 65 | $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig(); |
| 66 | 66 | |
| 67 | 67 | if (!isset($_POST["fileName"])) { |
@@ -114,15 +114,15 @@ discard block |
||
| 114 | 114 | $maxWidth = $_imagesConfig->getMaxWidth(); |
| 115 | 115 | $maxHeight = $_imagesConfig->getMaxHeight(); |
| 116 | 116 | // Shouldn't happen as the JavaScript validation should not allow this. |
| 117 | - if ( ( $maxWidth > 0 && $newWidth > $maxWidth ) || ( $maxHeight > 0 && $newHeight > $maxHeight ) ) { |
|
| 117 | + if (($maxWidth > 0 && $newWidth > $maxWidth) || ($maxHeight > 0 && $newHeight > $maxHeight)) { |
|
| 118 | 118 | $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - require_once CKFINDER_CONNECTOR_LIB_DIR . "/CommandHandler/Thumbnail.php"; |
|
| 122 | + require_once CKFINDER_CONNECTOR_LIB_DIR."/CommandHandler/Thumbnail.php"; |
|
| 123 | 123 | |
| 124 | 124 | if ($resizeOriginal) { |
| 125 | - $result = CKFinder_Connector_CommandHandler_Thumbnail::createThumb($filePath, $newFilePath, $newWidth, $newHeight, $quality, false) ; |
|
| 125 | + $result = CKFinder_Connector_CommandHandler_Thumbnail::createThumb($filePath, $newFilePath, $newWidth, $newHeight, $quality, false); |
|
| 126 | 126 | if (!$result) { |
| 127 | 127 | $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED); |
| 128 | 128 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $newFilePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $thumbName); |
| 138 | 138 | if (!empty($config[$size.'Thumb'])) { |
| 139 | 139 | if (preg_match("/^(\d+)x(\d+)$/", $config[$size.'Thumb'], $matches)) { |
| 140 | - CKFinder_Connector_CommandHandler_Thumbnail::createThumb($filePath, $newFilePath, $matches[1], $matches[2], $quality, true) ; |
|
| 140 | + CKFinder_Connector_CommandHandler_Thumbnail::createThumb($filePath, $newFilePath, $matches[1], $matches[2], $quality, true); |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | /** |
| 149 | 149 | * @access public |
| 150 | 150 | */ |
| 151 | - function onInitCommand( &$connectorNode ) |
|
| 151 | + function onInitCommand(&$connectorNode) |
|
| 152 | 152 | { |
| 153 | 153 | // "@" protects against E_STRICT (Only variables should be assigned by reference) |
| 154 | 154 | @$pluginsInfo = &$connectorNode->getChild("PluginsInfo"); |
@@ -160,21 +160,21 @@ discard block |
||
| 160 | 160 | $imageresize->addAttribute($size.'Thumb', $config[$size.'Thumb']); |
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | - return true ; |
|
| 163 | + return true; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /** |
| 167 | 167 | * @access public |
| 168 | 168 | */ |
| 169 | - function onBeforeExecuteCommand( &$command ) |
|
| 169 | + function onBeforeExecuteCommand(&$command) |
|
| 170 | 170 | { |
| 171 | - if ( $command == 'ImageResize' ) |
|
| 171 | + if ($command == 'ImageResize') |
|
| 172 | 172 | { |
| 173 | 173 | $this->sendResponse(); |
| 174 | 174 | return false; |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - return true ; |
|
| 177 | + return true; |
|
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | |
@@ -226,15 +226,15 @@ discard block |
||
| 226 | 226 | /** |
| 227 | 227 | * @access public |
| 228 | 228 | */ |
| 229 | - function onBeforeExecuteCommand( &$command ) |
|
| 229 | + function onBeforeExecuteCommand(&$command) |
|
| 230 | 230 | { |
| 231 | - if ( $command == 'ImageResizeInfo' ) |
|
| 231 | + if ($command == 'ImageResizeInfo') |
|
| 232 | 232 | { |
| 233 | 233 | $this->sendResponse(); |
| 234 | 234 | return false; |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | - return true ; |
|
| 237 | + return true; |
|
| 238 | 238 | } |
| 239 | 239 | } |
| 240 | 240 | |
@@ -12,7 +12,9 @@ |
||
| 12 | 12 | * |
| 13 | 13 | * CKFinder extension: resize image according to a given size |
| 14 | 14 | */ |
| 15 | -if (!defined('IN_CKFINDER')) exit; |
|
| 15 | +if (!defined('IN_CKFINDER')) { |
|
| 16 | + exit; |
|
| 17 | +} |
|
| 16 | 18 | |
| 17 | 19 | /** |
| 18 | 20 | * Include base XML command handler |
@@ -21,79 +21,79 @@ |
||
| 21 | 21 | |
| 22 | 22 | class CKFinder_Connector_CommandHandler_FileEditor extends CKFinder_Connector_CommandHandler_XmlCommandHandlerBase |
| 23 | 23 | { |
| 24 | - /** |
|
| 25 | - * handle request and build XML |
|
| 26 | - * @access protected |
|
| 27 | - */ |
|
| 28 | - function buildXml() |
|
| 29 | - { |
|
| 30 | - if (empty($_POST['CKFinderCommand']) || $_POST['CKFinderCommand'] != 'true') { |
|
| 31 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 32 | - } |
|
| 24 | + /** |
|
| 25 | + * handle request and build XML |
|
| 26 | + * @access protected |
|
| 27 | + */ |
|
| 28 | + function buildXml() |
|
| 29 | + { |
|
| 30 | + if (empty($_POST['CKFinderCommand']) || $_POST['CKFinderCommand'] != 'true') { |
|
| 31 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - $this->checkConnector(); |
|
| 35 | - $this->checkRequest(); |
|
| 34 | + $this->checkConnector(); |
|
| 35 | + $this->checkRequest(); |
|
| 36 | 36 | |
| 37 | - // Saving empty file is equal to deleting a file, that's why FILE_DELETE permissions are required |
|
| 38 | - if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_DELETE)) { |
|
| 39 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED); |
|
| 40 | - } |
|
| 37 | + // Saving empty file is equal to deleting a file, that's why FILE_DELETE permissions are required |
|
| 38 | + if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_DELETE)) { |
|
| 39 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED); |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - if (!isset($_POST["fileName"])) { |
|
| 43 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME); |
|
| 44 | - } |
|
| 45 | - if (!isset($_POST["content"])) { |
|
| 46 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 47 | - } |
|
| 42 | + if (!isset($_POST["fileName"])) { |
|
| 43 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME); |
|
| 44 | + } |
|
| 45 | + if (!isset($_POST["content"])) { |
|
| 46 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - $fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_POST["fileName"]); |
|
| 50 | - $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig(); |
|
| 49 | + $fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_POST["fileName"]); |
|
| 50 | + $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig(); |
|
| 51 | 51 | |
| 52 | - if (!$resourceTypeInfo->checkExtension($fileName)) { |
|
| 53 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_EXTENSION); |
|
| 54 | - } |
|
| 52 | + if (!$resourceTypeInfo->checkExtension($fileName)) { |
|
| 53 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_EXTENSION); |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName) || $resourceTypeInfo->checkIsHiddenFile($fileName)) { |
|
| 57 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 58 | - } |
|
| 56 | + if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName) || $resourceTypeInfo->checkIsHiddenFile($fileName)) { |
|
| 57 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST); |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - $filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName); |
|
| 60 | + $filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName); |
|
| 61 | 61 | |
| 62 | - if (!file_exists($filePath) || !is_file($filePath)) { |
|
| 63 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND); |
|
| 64 | - } |
|
| 62 | + if (!file_exists($filePath) || !is_file($filePath)) { |
|
| 63 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND); |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - if (!is_writable(dirname($filePath))) { |
|
| 67 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED); |
|
| 68 | - } |
|
| 66 | + if (!is_writable(dirname($filePath))) { |
|
| 67 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED); |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - $fp = @fopen($filePath, 'wb'); |
|
| 71 | - if ($fp === false || !flock($fp, LOCK_EX)) { |
|
| 72 | - $result = false; |
|
| 73 | - } |
|
| 74 | - else { |
|
| 75 | - $result = fwrite($fp, $_POST["content"]); |
|
| 76 | - flock($fp, LOCK_UN); |
|
| 77 | - fclose($fp); |
|
| 78 | - } |
|
| 79 | - if ($result === false) { |
|
| 80 | - $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED); |
|
| 81 | - } |
|
| 82 | - } |
|
| 70 | + $fp = @fopen($filePath, 'wb'); |
|
| 71 | + if ($fp === false || !flock($fp, LOCK_EX)) { |
|
| 72 | + $result = false; |
|
| 73 | + } |
|
| 74 | + else { |
|
| 75 | + $result = fwrite($fp, $_POST["content"]); |
|
| 76 | + flock($fp, LOCK_UN); |
|
| 77 | + fclose($fp); |
|
| 78 | + } |
|
| 79 | + if ($result === false) { |
|
| 80 | + $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED); |
|
| 81 | + } |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - /** |
|
| 85 | - * @access public |
|
| 86 | - */ |
|
| 87 | - function onBeforeExecuteCommand( &$command ) |
|
| 88 | - { |
|
| 89 | - if ( $command == 'SaveFile' ) |
|
| 90 | - { |
|
| 91 | - $this->sendResponse(); |
|
| 92 | - return false; |
|
| 93 | - } |
|
| 84 | + /** |
|
| 85 | + * @access public |
|
| 86 | + */ |
|
| 87 | + function onBeforeExecuteCommand( &$command ) |
|
| 88 | + { |
|
| 89 | + if ( $command == 'SaveFile' ) |
|
| 90 | + { |
|
| 91 | + $this->sendResponse(); |
|
| 92 | + return false; |
|
| 93 | + } |
|
| 94 | 94 | |
| 95 | - return true ; |
|
| 96 | - } |
|
| 95 | + return true ; |
|
| 96 | + } |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | $CommandHandler_FileEditor = new CKFinder_Connector_CommandHandler_FileEditor(); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * Include base XML command handler |
| 19 | 19 | */ |
| 20 | -require_once CKFINDER_CONNECTOR_LIB_DIR . "/CommandHandler/XmlCommandHandlerBase.php"; |
|
| 20 | +require_once CKFINDER_CONNECTOR_LIB_DIR."/CommandHandler/XmlCommandHandlerBase.php"; |
|
| 21 | 21 | |
| 22 | 22 | class CKFinder_Connector_CommandHandler_FileEditor extends CKFinder_Connector_CommandHandler_XmlCommandHandlerBase |
| 23 | 23 | { |
@@ -84,15 +84,15 @@ discard block |
||
| 84 | 84 | /** |
| 85 | 85 | * @access public |
| 86 | 86 | */ |
| 87 | - function onBeforeExecuteCommand( &$command ) |
|
| 87 | + function onBeforeExecuteCommand(&$command) |
|
| 88 | 88 | { |
| 89 | - if ( $command == 'SaveFile' ) |
|
| 89 | + if ($command == 'SaveFile') |
|
| 90 | 90 | { |
| 91 | 91 | $this->sendResponse(); |
| 92 | 92 | return false; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - return true ; |
|
| 95 | + return true; |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
@@ -12,7 +12,9 @@ discard block |
||
| 12 | 12 | * |
| 13 | 13 | * CKFinder extension: prodives command that saves edited file. |
| 14 | 14 | */ |
| 15 | -if (!defined('IN_CKFINDER')) exit; |
|
| 15 | +if (!defined('IN_CKFINDER')) { |
|
| 16 | + exit; |
|
| 17 | +} |
|
| 16 | 18 | |
| 17 | 19 | /** |
| 18 | 20 | * Include base XML command handler |
@@ -70,8 +72,7 @@ discard block |
||
| 70 | 72 | $fp = @fopen($filePath, 'wb'); |
| 71 | 73 | if ($fp === false || !flock($fp, LOCK_EX)) { |
| 72 | 74 | $result = false; |
| 73 | - } |
|
| 74 | - else { |
|
| 75 | + } else { |
|
| 75 | 76 | $result = fwrite($fp, $_POST["content"]); |
| 76 | 77 | flock($fp, LOCK_UN); |
| 77 | 78 | fclose($fp); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * this file is part of the Source Code of CKFinder. |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -if ( version_compare( phpversion(), '5', '<' ) ) |
|
| 15 | - require_once 'core/ckfinder_php4.php' ; |
|
| 14 | +if (version_compare(phpversion(), '5', '<')) |
|
| 15 | + require_once 'core/ckfinder_php4.php'; |
|
| 16 | 16 | else |
| 17 | - require_once 'core/ckfinder_php5.php' ; |
|
| 17 | + require_once 'core/ckfinder_php5.php'; |
|
@@ -11,7 +11,8 @@ |
||
| 11 | 11 | * this file is part of the Source Code of CKFinder. |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -if ( version_compare( phpversion(), '5', '<' ) ) |
|
| 14 | +if ( version_compare( phpversion(), '5', '<' ) ) { |
|
| 15 | 15 | require_once 'core/ckfinder_php4.php' ; |
| 16 | -else |
|
| 16 | +} else { |
|
| 17 | 17 | require_once 'core/ckfinder_php5.php' ; |
| 18 | +} |
|
@@ -21,16 +21,16 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | function CheckAuthentication() |
| 23 | 23 | { |
| 24 | - // WARNING : DO NOT simply return "true". By doing so, you are allowing |
|
| 25 | - // "anyone" to upload and list the files in your server. You must implement |
|
| 26 | - // some kind of session validation here. Even something very simple as... |
|
| 24 | + // WARNING : DO NOT simply return "true". By doing so, you are allowing |
|
| 25 | + // "anyone" to upload and list the files in your server. You must implement |
|
| 26 | + // some kind of session validation here. Even something very simple as... |
|
| 27 | 27 | |
| 28 | - return true; |
|
| 28 | + return true; |
|
| 29 | 29 | |
| 30 | 30 | |
| 31 | - // ... where $_SESSION['IsAuthorized'] is set to "true" as soon as the |
|
| 32 | - // user logs in your system. To be able to use session variables don't |
|
| 33 | - // forget to add session_start() at the top of this file. |
|
| 31 | + // ... where $_SESSION['IsAuthorized'] is set to "true" as soon as the |
|
| 32 | + // user logs in your system. To be able to use session variables don't |
|
| 33 | + // forget to add session_start() at the top of this file. |
|
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | } |
@@ -98,23 +98,23 @@ discard block |
||
| 98 | 98 | directory, no matter the resource type. |
| 99 | 99 | */ |
| 100 | 100 | $config['Thumbnails'] = Array( |
| 101 | - 'url' => $baseUrl . '_thumbs', |
|
| 102 | - 'directory' => $baseDir . '_thumbs', |
|
| 103 | - 'enabled' => true, |
|
| 104 | - 'directAccess' => false, |
|
| 105 | - 'maxWidth' => 100, |
|
| 106 | - 'maxHeight' => 100, |
|
| 107 | - 'bmpSupported' => false, |
|
| 108 | - 'quality' => 80); |
|
| 101 | + 'url' => $baseUrl . '_thumbs', |
|
| 102 | + 'directory' => $baseDir . '_thumbs', |
|
| 103 | + 'enabled' => true, |
|
| 104 | + 'directAccess' => false, |
|
| 105 | + 'maxWidth' => 100, |
|
| 106 | + 'maxHeight' => 100, |
|
| 107 | + 'bmpSupported' => false, |
|
| 108 | + 'quality' => 80); |
|
| 109 | 109 | |
| 110 | 110 | /* |
| 111 | 111 | Set the maximum size of uploaded images. If an uploaded image is larger, it |
| 112 | 112 | gets scaled down proportionally. Set to 0 to disable this feature. |
| 113 | 113 | */ |
| 114 | 114 | $config['Images'] = Array( |
| 115 | - 'maxWidth' => 700, |
|
| 116 | - 'maxHeight' => 1200, |
|
| 117 | - 'quality' => 80); |
|
| 115 | + 'maxWidth' => 700, |
|
| 116 | + 'maxHeight' => 1200, |
|
| 117 | + 'quality' => 80); |
|
| 118 | 118 | |
| 119 | 119 | /* |
| 120 | 120 | RoleSessionVar : the session variable name that CKFinder must use to retrieve |
@@ -140,19 +140,19 @@ discard block |
||
| 140 | 140 | */ |
| 141 | 141 | |
| 142 | 142 | $config['AccessControl'][] = Array( |
| 143 | - 'role' => '*', |
|
| 144 | - 'resourceType' => '*', |
|
| 145 | - 'folder' => '/', |
|
| 143 | + 'role' => '*', |
|
| 144 | + 'resourceType' => '*', |
|
| 145 | + 'folder' => '/', |
|
| 146 | 146 | |
| 147 | - 'folderView' => true, |
|
| 148 | - 'folderCreate' => true, |
|
| 149 | - 'folderRename' => true, |
|
| 150 | - 'folderDelete' => true, |
|
| 147 | + 'folderView' => true, |
|
| 148 | + 'folderCreate' => true, |
|
| 149 | + 'folderRename' => true, |
|
| 150 | + 'folderDelete' => true, |
|
| 151 | 151 | |
| 152 | - 'fileView' => true, |
|
| 153 | - 'fileUpload' => true, |
|
| 154 | - 'fileRename' => true, |
|
| 155 | - 'fileDelete' => true); |
|
| 152 | + 'fileView' => true, |
|
| 153 | + 'fileUpload' => true, |
|
| 154 | + 'fileRename' => true, |
|
| 155 | + 'fileDelete' => true); |
|
| 156 | 156 | |
| 157 | 157 | /* |
| 158 | 158 | For example, if you want to restrict the upload, rename or delete of files in |
@@ -195,36 +195,36 @@ discard block |
||
| 195 | 195 | $config['DefaultResourceTypes'] = ''; |
| 196 | 196 | |
| 197 | 197 | $config['ResourceType'][] = Array( |
| 198 | - 'name' => 'Files', // Single quotes not allowed |
|
| 199 | - 'url' => $baseUrl . '/file/', |
|
| 200 | - 'directory' => $baseDir . '/file/', |
|
| 201 | - 'maxSize' => 0, |
|
| 202 | - 'allowedExtensions' => '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pptx,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,zip,ai,psd', |
|
| 203 | - 'deniedExtensions' => ''); |
|
| 198 | + 'name' => 'Files', // Single quotes not allowed |
|
| 199 | + 'url' => $baseUrl . '/file/', |
|
| 200 | + 'directory' => $baseDir . '/file/', |
|
| 201 | + 'maxSize' => 0, |
|
| 202 | + 'allowedExtensions' => '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pptx,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,zip,ai,psd', |
|
| 203 | + 'deniedExtensions' => ''); |
|
| 204 | 204 | |
| 205 | 205 | $config['ResourceType'][] = Array( |
| 206 | - 'name' => 'Images', |
|
| 207 | - 'url' => $baseUrl . '/image/', |
|
| 208 | - 'directory' => $baseDir . '/image/', |
|
| 209 | - 'maxSize' => "16M", |
|
| 210 | - 'allowedExtensions' => 'bmp,gif,jpeg,jpg,png,', |
|
| 211 | - 'deniedExtensions' => ''); |
|
| 206 | + 'name' => 'Images', |
|
| 207 | + 'url' => $baseUrl . '/image/', |
|
| 208 | + 'directory' => $baseDir . '/image/', |
|
| 209 | + 'maxSize' => "16M", |
|
| 210 | + 'allowedExtensions' => 'bmp,gif,jpeg,jpg,png,', |
|
| 211 | + 'deniedExtensions' => ''); |
|
| 212 | 212 | |
| 213 | 213 | $config['ResourceType'][] = Array( |
| 214 | - 'name' => 'Flash', |
|
| 215 | - 'url' => $baseUrl . '/flash/', |
|
| 216 | - 'directory' => $baseDir . '/flash/', |
|
| 217 | - 'maxSize' => 0, |
|
| 218 | - 'allowedExtensions' => 'swf,flv', |
|
| 219 | - 'deniedExtensions' => ''); |
|
| 214 | + 'name' => 'Flash', |
|
| 215 | + 'url' => $baseUrl . '/flash/', |
|
| 216 | + 'directory' => $baseDir . '/flash/', |
|
| 217 | + 'maxSize' => 0, |
|
| 218 | + 'allowedExtensions' => 'swf,flv', |
|
| 219 | + 'deniedExtensions' => ''); |
|
| 220 | 220 | |
| 221 | 221 | $config['ResourceType'][] = Array( |
| 222 | - 'name' => 'Media', |
|
| 223 | - 'url' => $baseUrl . '/media/', |
|
| 224 | - 'directory' => $baseDir . '/media/', |
|
| 225 | - 'maxSize' => 0, |
|
| 226 | - 'allowedExtensions' => 'mp3,mp4,swf,flv,avi', |
|
| 227 | - 'deniedExtensions' => ''); |
|
| 222 | + 'name' => 'Media', |
|
| 223 | + 'url' => $baseUrl . '/media/', |
|
| 224 | + 'directory' => $baseDir . '/media/', |
|
| 225 | + 'maxSize' => 0, |
|
| 226 | + 'allowedExtensions' => 'mp3,mp4,swf,flv,avi', |
|
| 227 | + 'deniedExtensions' => ''); |
|
| 228 | 228 | |
| 229 | 229 | /* |
| 230 | 230 | Due to security issues with Apache modules, it is recommended to leave the |
@@ -98,8 +98,8 @@ discard block |
||
| 98 | 98 | directory, no matter the resource type. |
| 99 | 99 | */ |
| 100 | 100 | $config['Thumbnails'] = Array( |
| 101 | - 'url' => $baseUrl . '_thumbs', |
|
| 102 | - 'directory' => $baseDir . '_thumbs', |
|
| 101 | + 'url' => $baseUrl.'_thumbs', |
|
| 102 | + 'directory' => $baseDir.'_thumbs', |
|
| 103 | 103 | 'enabled' => true, |
| 104 | 104 | 'directAccess' => false, |
| 105 | 105 | 'maxWidth' => 100, |
@@ -195,33 +195,33 @@ discard block |
||
| 195 | 195 | $config['DefaultResourceTypes'] = ''; |
| 196 | 196 | |
| 197 | 197 | $config['ResourceType'][] = Array( |
| 198 | - 'name' => 'Files', // Single quotes not allowed |
|
| 199 | - 'url' => $baseUrl . '/file/', |
|
| 200 | - 'directory' => $baseDir . '/file/', |
|
| 198 | + 'name' => 'Files', // Single quotes not allowed |
|
| 199 | + 'url' => $baseUrl.'/file/', |
|
| 200 | + 'directory' => $baseDir.'/file/', |
|
| 201 | 201 | 'maxSize' => 0, |
| 202 | 202 | 'allowedExtensions' => '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pptx,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,zip,ai,psd', |
| 203 | 203 | 'deniedExtensions' => ''); |
| 204 | 204 | |
| 205 | 205 | $config['ResourceType'][] = Array( |
| 206 | 206 | 'name' => 'Images', |
| 207 | - 'url' => $baseUrl . '/image/', |
|
| 208 | - 'directory' => $baseDir . '/image/', |
|
| 207 | + 'url' => $baseUrl.'/image/', |
|
| 208 | + 'directory' => $baseDir.'/image/', |
|
| 209 | 209 | 'maxSize' => "16M", |
| 210 | 210 | 'allowedExtensions' => 'bmp,gif,jpeg,jpg,png,', |
| 211 | 211 | 'deniedExtensions' => ''); |
| 212 | 212 | |
| 213 | 213 | $config['ResourceType'][] = Array( |
| 214 | 214 | 'name' => 'Flash', |
| 215 | - 'url' => $baseUrl . '/flash/', |
|
| 216 | - 'directory' => $baseDir . '/flash/', |
|
| 215 | + 'url' => $baseUrl.'/flash/', |
|
| 216 | + 'directory' => $baseDir.'/flash/', |
|
| 217 | 217 | 'maxSize' => 0, |
| 218 | 218 | 'allowedExtensions' => 'swf,flv', |
| 219 | 219 | 'deniedExtensions' => ''); |
| 220 | 220 | |
| 221 | 221 | $config['ResourceType'][] = Array( |
| 222 | 222 | 'name' => 'Media', |
| 223 | - 'url' => $baseUrl . '/media/', |
|
| 224 | - 'directory' => $baseDir . '/media/', |
|
| 223 | + 'url' => $baseUrl.'/media/', |
|
| 224 | + 'directory' => $baseDir.'/media/', |
|
| 225 | 225 | 'maxSize' => 0, |
| 226 | 226 | 'allowedExtensions' => 'mp3,mp4,swf,flv,avi', |
| 227 | 227 | 'deniedExtensions' => ''); |
@@ -299,13 +299,13 @@ discard block |
||
| 299 | 299 | Set to 0 to disable this feature. |
| 300 | 300 | Note: not needed on Windows-based servers. |
| 301 | 301 | */ |
| 302 | -$config['ChmodFiles'] = 0777 ; |
|
| 302 | +$config['ChmodFiles'] = 0777; |
|
| 303 | 303 | |
| 304 | 304 | /* |
| 305 | 305 | See comments above. |
| 306 | 306 | Used when creating folders that does not exist. |
| 307 | 307 | */ |
| 308 | -$config['ChmodFolders'] = 0777 ; |
|
| 308 | +$config['ChmodFolders'] = 0777; |
|
| 309 | 309 | |
| 310 | 310 | /* |
| 311 | 311 | Force ASCII names for files and folders. |
@@ -55,19 +55,19 @@ |
||
| 55 | 55 | define('CKFINDER_CONNECTOR_CONFIG_FILE_PATH',"./../../../config.php"); |
| 56 | 56 | |
| 57 | 57 | if (version_compare(phpversion(), '6', '>=')) { |
| 58 | - define('CKFINDER_CONNECTOR_PHP_MODE', 6); |
|
| 58 | + define('CKFINDER_CONNECTOR_PHP_MODE', 6); |
|
| 59 | 59 | } |
| 60 | 60 | else if (version_compare(phpversion(), '5', '>=')) { |
| 61 | - define('CKFINDER_CONNECTOR_PHP_MODE', 5); |
|
| 61 | + define('CKFINDER_CONNECTOR_PHP_MODE', 5); |
|
| 62 | 62 | } |
| 63 | 63 | else { |
| 64 | - define('CKFINDER_CONNECTOR_PHP_MODE', 4); |
|
| 64 | + define('CKFINDER_CONNECTOR_PHP_MODE', 4); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | if (CKFINDER_CONNECTOR_PHP_MODE == 4) { |
| 68 | - define('CKFINDER_CONNECTOR_LIB_DIR', "./php4"); |
|
| 68 | + define('CKFINDER_CONNECTOR_LIB_DIR', "./php4"); |
|
| 69 | 69 | } else { |
| 70 | - define('CKFINDER_CONNECTOR_LIB_DIR', "./php5"); |
|
| 70 | + define('CKFINDER_CONNECTOR_LIB_DIR', "./php5"); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | define('CKFINDER_CHARS', '123456789ABCDEFGHJKLMNPQRSTUVWXYZ'); |
@@ -23,36 +23,36 @@ |
||
| 23 | 23 | * No errors |
| 24 | 24 | */ |
| 25 | 25 | define('IN_CKFINDER', true); |
| 26 | -define('CKFINDER_CONNECTOR_ERROR_NONE',0); |
|
| 27 | -define('CKFINDER_CONNECTOR_ERROR_CUSTOM_ERROR',1); |
|
| 28 | -define('CKFINDER_CONNECTOR_ERROR_INVALID_COMMAND',10); |
|
| 29 | -define('CKFINDER_CONNECTOR_ERROR_TYPE_NOT_SPECIFIED',11); |
|
| 30 | -define('CKFINDER_CONNECTOR_ERROR_INVALID_TYPE',12); |
|
| 31 | -define('CKFINDER_CONNECTOR_ERROR_INVALID_NAME',102); |
|
| 32 | -define('CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED',103); |
|
| 33 | -define('CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED',104); |
|
| 34 | -define('CKFINDER_CONNECTOR_ERROR_INVALID_EXTENSION',105); |
|
| 35 | -define('CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST',109); |
|
| 36 | -define('CKFINDER_CONNECTOR_ERROR_UNKNOWN',110); |
|
| 37 | -define('CKFINDER_CONNECTOR_ERROR_ALREADY_EXIST',115); |
|
| 38 | -define('CKFINDER_CONNECTOR_ERROR_FOLDER_NOT_FOUND',116); |
|
| 39 | -define('CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND',117); |
|
| 40 | -define('CKFINDER_CONNECTOR_ERROR_SOURCE_AND_TARGET_PATH_EQUAL',118); |
|
| 41 | -define('CKFINDER_CONNECTOR_ERROR_UPLOADED_FILE_RENAMED',201); |
|
| 42 | -define('CKFINDER_CONNECTOR_ERROR_UPLOADED_INVALID',202); |
|
| 43 | -define('CKFINDER_CONNECTOR_ERROR_UPLOADED_TOO_BIG',203); |
|
| 44 | -define('CKFINDER_CONNECTOR_ERROR_UPLOADED_CORRUPT',204); |
|
| 45 | -define('CKFINDER_CONNECTOR_ERROR_UPLOADED_NO_TMP_DIR',205); |
|
| 46 | -define('CKFINDER_CONNECTOR_ERROR_UPLOADED_WRONG_HTML_FILE',206); |
|
| 47 | -define('CKFINDER_CONNECTOR_ERROR_MOVE_FAILED',300); |
|
| 48 | -define('CKFINDER_CONNECTOR_ERROR_COPY_FAILED',301); |
|
| 26 | +define('CKFINDER_CONNECTOR_ERROR_NONE', 0); |
|
| 27 | +define('CKFINDER_CONNECTOR_ERROR_CUSTOM_ERROR', 1); |
|
| 28 | +define('CKFINDER_CONNECTOR_ERROR_INVALID_COMMAND', 10); |
|
| 29 | +define('CKFINDER_CONNECTOR_ERROR_TYPE_NOT_SPECIFIED', 11); |
|
| 30 | +define('CKFINDER_CONNECTOR_ERROR_INVALID_TYPE', 12); |
|
| 31 | +define('CKFINDER_CONNECTOR_ERROR_INVALID_NAME', 102); |
|
| 32 | +define('CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED', 103); |
|
| 33 | +define('CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED', 104); |
|
| 34 | +define('CKFINDER_CONNECTOR_ERROR_INVALID_EXTENSION', 105); |
|
| 35 | +define('CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST', 109); |
|
| 36 | +define('CKFINDER_CONNECTOR_ERROR_UNKNOWN', 110); |
|
| 37 | +define('CKFINDER_CONNECTOR_ERROR_ALREADY_EXIST', 115); |
|
| 38 | +define('CKFINDER_CONNECTOR_ERROR_FOLDER_NOT_FOUND', 116); |
|
| 39 | +define('CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND', 117); |
|
| 40 | +define('CKFINDER_CONNECTOR_ERROR_SOURCE_AND_TARGET_PATH_EQUAL', 118); |
|
| 41 | +define('CKFINDER_CONNECTOR_ERROR_UPLOADED_FILE_RENAMED', 201); |
|
| 42 | +define('CKFINDER_CONNECTOR_ERROR_UPLOADED_INVALID', 202); |
|
| 43 | +define('CKFINDER_CONNECTOR_ERROR_UPLOADED_TOO_BIG', 203); |
|
| 44 | +define('CKFINDER_CONNECTOR_ERROR_UPLOADED_CORRUPT', 204); |
|
| 45 | +define('CKFINDER_CONNECTOR_ERROR_UPLOADED_NO_TMP_DIR', 205); |
|
| 46 | +define('CKFINDER_CONNECTOR_ERROR_UPLOADED_WRONG_HTML_FILE', 206); |
|
| 47 | +define('CKFINDER_CONNECTOR_ERROR_MOVE_FAILED', 300); |
|
| 48 | +define('CKFINDER_CONNECTOR_ERROR_COPY_FAILED', 301); |
|
| 49 | 49 | define('CKFINDER_CONNECTOR_ERROR_UPLOADED_INVALID_NAME_RENAMED', 207); |
| 50 | -define('CKFINDER_CONNECTOR_ERROR_CONNECTOR_DISABLED',500); |
|
| 51 | -define('CKFINDER_CONNECTOR_ERROR_THUMBNAILS_DISABLED',501); |
|
| 50 | +define('CKFINDER_CONNECTOR_ERROR_CONNECTOR_DISABLED', 500); |
|
| 51 | +define('CKFINDER_CONNECTOR_ERROR_THUMBNAILS_DISABLED', 501); |
|
| 52 | 52 | |
| 53 | -define('CKFINDER_CONNECTOR_DEFAULT_USER_FILES_PATH',"/userfiles/"); |
|
| 54 | -define('CKFINDER_CONNECTOR_LANG_PATH',"./lang"); |
|
| 55 | -define('CKFINDER_CONNECTOR_CONFIG_FILE_PATH',"./../../../config.php"); |
|
| 53 | +define('CKFINDER_CONNECTOR_DEFAULT_USER_FILES_PATH', "/userfiles/"); |
|
| 54 | +define('CKFINDER_CONNECTOR_LANG_PATH', "./lang"); |
|
| 55 | +define('CKFINDER_CONNECTOR_CONFIG_FILE_PATH', "./../../../config.php"); |
|
| 56 | 56 | |
| 57 | 57 | if (version_compare(phpversion(), '6', '>=')) { |
| 58 | 58 | define('CKFINDER_CONNECTOR_PHP_MODE', 6); |
@@ -56,11 +56,9 @@ |
||
| 56 | 56 | |
| 57 | 57 | if (version_compare(phpversion(), '6', '>=')) { |
| 58 | 58 | define('CKFINDER_CONNECTOR_PHP_MODE', 6); |
| 59 | -} |
|
| 60 | -else if (version_compare(phpversion(), '5', '>=')) { |
|
| 59 | +} else if (version_compare(phpversion(), '5', '>=')) { |
|
| 61 | 60 | define('CKFINDER_CONNECTOR_PHP_MODE', 5); |
| 62 | -} |
|
| 63 | -else { |
|
| 61 | +} else { |
|
| 64 | 62 | define('CKFINDER_CONNECTOR_PHP_MODE', 4); |
| 65 | 63 | } |
| 66 | 64 | |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | * @return string |
| 65 | 65 | */ |
| 66 | 66 | function resolveUrl($baseUrl) { |
| 67 | - $fileSystem =& CKFinder_Connector_Core_Factory::getInstance("Utils_FileSystem"); |
|
| 68 | - return $fileSystem->getDocumentRootPath() . $baseUrl; |
|
| 67 | + $fileSystem =& CKFinder_Connector_Core_Factory::getInstance("Utils_FileSystem"); |
|
| 68 | + return $fileSystem->getDocumentRootPath() . $baseUrl; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $utilsSecurity =& CKFinder_Connector_Core_Factory::getInstance("Utils_Security"); |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | $connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector"); |
| 88 | 88 | |
| 89 | 89 | if(isset($_GET['command'])) { |
| 90 | - $connector->executeCommand($_GET['command']); |
|
| 90 | + $connector->executeCommand($_GET['command']); |
|
| 91 | 91 | } |
| 92 | 92 | else { |
| 93 | - $connector->handleInvalidCommand(); |
|
| 93 | + $connector->handleInvalidCommand(); |
|
| 94 | 94 | } |
@@ -41,19 +41,19 @@ discard block |
||
| 41 | 41 | /** |
| 42 | 42 | * we need this class in each call |
| 43 | 43 | */ |
| 44 | -require_once CKFINDER_CONNECTOR_LIB_DIR . "/CommandHandler/CommandHandlerBase.php"; |
|
| 44 | +require_once CKFINDER_CONNECTOR_LIB_DIR."/CommandHandler/CommandHandlerBase.php"; |
|
| 45 | 45 | /** |
| 46 | 46 | * singleton factory |
| 47 | 47 | */ |
| 48 | -require_once CKFINDER_CONNECTOR_LIB_DIR . "/Core/Factory.php"; |
|
| 48 | +require_once CKFINDER_CONNECTOR_LIB_DIR."/Core/Factory.php"; |
|
| 49 | 49 | /** |
| 50 | 50 | * utils class |
| 51 | 51 | */ |
| 52 | -require_once CKFINDER_CONNECTOR_LIB_DIR . "/Utils/Misc.php"; |
|
| 52 | +require_once CKFINDER_CONNECTOR_LIB_DIR."/Utils/Misc.php"; |
|
| 53 | 53 | /** |
| 54 | 54 | * hooks class |
| 55 | 55 | */ |
| 56 | -require_once CKFINDER_CONNECTOR_LIB_DIR . "/Core/Hooks.php"; |
|
| 56 | +require_once CKFINDER_CONNECTOR_LIB_DIR."/Core/Hooks.php"; |
|
| 57 | 57 | /** |
| 58 | 58 | * Simple function required by config.php - discover the server side path |
| 59 | 59 | * to the directory relative to the "$baseUrl" attribute |
@@ -64,11 +64,11 @@ discard block |
||
| 64 | 64 | * @return string |
| 65 | 65 | */ |
| 66 | 66 | function resolveUrl($baseUrl) { |
| 67 | - $fileSystem =& CKFinder_Connector_Core_Factory::getInstance("Utils_FileSystem"); |
|
| 68 | - return $fileSystem->getDocumentRootPath() . $baseUrl; |
|
| 67 | + $fileSystem = & CKFinder_Connector_Core_Factory::getInstance("Utils_FileSystem"); |
|
| 68 | + return $fileSystem->getDocumentRootPath().$baseUrl; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | -$utilsSecurity =& CKFinder_Connector_Core_Factory::getInstance("Utils_Security"); |
|
| 71 | +$utilsSecurity = & CKFinder_Connector_Core_Factory::getInstance("Utils_Security"); |
|
| 72 | 72 | $utilsSecurity->getRidOfMagicQuotes(); |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -84,9 +84,9 @@ discard block |
||
| 84 | 84 | require_once CKFINDER_CONNECTOR_CONFIG_FILE_PATH; |
| 85 | 85 | |
| 86 | 86 | CKFinder_Connector_Core_Factory::initFactory(); |
| 87 | -$connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector"); |
|
| 87 | +$connector = & CKFinder_Connector_Core_Factory::getInstance("Core_Connector"); |
|
| 88 | 88 | |
| 89 | -if(isset($_GET['command'])) { |
|
| 89 | +if (isset($_GET['command'])) { |
|
| 90 | 90 | $connector->executeCommand($_GET['command']); |
| 91 | 91 | } |
| 92 | 92 | else { |
@@ -88,7 +88,6 @@ |
||
| 88 | 88 | |
| 89 | 89 | if(isset($_GET['command'])) { |
| 90 | 90 | $connector->executeCommand($_GET['command']); |
| 91 | -} |
|
| 92 | -else { |
|
| 91 | +} else { |
|
| 93 | 92 | $connector->handleInvalidCommand(); |
| 94 | 93 | } |