3
* FCKeditor - The text editor for internet
4
* Copyright (C) 2003-2005 Frederico Caldeira Knabben
6
* Licensed under the terms of the GNU Lesser General Public License:
7
* http://www.opensource.org/licenses/lgpl-license.php
9
* For further information visit:
10
* http://www.fckeditor.net/
12
* "Support Open Source software. What about a donation today?"
14
* File Name: DeleteFolder.php
15
* Implements the DeleteFolder command to delete a folder
16
* in the current directory. Output is in XML.
19
* Grant French (grant@mcpuk.net)
28
function DeleteFolder($fckphp_config,$type,$cwd) {
29
$this->fckphp_config=$fckphp_config;
32
$this->actual_cwd=str_replace("//","/",($this->fckphp_config['UserFilesPath']."/$type/".$this->raw_cwd));
33
$this->real_cwd=str_replace("//","/",($this->fckphp_config['basedir']."/".$this->actual_cwd));
34
$this->foldername=str_replace(array("..","/"),"",$_GET['FolderName']);
39
if ($this->delDir($this->real_cwd.'/'.$this->foldername)) {
45
header ("content-type: text/xml");
46
echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
48
<Connector command="DeleteFolder" resourceType="<?php echo $this->type; ?>">
49
<CurrentFolder path="<?php echo $this->raw_cwd; ?>" url="<?php echo $this->actual_cwd; ?>" />
50
<Error number="<?php echo "".$err_no; ?>" />
56
function delDir($dir) {
59
while ($entry=readdir($dh)) {
60
if (($entry!=".")&&($entry!="..")) {
61
if (is_dir($dir.'/'.$entry)) {
62
$this->delDir($dir.'/'.$entry);
64
$thumb=$dir.'/.thumb_'.$entry;
65
if (file_exists($thumb)) if (!unlink($thumb)) return false;
66
if (!unlink($dir.'/'.$entry)) return false;
b'\\ No newline at end of file'