fckphp_config=$fckphp_config; $this->type=$type; $this->raw_cwd=$cwd; $this->actual_cwd=str_replace("//","/",($this->fckphp_config['UserFilesPath']."/$type/".$this->raw_cwd)); $this->real_cwd=str_replace("//","/",($this->fckphp_config['basedir']."/".$this->actual_cwd)); $this->newfolder=str_replace(array("..","/"),"",$_GET['NewFolderName']); } function checkFolderName($folderName) { //Check the name is not too long if (strlen($folderName)>$this->fckphp_config['MaxDirNameLength']) return false; //Check that it only contains valid characters for($i=0;$ifckphp_config['DirNameAllowedChars'])) return false; //If it got this far all is ok return true; } function run() { header ("content-type: text/xml"); echo "\n"; ?> real_cwd."/".$this->newfolder)); //Check the new name if ($this->checkFolderName($this->newfolder)) { //Check if it already exists if (is_dir($newdir)) { $err_no=101; //Folder already exists } else { //Check if we can create the directory here if (is_writeable($this->real_cwd)) { //Make the directory if (mkdir($newdir,0777)) { $err_no=0; //Success } else { $err_no=110; //Unknown error } } else { $err_no=103; //No permissions to create } } } else { $err_no=102; //Invalid Folder Name } ?> " />