diff --git a/assets/css/ftp-manager.css b/assets/css/ftp-manager.css
deleted file mode 100644
index c44357f..0000000
--- a/assets/css/ftp-manager.css
+++ /dev/null
@@ -1,16 +0,0 @@
-body {overflow: hidden;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-
-h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
-a {color: #2187e7; text-decoration: none}
-input {padding: 4px; border: 0; background-color: #444; color: #fff}
-select {padding: 3px 4px; border: 0; background-color: #444; color: #fff}
-input:focus {outline: none; background: rgba(0,198,255,0.5); color: #fff}
-select:focus {outline: none}
-
-.ftpManager {background-color: #1c1c19; color: #fff; padding: 20px}
-.ftpManager .info {font-size: 10px; color: rgba(0,198,255,0.7); cursor: help}
\ No newline at end of file
diff --git a/assets/js/icecoder.js b/assets/js/icecoder.js
index 32815f5..23cf5c8 100644
--- a/assets/js/icecoder.js
+++ b/assets/js/icecoder.js
@@ -3672,21 +3672,6 @@ var ICEcoder = {
this.showHide('show', get('blackMask'));
},
- // Go to localhost root
- goLocalhostRoot: function() {
- this.filesFrame.contentWindow.frames['fileControl'].location.href =
- this.iceLoc +
- "/lib/go-localhost-root.php";
- },
-
- // Show the FTP manager
- ftpManager: function() {
- get('mediaContainer').innerHTML = '';
- this.showHide('show', get('blackMask'));
- },
-
// Update the settings used when we make a change to them
useNewSettings: function(settings) {
let styleNode, thisCSS, strCSS, activeLineBG;
diff --git a/classes/Backup.php b/classes/Backup.php
index 59c2102..f168e02 100644
--- a/classes/Backup.php
+++ b/classes/Backup.php
@@ -14,13 +14,13 @@ class Backup
}
public function makeBackup($fileLoc, $fileName, $contents) {
- global $ftpSite, $t, $ICEcoder;
+ global $t, $ICEcoder;
$backupDirFormat = "Y-m-d";
// Establish the base, host and date dir parts...
$backupDirBase = str_replace("\\", "/", dirname(__FILE__)) . "/../data/backups/";
- $backupDirHost = isset($ftpSite) ? parse_url($ftpSite, PHP_URL_HOST) : "localhost";
+ $backupDirHost = "localhost";
$backupDirDate = date($backupDirFormat);
// Establish an array of dirs from base to our file location
diff --git a/classes/FTP.php b/classes/FTP.php
deleted file mode 100644
index cef29c5..0000000
--- a/classes/FTP.php
+++ /dev/null
@@ -1,188 +0,0 @@
-systemClass = new System();
- }
-
- public function writeFile() {
- global $fileLoc, $fileName, $ftpConn, $ftpRoot, $ftpHost, $ftpMode, $ICEcoder, $doNext, $filemtime, $tabNum;
-
- $ftpFilepath = ltrim($fileLoc . "/" . $fileName, "/");
- if (isset($_POST['changes'])) {
- // Get existing file contents as lines
- $loadedFile = toUTF8noBOM($this->ftpGetContents($ftpConn, $ftpRoot . $fileLoc . "/" . $fileName, $ftpMode), false);
- $fileLines = explode("\n", str_replace("\r", "", $loadedFile));
- // Need to add a new line at the end of each because explode will lose them,
- // want want to end up with same array that 'file($file)' produces for a local file
- // - it keeps the line endings at the end of each array item
- for ($i = 0; $i < count($fileLines); $i++) {
- if ($i < count($fileLines) - 1) {
- $fileLines[$i] .= $ICEcoder["lineEnding"];
- }
- }
- // Stitch changes onto it
- $contents = $this->systemClass->stitchChanges($fileLines, $_POST['changes']);
-
- // get old file contents and count stats on usage \n and \r there
- // in this case we can keep line endings, which file had before, without
- // making code version control systems going crazy about line endings change in whole file.
- $unixNewLines = preg_match_all('/[^\r][\n]/u', $loadedFile);
- $windowsNewLines = preg_match_all('/[\r][\n]/u', $loadedFile);
- } else {
- $contents = $_POST['contents'];
- }
-
- // replace \r\n (Windows), \r (old Mac) and \n (Linux) line endings with whatever we chose to be lineEnding
- $contents = str_replace("\r\n", $ICEcoder["lineEnding"], $contents);
- $contents = str_replace("\r", $ICEcoder["lineEnding"], $contents);
- $contents = str_replace("\n", $ICEcoder["lineEnding"], $contents);
- if (isset($_POST['changes']) && ($unixNewLines > 0) || ($windowsNewLines > 0)) {
- if ($unixNewLines > $windowsNewLines){
- $contents = str_replace($ICEcoder["lineEnding"], "\n", $contents);
- } elseif ($windowsNewLines > $unixNewLines){
- $contents = str_replace($ICEcoder["lineEnding"], "\r\n", $contents);
- }
- }
- // Write our file contents
- if (!$this->ftpWriteFile($ftpConn, $ftpFilepath, $contents, $ftpMode)) {
- $doNext .= 'ICEcoder.message("Sorry, could not write ' . $ftpFilepath . ' at ' . $ftpHost . '");';
- } else {
- $doNext .= 'ICEcoder.openFileMDTs[' . ($tabNum - 1) .']="' . $filemtime . '";';
- $doNext .= '(function() {var x = ICEcoder.openFileVersions; var y = ' . ($tabNum - 1) .'; x[y] = "undefined" != typeof x[y] ? x[y] + 1 : 1})(); ICEcoder.updateVersionsDisplay();';
- }
- }
-
- // Start a FTP connection
- function ftpStart()
- {
- global $ftpConn, $ftpLogin, $ftpHost, $ftpUser, $ftpPass, $ftpPasv;
-
- // Establish connection, login and maybe use pasv
- $ftpConn = ftp_connect($ftpHost);
- $ftpLogin = ftp_login($ftpConn, $ftpUser, $ftpPass);
- if ($ftpPasv) {
- ftp_pasv($ftpConn, true);
- }
- }
-
- // End a FTP connection
- function ftpEnd()
- {
- global $ftpConn;
-
- ftp_close($ftpConn);
- }
-
- // Get dir/file lists (simple and detailed) from FTP detailed rawlist response
- function ftpGetList($ftpConn, $directory = '.')
- {
- $simpleList = $detailedList = array();
- // If we have a FTP rawlist to work with
- if (is_array($rows = @ftp_rawlist($ftpConn, $directory))) {
- foreach ($rows as $row) {
- // Split row up by spaces and set keys on $item array
- $chunks = preg_split("/\s+/", $row);
- list($item['rights'], $item['number'], $item['user'], $item['group'], $item['size'], $item['month'], $item['day'], $item['time']) = $chunks;
- // Also set if this is a dir or file
- $item['type'] = $chunks[0][0] === 'd' ? 'directory' : 'file';
- // Splice the array and finally work out $simpleList and $detailedList
- array_splice($chunks, 0, 8);
- $detailedList[implode(" ", $chunks)] = $item;
- $simpleList[] = implode(" ", $chunks);
- }
- // Return simple array list and detailed items list also
- return array('simpleList' => $simpleList, 'detailedList' => $detailedList);
- }
- return false;
- }
-
- // Get detailed info on a file from returned info from ftpGetList
- function ftpGetFileInfo($ftpConn, $directory = '.', $fileName)
- {
- // Get both sets of arrays back and get our detailed list
- $ftpListArrays = $this->ftpGetList($ftpConn, $directory);
- $detailedList = $ftpListArrays['detailedList'];
-
- // Now get the file info for our file
- $fileInfo = $detailedList[$fileName];
-
- // Return the info
- return $fileInfo;
- }
-
- // Get contents over FTP
- function ftpGetContents($ftpConn, $filepath, $ftpMode)
- {
- // Create temp handler, this type needed for extended char set
- $tempHandle = fopen('php://temp', 'r+');
-
- // Get file from FTP assuming that it exists
- ftp_fget($ftpConn, $tempHandle, $filepath, $ftpMode, 0);
-
- // Return our content
- return stream_get_contents($tempHandle, -1, 0);
- }
-
- // Write file contents over FTP
- function ftpWriteFile($ftpConn, $filepath, $contents, $ftpMode)
- {
- // Create temp handler, this type needed for extended char set
- $tempHandle = fopen('php://temp', 'r+');
-
- // Write contents to handle and rewind head
- fwrite($tempHandle, $contents);
- rewind($tempHandle);
-
- // Write our content and return true/false
- return ftp_fput($ftpConn, $filepath, $tempHandle, $ftpMode, 0);
- }
-
- // Make a new dir over FTP
- function ftpMkDir($ftpConn, $perms, $dir)
- {
- // Create the new dir
- if (!ftp_mkdir($ftpConn, $dir)) {
- return false;
- } else {
- // Also then set perms (we must be able to do that if we created dir, so can always return true)
- $this->ftpPerms($ftpConn, $perms, $dir);
- return true;
- }
- }
-
- // Rename a dir/dile over FTP
- function ftpRename($ftpConn, $oldPath, $newPath)
- {
- // Return success status of rename
- return ftp_rename($ftpConn, $oldPath, $newPath);
- }
-
- // Change dir/file perms over FTP
- function ftpPerms($ftpConn, $perms, $filePath)
- {
- // Return success status of perms change
- return ftp_chmod($ftpConn, $perms, $filePath);
- }
-
- // Delete dir/file over FTP
- function ftpDelete($ftpConn, $type, $path)
- {
- if ($type == "file") {
- // Delete our file and return true/false
- return ftp_delete($ftpConn, $path);
- } else {
- // Delete our dir and return true/false
- return ftp_rmdir($ftpConn, $path);
- }
- }
-
-}
diff --git a/classes/File.php b/classes/File.php
index 9053c93..efc909e 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -4,19 +4,16 @@ namespace ICEcoder;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
-use ICEcoder\FTP;
use ICEcoder\System;
use scssc;
use lessc;
class File
{
- private $ftpClass;
private $systemClass;
public function __construct()
{
- $this->ftpClass = new FTP();
$this->systemClass = new System();
}
@@ -67,7 +64,7 @@ class File
// On the banned file/dir list
($bannedFileFound) ||
// A local folder that isn't the doc root or starts with the doc root
- ("getRemoteFile" !== $_GET['action'] && !isset($ftpSite) &&
+ ("getRemoteFile" !== $_GET['action'] &&
rtrim($allFiles[$i], "/") !== rtrim($docRoot, "/") &&
true === realpath(rtrim(dirname($allFiles[$i]), "/")) &&
0 !== strpos(realpath(rtrim(dirname($allFiles[$i]), "/")), realpath(rtrim($docRoot, "/")))
@@ -111,7 +108,7 @@ class File
}
public function load() {
- global $file, $fileLoc, $fileName, $t, $ftpConn, $ftpHost, $ftpLogin, $ftpRoot, $ftpUser, $ftpMode;
+ global $file, $fileLoc, $fileName, $t;
echo 'action="load";';
$lineNumber = max(isset($_REQUEST['lineNumber']) ? intval($_REQUEST['lineNumber']) : 1, 1);
// Check this file isn't on the banned list at all
@@ -124,10 +121,10 @@ class File
if (false === $canOpen) {
echo 'fileType="nothing"; parent.parent.ICEcoder.message(\'' . $t['Sorry, could not...'] . ' ' . $fileLoc . "/" . $fileName . '\');';
- } elseif (isset($ftpSite) || file_exists($file)) {
+ } elseif (file_exists($file)) {
$finfo = "text";
// Determine what to do based on mime type
- if (!isset($ftpSite) && function_exists('finfo_open')) {
+ if (function_exists('finfo_open')) {
$finfoMIME = finfo_open(FILEINFO_MIME);
$finfo = finfo_file($finfoMIME, $file);
finfo_close($finfoMIME);
@@ -144,20 +141,9 @@ class File
if (0 === strpos($finfo, "text") || 0 === strpos($finfo, "application/json") || 0 === strpos($finfo, "application/xml") || false !== strpos($finfo, "empty")) {
echo 'fileType="text";';
- // Get file over FTP?
- if (isset($ftpSite)) {
- $this->ftpClass->ftpStart();
- // Show user warning if no good connection
- if (!$ftpConn || !$ftpLogin) {
- die('parent.parent.ICEcoder.message("Sorry, no FTP connection to ' . $ftpHost . ' for user ' . $ftpUser . '");parent.parent.ICEcoder.serverMessage();parent.parent.ICEcoder.serverQueue("del");');
- }
- // Get our file contents and close the FTP connection
- $loadedFile = toUTF8noBOM($this->ftpClass->ftpGetContents($ftpConn, $ftpRoot . $fileLoc . "/" . $fileName, $ftpMode), false);
- $this->ftpClass->ftpEnd();
- // Get local file
- } else {
- $loadedFile = toUTF8noBOM(getData($file), true);
- }
+ // Get data from file
+ $loadedFile = toUTF8noBOM(getData($file), true);
+
$encoding = ini_get("default_charset");
if ("" == $encoding) {
$encoding = "UTF-8";
@@ -186,7 +172,7 @@ class File
$script = 'if ("text" === fileType) {';
- if (isset($ftpSite) || file_exists($file)) {
+ if (file_exists($file)) {
$script .= '
setTimeout(function() {
if (!parent.parent.ICEcoder.content.contentWindow.createNewCMInstance) {
@@ -247,7 +233,7 @@ class File
parent.parent.document.getElementById(\'blackMask\').style.visibility = "visible";
parent.parent.document.getElementById(\'mediaContainer\').innerHTML =
"" +
- "
700 || this.naturalHeight > 500) ? \', ' .$t['displayed at'] . '\' + this.width + \' x \' + this.height : \'\'; document.getElementById(\'imgInfo\').innerHTML += \' (\' + this.naturalWidth + \' x \' + this.naturalHeight + reducedImgMsg + \')\'; ICEcoder.initCanvasImage(this); ICEcoder.interactCanvasImage(this)\">
" +
+ "
700 || this.naturalHeight > 500) ? \', ' .$t['displayed at'] . '\' + this.width + \' x \' + this.height : \'\'; document.getElementById(\'imgInfo\').innerHTML += \' (\' + this.naturalWidth + \' x \' + this.naturalHeight + reducedImgMsg + \')\'; ICEcoder.initCanvasImage(this); ICEcoder.interactCanvasImage(this)\">
" +
"
" +
"' . $fileLoc . "/" . $fileName . '" +
"
" +
@@ -273,7 +259,6 @@ class File
$fileName = $fileDetails['fileName'];
$fileMDTURLPart = $fileDetails['fileMDTURLPart'];
$fileVersionURLPart = $fileDetails['fileVersionURLPart'];
- $ftpSite = $fileDetails['ftpSite'];
$doNext = '
ICEcoder.serverMessage();
@@ -300,7 +285,7 @@ class File
/* Saving under conditions: Confirmation of overwrite or there is no filename conflict, it is a new file, in either case we can save */
if (overwriteOK || noConflictSave) {
- newFileName = "' . (true === $ftpSite ? "" : $docRoot) . '" + newFileName;
+ newFileName = "' . $docRoot . '" + newFileName;
saveURL = "lib/file-control.php?action=save' . $fileMDTURLPart . $fileVersionURLPart . '&csrf=' . $_GET["csrf"] . '";
var xhr = ICEcoder.xhrObj();
@@ -721,26 +706,13 @@ class File
}
public function returnJSON() {
- global $ftpSite, $ftpConn, $fileLoc, $fileName, $ftpRoot, $file, $filemtime, $finalAction, $timeStart, $error, $errorStr, $errorMsg, $doNext;
+ global $fileLoc, $fileName, $file, $filemtime, $finalAction, $timeStart, $error, $errorStr, $errorMsg, $doNext;
- if (isset($ftpSite)) {
- // Get info on dir/file now
- $ftpFileDirInfo = $this->ftpClass->ftpGetFileInfo($ftpConn, ltrim($fileLoc, "/"), $fileName);
- // End the connection
- $this->ftpClass->ftpEnd();
- // Then set info
- $itemAbsPath = $ftpRoot . $fileLoc . '/' . $fileName;
- $itemPath = dirname($ftpRoot.$fileLoc . '/' . $fileName);
- $itemBytes = $ftpFileDirInfo['size'];
- $itemType = (isset($ftpFileDirInfo['type']) ? ("directory" === $ftpFileDirInfo['type'] ? "dir" : "file") : "unknown");
- $itemExists = (isset($ftpFileDirInfo['type']) ? "true" : "false");
- } else {
- $itemAbsPath = $file;
- $itemPath = dirname($file);
- $itemBytes = is_dir($file) || !file_exists($file) ? null : filesize($file);
- $itemType = (file_exists($file) ? (is_dir($file) ? "dir" : "file") : "unknown");
- $itemExists = (file_exists($file) ? "true" : "false");
- }
+ $itemAbsPath = $file;
+ $itemPath = dirname($file);
+ $itemBytes = is_dir($file) || !file_exists($file) ? null : filesize($file);
+ $itemType = (file_exists($file) ? (is_dir($file) ? "dir" : "file") : "unknown");
+ $itemExists = (file_exists($file) ? "true" : "false");
return '{
"file": {
diff --git a/index.php b/index.php
index 3c2fe5c..8f9b204 100644
--- a/index.php
+++ b/index.php
@@ -275,17 +275,6 @@ if (true === $havePrettier && true === file_exists(dirname(__FILE__) . "/plugins
Plugins
-
- Tutorial
diff --git a/lang/chinese-simplified.php b/lang/chinese-simplified.php
index e63a9bd..41dd85c 100644
--- a/lang/chinese-simplified.php
+++ b/lang/chinese-simplified.php
@@ -147,7 +147,6 @@ $text = [
"Sorry, cannot save" => "抱歉, 不能保存",
"Sorry, cannot replace..." => "抱歉, 目标不能替换文本",
"Sorry, cannot change..." => "抱歉, 目标不能更改权限",
- "Sorry, cannot delete more..." => "抱歉,在FTP模式下一次不能删除多个项目",
"Sorry, cannot delete..." => "抱歉, 不能删除根目录",
"Sorry, cannot delete" => "抱歉, 不能删除",
"Sorry, this file..." => "抱歉, 此文件已更改, 不能保存",
@@ -159,37 +158,6 @@ $text = [
"Saving" => "正在保存",
],
- "ftp-manager" =>
- [
- "Saving FTP sites" => "保存FTP站点",
- "Cannot update config..." => "无法更新配置文件,请设置公用写入权限。",
- "and try again" => "重试",
- "ftp manager" => "FTP管理器",
- "Choose existing site" => "选择现有网站",
- "Are you sure..." => "确实要删除此网站吗?",
- "Add new site" => "添加新站点",
- "Edit site" => "配置站点",
- "Site base" => "站点信息",
- "Host" => "域名",
- "Username" => "用户名",
- "Password" => "密码",
- "PASV and mode" => "被动模式",
- "Root" => "根目录",
- "eg http://yourdomain.com" => "例 http://yourdomain.com",
- "eg ftp.yourdomain.com" => "例 ftp.yourdomain.com",
- "eg user123" => "例 user123",
- "eg pass123" => "例 pass123",
- "Use PASV mode..." => "如果FTP站点需要,请使用被动模式,并选择数据传输类型 ASCII(字符) 或 Binary(二进制)",
- "eg /htdocs" => "例 /htdocs",
- "PASV connection off" => "关闭 PASV 模式连接",
- "PASV connection on" => "开启 PASV 模式连接",
- "ASCII transfer" => "ASCII 字符传输",
- "Binary transfer" => "Binary 二进制传输",
- "Add" => "添加",
- "Choose" => "选择",
- "Update" => "更新",
- ],
-
"get-branch" => [],
"headers" =>
diff --git a/lang/chinese-traditional.php b/lang/chinese-traditional.php
index 342c1ee..ae19c5d 100644
--- a/lang/chinese-traditional.php
+++ b/lang/chinese-traditional.php
@@ -147,7 +147,6 @@ $text = [
"Sorry, cannot replace..." => "抱歉, 目標不能替換文本",
"Sorry, cannot change..." => "抱歉, 目標不能更改權限",
"Sorry, cannot delete..." => "抱歉, 不能刪除根級別ROOT",
- "Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
"Sorry, cannot delete" => "抱歉, 不能刪除",
"Sorry, this file..." => "抱歉, 此文件已更改, 不能保存",
"Reload this file..." => "重新加載該文件, 你的版本複製到一個新文件?",
@@ -158,37 +157,6 @@ $text = [
"Saving" => "正在保存",
],
- "ftp-manager" =>
- [
- "Saving FTP sites" => "Saving FTP sites",
- "Cannot update config..." => "Cannot update config file. Please set public write permissions on",
- "and try again" => "and try again",
- "ftp manager" => "ftp manager",
- "Choose existing site" => "Choose existing site",
- "Are you sure..." => "Are you sure you wish to remove this site?",
- "Add new site" => "Add new site",
- "Edit site" => "Edit site",
- "Site base" => "Site base",
- "Host" => "Host",
- "Username" => "Username",
- "Password" => "Password",
- "PASV and mode" => "PASV and mode",
- "Root" => "Root",
- "eg http://yourdomain.com" => "eg http://yourdomain.com",
- "eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
- "eg user123" => "eg user123",
- "eg pass123" => "eg pass123",
- "Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
- "eg /htdocs" => "eg /htdocs",
- "PASV connection off" => "PASV connection off",
- "PASV connection on" => "PASV connection on",
- "ASCII transfer" => "ASCII transfer",
- "Binary transfer" => "Binary transfer",
- "Add" => "Add",
- "Choose" => "Choose",
- "Update" => "Update",
- ],
-
"get-branch" => [],
"headers" =>
diff --git a/lang/dutch.php b/lang/dutch.php
index 4f2c094..268e53f 100644
--- a/lang/dutch.php
+++ b/lang/dutch.php
@@ -146,7 +146,6 @@ $text = [
"Sorry, cannot save" => "Kan niet opslaan",
"Sorry, cannot replace..." => "Kan geen tekst vervangen in",
"Sorry, cannot change..." => "Kan de rechten niet wijzigen voor",
- "Sorry, cannot delete more..." => "U kunt niet meer dan een bestand tegelijkertijd verwijderen in FTP modus",
"Sorry, cannot delete..." => "Kan de root level niet verwijderen",
"Sorry, cannot delete" => "Kan niet verwijderd worden",
"Sorry, this file..." => "Het bestand is gewijzigd, maar kan niet worden opgeslagen",
@@ -158,37 +157,6 @@ $text = [
"Saving" => "Opslaan"
],
- "ftp-manager" =>
- [
- "Saving FTP sites" => "Saving FTP sites",
- "Cannot update config..." => "Cannot update config file. Please set public write permissions on",
- "and try again" => "and try again",
- "ftp manager" => "ftp manager",
- "Choose existing site" => "Choose existing site",
- "Are you sure..." => "Are you sure you wish to remove this site?",
- "Add new site" => "Add new site",
- "Edit site" => "Edit site",
- "Site base" => "Site base",
- "Host" => "Host",
- "Username" => "Username",
- "Password" => "Password",
- "PASV and mode" => "PASV and mode",
- "Root" => "Root",
- "eg http://yourdomain.com" => "eg http://yourdomain.com",
- "eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
- "eg user123" => "eg user123",
- "eg pass123" => "eg pass123",
- "Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
- "eg /htdocs" => "eg /htdocs",
- "PASV connection off" => "PASV connection off",
- "PASV connection on" => "PASV connection on",
- "ASCII transfer" => "ASCII transfer",
- "Binary transfer" => "Binary transfer",
- "Add" => "Add",
- "Choose" => "Choose",
- "Update" => "Update",
- ],
-
"get-branch" => [],
"headers" =>
diff --git a/lang/english.php b/lang/english.php
index 8b62bde..fa34b0e 100644
--- a/lang/english.php
+++ b/lang/english.php
@@ -146,7 +146,6 @@ $text = [
"Sorry, cannot save" => "Sorry, cannot save",
"Sorry, cannot replace..." => "Sorry, cannot replace text in",
"Sorry, cannot change..." => "Sorry, cannot change permissions on",
- "Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
"Sorry, cannot delete..." => "Sorry, cannot delete the root level",
"Sorry, cannot delete" => "Sorry, cannot delete",
"Sorry, this file..." => "Sorry, this file has changed outside of ICEcoder, cannot save",
@@ -158,37 +157,6 @@ $text = [
"Saving" => "Saving",
],
- "ftp-manager" =>
- [
- "Saving FTP sites" => "Saving FTP sites",
- "Cannot update config..." => "Cannot update config file. Please set public write permissions on",
- "and try again" => "and try again",
- "ftp manager" => "ftp manager",
- "Choose existing site" => "Choose existing site",
- "Are you sure..." => "Are you sure you wish to remove this site?",
- "Add new site" => "Add new site",
- "Edit site" => "Edit site",
- "Site base" => "Site base",
- "Host" => "Host",
- "Username" => "Username",
- "Password" => "Password",
- "PASV and mode" => "PASV and mode",
- "Root" => "Root",
- "eg http://yourdomain.com" => "eg http://yourdomain.com",
- "eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
- "eg user123" => "eg user123",
- "eg pass123" => "eg pass123",
- "Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
- "eg /htdocs" => "eg /htdocs",
- "PASV connection off" => "PASV connection off",
- "PASV connection on" => "PASV connection on",
- "ASCII transfer" => "ASCII transfer",
- "Binary transfer" => "Binary transfer",
- "Add" => "Add",
- "Choose" => "Choose",
- "Update" => "Update",
- ],
-
"get-branch" => [],
"headers" =>
diff --git a/lang/french.php b/lang/french.php
index a6c1ed3..ce8e7ee 100644
--- a/lang/french.php
+++ b/lang/french.php
@@ -146,7 +146,6 @@ $text = [
"Sorry, cannot save" => "Désolé, impossibilité de sauvegarder",
"Sorry, cannot replace..." => "Désolé, impossibilité de remplacer le texte dans ",
"Sorry, cannot change..." => "Désolé, impossibilité de changer les permissions sur",
- "Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
"Sorry, cannot delete..." => "Désolé, imossibilité de supprimer le dossier racine",
"Sorry, cannot delete" => "Désolé, impossibilité d'effacer",
"Sorry, this file..." => "Désolé, le fichier a été modifié, impossibilité de sauvegarder",
@@ -158,37 +157,6 @@ $text = [
"Saving" => "Sauvegardé",
],
- "ftp-manager" =>
- [
- "Saving FTP sites" => "Saving FTP sites",
- "Cannot update config..." => "Cannot update config file. Please set public write permissions on",
- "and try again" => "and try again",
- "ftp manager" => "ftp manager",
- "Choose existing site" => "Choose existing site",
- "Are you sure..." => "Are you sure you wish to remove this site?",
- "Add new site" => "Add new site",
- "Edit site" => "Edit site",
- "Site base" => "Site base",
- "Host" => "Host",
- "Username" => "Username",
- "Password" => "Password",
- "PASV and mode" => "PASV and mode",
- "Root" => "Root",
- "eg http://yourdomain.com" => "eg http://yourdomain.com",
- "eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
- "eg user123" => "eg user123",
- "eg pass123" => "eg pass123",
- "Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
- "eg /htdocs" => "eg /htdocs",
- "PASV connection off" => "PASV connection off",
- "PASV connection on" => "PASV connection on",
- "ASCII transfer" => "ASCII transfer",
- "Binary transfer" => "Binary transfer",
- "Add" => "Add",
- "Choose" => "Choose",
- "Update" => "Update",
- ],
-
"get-branch" => [],
"headers" =>
diff --git a/lang/german.php b/lang/german.php
index 85bd8ad..f747a8d 100644
--- a/lang/german.php
+++ b/lang/german.php
@@ -146,7 +146,6 @@ $text = [
"Sorry, cannot save" => "Entschuldigung, kann nicht speichern",
"Sorry, cannot replace..." => "Entschuldigung, kann den Text nicht ersetzen",
"Sorry, cannot change..." => "Entschuldigung, kann die Berechtigung nicht ändern für",
- "Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
"Sorry, cannot delete..." => "Entschuldigung, kann das Hauptverzeichnis nicht löschen",
"Sorry, cannot delete" => "Entschuldigung, kann nicht löschen",
"Sorry, this file..." => "Entschuldigung, die Datei wurde geändert, kann nicht speichern",
@@ -158,37 +157,6 @@ $text = [
"Saving" => "Speichere",
],
- "ftp-manager" =>
- [
- "Saving FTP sites" => "Saving FTP sites",
- "Cannot update config..." => "Cannot update config file. Please set public write permissions on",
- "and try again" => "and try again",
- "ftp manager" => "ftp manager",
- "Choose existing site" => "Choose existing site",
- "Are you sure..." => "Are you sure you wish to remove this site?",
- "Add new site" => "Add new site",
- "Edit site" => "Edit site",
- "Site base" => "Site base",
- "Host" => "Host",
- "Username" => "Username",
- "Password" => "Password",
- "PASV and mode" => "PASV and mode",
- "Root" => "Root",
- "eg http://yourdomain.com" => "eg http://yourdomain.com",
- "eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
- "eg user123" => "eg user123",
- "eg pass123" => "eg pass123",
- "Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
- "eg /htdocs" => "eg /htdocs",
- "PASV connection off" => "PASV connection off",
- "PASV connection on" => "PASV connection on",
- "ASCII transfer" => "ASCII transfer",
- "Binary transfer" => "Binary transfer",
- "Add" => "Add",
- "Choose" => "Choose",
- "Update" => "Update",
- ],
-
"get-branch" => [],
"headers" =>
diff --git a/lang/italian.php b/lang/italian.php
index ebeeef3..1df5c5d 100644
--- a/lang/italian.php
+++ b/lang/italian.php
@@ -146,7 +146,6 @@ $text = [
"Sorry, cannot save" => "Siamo spiacenti, non è possibile salvare",
"Sorry, cannot replace..." => "Siamo spiacenti, non è possibile sostituire il testo",
"Sorry, cannot change..." => "Siamo spiacenti, non è possibile cambiare i permessi",
- "Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
"Sorry, cannot delete..." => "Siamo spiacenti, non è possibile cancellare la cartella root",
"Sorry, cannot delete" => "Siamo spiacenti, non è possibile cancellare",
"Sorry, this file..." => "Siamo spiacenti, questo file è stato cambiato, non è possibile salvarlo",
@@ -158,37 +157,6 @@ $text = [
"Saving" => "Stiamo salvando",
],
- "ftp-manager" =>
- [
- "Saving FTP sites" => "Saving FTP sites",
- "Cannot update config..." => "Cannot update config file. Please set public write permissions on",
- "and try again" => "and try again",
- "ftp manager" => "ftp manager",
- "Choose existing site" => "Choose existing site",
- "Are you sure..." => "Are you sure you wish to remove this site?",
- "Add new site" => "Add new site",
- "Edit site" => "Edit site",
- "Site base" => "Site base",
- "Host" => "Host",
- "Username" => "Username",
- "Password" => "Password",
- "PASV and mode" => "PASV and mode",
- "Root" => "Root",
- "eg http://yourdomain.com" => "eg http://yourdomain.com",
- "eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
- "eg user123" => "eg user123",
- "eg pass123" => "eg pass123",
- "Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
- "eg /htdocs" => "eg /htdocs",
- "PASV connection off" => "PASV connection off",
- "PASV connection on" => "PASV connection on",
- "ASCII transfer" => "ASCII transfer",
- "Binary transfer" => "Binary transfer",
- "Add" => "Add",
- "Choose" => "Choose",
- "Update" => "Update",
- ],
-
"get-branch" => [],
"headers" =>
diff --git a/lang/norwegian.php b/lang/norwegian.php
index bd7eaa2..b6ddbd1 100644
--- a/lang/norwegian.php
+++ b/lang/norwegian.php
@@ -146,7 +146,6 @@ $text = [
"Sorry, cannot save" => "Beklager, kan ikke lagre",
"Sorry, cannot replace..." => "Beklager, kan ikke erstatte tekst i",
"Sorry, cannot change..." => "Beklager, kan ikke endre tillatelser på",
- "Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
"Sorry, cannot delete..." => "Beklager, kan ikke slette rotnivå",
"Sorry, cannot delete" => "Beklager, kan ikke slette",
"Sorry, this file..." => "Beklager, denne filen er endret, kan ikke lagre",
@@ -158,37 +157,6 @@ $text = [
"Saving" => "Lagring",
],
- "ftp-manager" =>
- [
- "Saving FTP sites" => "Saving FTP sites",
- "Cannot update config..." => "Cannot update config file. Please set public write permissions on",
- "and try again" => "and try again",
- "ftp manager" => "ftp manager",
- "Choose existing site" => "Choose existing site",
- "Are you sure..." => "Are you sure you wish to remove this site?",
- "Add new site" => "Add new site",
- "Edit site" => "Edit site",
- "Site base" => "Site base",
- "Host" => "Host",
- "Username" => "Username",
- "Password" => "Password",
- "PASV and mode" => "PASV and mode",
- "Root" => "Root",
- "eg http://yourdomain.com" => "eg http://yourdomain.com",
- "eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
- "eg user123" => "eg user123",
- "eg pass123" => "eg pass123",
- "Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
- "eg /htdocs" => "eg /htdocs",
- "PASV connection off" => "PASV connection off",
- "PASV connection on" => "PASV connection on",
- "ASCII transfer" => "ASCII transfer",
- "Binary transfer" => "Binary transfer",
- "Add" => "Add",
- "Choose" => "Choose",
- "Update" => "Update",
- ],
-
"get-branch" => [],
"headers" =>
diff --git a/lang/persian.php b/lang/persian.php
index a34f9ce..0fe0546 100644
--- a/lang/persian.php
+++ b/lang/persian.php
@@ -146,7 +146,6 @@ $text = [
"Sorry, cannot save" => "متاسفانه نمی توانیم ذخیره کنیم",
"Sorry, cannot replace..." => "متاسفانه نمی نمی توانیم جایگزین کنیم",
"Sorry, cannot change..." => "متاسفانه نمی توانیم دسترسی را تغییر دهیم",
- "Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
"Sorry, cannot delete..." => "متاسفانه نمی توانیم دسترسی ریشه را تغییر دهیم",
"Sorry, cannot delete" => "متاسفانه نمی توانیم تغییر دهیم",
"Sorry, this file..." => "متاسفانه این فایل تغییر دارد و نمی توانیم آن را ذخیره کنیم",
@@ -158,37 +157,6 @@ $text = [
"Saving" => "در حال ذخره",
],
- "ftp-manager" =>
- [
- "Saving FTP sites" => "Saving FTP sites",
- "Cannot update config..." => "Cannot update config file. Please set public write permissions on",
- "and try again" => "and try again",
- "ftp manager" => "ftp manager",
- "Choose existing site" => "Choose existing site",
- "Are you sure..." => "Are you sure you wish to remove this site?",
- "Add new site" => "Add new site",
- "Edit site" => "Edit site",
- "Site base" => "Site base",
- "Host" => "Host",
- "Username" => "Username",
- "Password" => "Password",
- "PASV and mode" => "PASV and mode",
- "Root" => "Root",
- "eg http://yourdomain.com" => "eg http://yourdomain.com",
- "eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
- "eg user123" => "eg user123",
- "eg pass123" => "eg pass123",
- "Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
- "eg /htdocs" => "eg /htdocs",
- "PASV connection off" => "PASV connection off",
- "PASV connection on" => "PASV connection on",
- "ASCII transfer" => "ASCII transfer",
- "Binary transfer" => "Binary transfer",
- "Add" => "Add",
- "Choose" => "Choose",
- "Update" => "Update",
- ],
-
"get-branch" => [],
"headers" =>
diff --git a/lang/portuguese-brazilian.php b/lang/portuguese-brazilian.php
index b0372f0..28d9db0 100644
--- a/lang/portuguese-brazilian.php
+++ b/lang/portuguese-brazilian.php
@@ -146,7 +146,6 @@ $text = [
"Sorry, cannot save" => "Desculpe, não é possível salvar",
"Sorry, cannot replace..." => "Desculpe, não é possível substituir texto em",
"Sorry, cannot change..." => "Desculpe, não é possível mudar permissões para",
- "Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
"Sorry, cannot delete..." => "Desculpe, não é possível excluir nível raiz",
"Sorry, cannot delete" => "Desculpe, não é possível remover",
"Sorry, this file..." => "Desculpe, este arquivo foi modificado, não é possível salvar",
@@ -158,37 +157,6 @@ $text = [
"Saving" => "Salvando",
],
- "ftp-manager" =>
- [
- "Saving FTP sites" => "Saving FTP sites",
- "Cannot update config..." => "Cannot update config file. Please set public write permissions on",
- "and try again" => "and try again",
- "ftp manager" => "ftp manager",
- "Choose existing site" => "Choose existing site",
- "Are you sure..." => "Are you sure you wish to remove this site?",
- "Add new site" => "Add new site",
- "Edit site" => "Edit site",
- "Site base" => "Site base",
- "Host" => "Host",
- "Username" => "Username",
- "Password" => "Password",
- "PASV and mode" => "PASV and mode",
- "Root" => "Root",
- "eg http://yourdomain.com" => "eg http://yourdomain.com",
- "eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
- "eg user123" => "eg user123",
- "eg pass123" => "eg pass123",
- "Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
- "eg /htdocs" => "eg /htdocs",
- "PASV connection off" => "PASV connection off",
- "PASV connection on" => "PASV connection on",
- "ASCII transfer" => "ASCII transfer",
- "Binary transfer" => "Binary transfer",
- "Add" => "Add",
- "Choose" => "Choose",
- "Update" => "Update",
- ],
-
"get-branch" => [],
"headers" =>
diff --git a/lang/spanish.php b/lang/spanish.php
index 9b64745..816eee6 100644
--- a/lang/spanish.php
+++ b/lang/spanish.php
@@ -146,7 +146,6 @@ $text = [
"Sorry, cannot save" => "Lo siento, no puedo guardar",
"Sorry, cannot replace..." => "Lo siento, no puedo reemplazar texto en",
"Sorry, cannot change..." => "Lo siento, no puedo cambiar permisos sobre",
- "Sorry, cannot delete more..." => "Lo siento, no puedo eliminar mas de un item a la vez bajo modo FTP",
"Sorry, cannot delete..." => "Lo siento, no puedo eliminar el nivel raiz",
"Sorry, cannot delete" => "Lo siento, no puedo eliminar",
"Sorry, this file..." => "Lo siento, este archivo ha cambiado, no puedo almacenar",
@@ -158,37 +157,6 @@ $text = [
"Saving" => "Guardando"
],
- "ftp-manager" =>
- [
- "Saving FTP sites" => "Saving FTP sites",
- "Cannot update config..." => "Cannot update config file. Please set public write permissions on",
- "and try again" => "and try again",
- "ftp manager" => "ftp manager",
- "Choose existing site" => "Choose existing site",
- "Are you sure..." => "Are you sure you wish to remove this site?",
- "Add new site" => "Add new site",
- "Edit site" => "Edit site",
- "Site base" => "Site base",
- "Host" => "Host",
- "Username" => "Username",
- "Password" => "Password",
- "PASV and mode" => "PASV and mode",
- "Root" => "Root",
- "eg http://yourdomain.com" => "eg http://yourdomain.com",
- "eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
- "eg user123" => "eg user123",
- "eg pass123" => "eg pass123",
- "Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
- "eg /htdocs" => "eg /htdocs",
- "PASV connection off" => "PASV connection off",
- "PASV connection on" => "PASV connection on",
- "ASCII transfer" => "ASCII transfer",
- "Binary transfer" => "Binary transfer",
- "Add" => "Add",
- "Choose" => "Choose",
- "Update" => "Update",
- ],
-
"get-branch" => [],
"headers" =>
diff --git a/lib/backup-versions.php b/lib/backup-versions.php
index af00d46..d5f8380 100644
--- a/lib/backup-versions.php
+++ b/lib/backup-versions.php
@@ -49,7 +49,7 @@ $dateCounts = $fileCountInfo['dateCounts'];
$displayVersions = $versions;
// Establish the base, host and date dir parts...
-$backupDirHost = isset($ftpSite) ? parse_url($ftpSite, PHP_URL_HOST) : "localhost";
+$backupDirHost = "localhost";
foreach ($dateCounts as $key => $value) {
echo "".date("jS M Y", strtotime($key)) . " (" . $value . " " . ($value !== 1 ? $t["backups"] : $t["backup"]) . ")";
diff --git a/lib/file-control.php b/lib/file-control.php
index 09caa7a..ef24c4e 100644
--- a/lib/file-control.php
+++ b/lib/file-control.php
@@ -4,13 +4,11 @@ require "icecoder.php";
use ICEcoder\ExtraProcesses;
use ICEcoder\Backup;
use ICEcoder\File;
-use ICEcoder\FTP;
use ICEcoder\System;
use ICEcoder\URL;
$backupClass = new Backup;
$fileClass = new File;
-$ftpClass = new FTP;
$systemClass = new System;
$t = $text['file-control'];
@@ -68,14 +66,6 @@ if (false === $error) {
}
$doNext = "";
-// If we're in FTP mode, start a connection and leave open for FTP actions
-if (isset($ftpSite)) {
- $ftpClass->ftpStart();
- // Show user warning if no good connection
- if (!$ftpConn || !$ftpLogin) {
- $doNext .= 'ICEcoder.message("Sorry, no FTP connection to ' . $ftpHost . ' for user ' . $ftpUser . '");';
- }
-}
// =============
// LOADING FILES
@@ -118,8 +108,7 @@ if (!$error && "save" === $_GET['action']) {
"fileURL" => $fileURL,
"fileName" => $fileName,
"fileMDTURLPart" => $fileMDTURLPart,
- "fileVersionURLPart" => $fileVersionURLPart,
- "ftpSite" => true === isset($ftpSite)
+ "fileVersionURLPart" => $fileVersionURLPart
];
$doNext .= $fileClass->handleSaveLooparound($fileDetails, $finalAction, $t);
@@ -134,22 +123,17 @@ if (!$error && "save" === $_GET['action']) {
// FILE IS WRITEABLE
// =================
- if (!$demoMode && (isset($ftpSite) || (file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && "" != $_POST['newFileName'])) {
+ if (!$demoMode && ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && "" != $_POST['newFileName'])) {
- $filemtime = !isset($ftpSite) && "Windows" !== $serverType && file_exists($file) ? filemtime($file) : "1000000";
+ $filemtime = "Windows" !== $serverType && file_exists($file) ? filemtime($file) : "1000000";
// ==================================================
// MDT'S MATCH (OR WE'RE SAVING NEW FILE), WRITE FILE
// ==================================================
if (!(isset($_GET['fileMDT'])) || $filemtime == $_GET['fileMDT'] || isset($_POST['newFileName'])) {
- // FTP Saving
- if (isset($ftpSite)) {
- $ftpClass->writeFile();
- // Local saving
- } else {
- $fileClass->writeFile();
- }
+ // Write file
+ $fileClass->writeFile();
// Save a version controlled backup source of the file
if ($ICEcoder["backupsKept"]) {
@@ -192,20 +176,9 @@ if (!$error && "save" === $_GET['action']) {
// ==========
if (!$error && "newFolder" === $_GET['action']) {
- if (!$demoMode && (isset($ftpSite) || is_writable($docRoot.$fileLoc))) {
- // FTP
- if (isset($ftpSite)) {
- $ftpFilepath = ltrim($fileLoc . "/" . $fileName, "/");
- if (!$ftpClass->ftpMkDir($ftpConn, octdec($ICEcoder['newDirPerms']), $ftpFilepath)) {
- $doNext .= 'ICEcoder.message("Sorry, could not create dir '.$ftpFilepath.' at ' . $ftpHost . '");';
- } else {
- $fileClass->updateFileManager('add', $fileLoc, $fileName, '', '', '', 'folder');
- }
- // Local
- } else {
- mkdir($file, octdec($ICEcoder['newDirPerms']));
- $fileClass->updateFileManager('add', $fileLoc, $fileName, '', '', '', 'folder');
- }
+ if (!$demoMode && is_writable($docRoot . $fileLoc)) {
+ mkdir($file, octdec($ICEcoder['newDirPerms']));
+ $fileClass->updateFileManager('add', $fileLoc, $fileName, '', '', '', 'folder');
$finalAction = "newFolder";
// Run any extra processes
$extraProcessesClass = new ExtraProcesses($fileLoc, $fileName);
@@ -222,39 +195,22 @@ if (!$error && "newFolder" === $_GET['action']) {
// ================
if (!$error && "move" === $_GET['action']) {
- if (isset($ftpSite)) {
- $srcDir = ltrim(str_replace("|", "/", $_GET['oldFileName']), "/");
- $tgtDir = ltrim($fileLoc . "/" . $fileName, "/");
- } else {
- $srcDir = $docRoot . $iceRoot . str_replace("|", "/", $_GET['oldFileName']);
- $tgtDir = $docRoot . $fileLoc . "/" . $fileName;
- }
+ $srcDir = $docRoot . $iceRoot . str_replace("|", "/", $_GET['oldFileName']);
+ $tgtDir = $docRoot . $fileLoc . "/" . $fileName;
if ($srcDir != $tgtDir) {
- if (!$demoMode && (isset($ftpSite) || is_writable($srcDir))) {
- // FTP
- if (isset($ftpSite)) {
- if (!$ftpClass->ftpRename($ftpConn, $srcDir, $tgtDir)) {
- $doNext .= 'ICEcoder.message("Sorry, could not rename ' . $srcDir . ' to ' . $tgtDir . '");';
- } else {
- $ftpFileDirInfo = $ftpClass->ftpGetFileInfo($ftpConn, ltrim($fileLoc, "/"), $fileName);
- $fileOrFolder = "directory" === $ftpFileDirInfo['type'] ? "folder" : "file";
- $fileClass->updateFileManager('move', $fileLoc, $fileName, '', str_replace($iceRoot, "", str_replace("|", "/", $_GET['oldFileName'])), '', $fileOrFolder);
- }
- // Local
+ if (!$demoMode && is_writable($srcDir)) {
+ if(rename($srcDir, $tgtDir)) {
+ // Is a dir or file (needed to create new item in file manager)
+ $fileOrFolder = is_dir($docRoot . $fileLoc . "/" . $fileName) ? "folder" : "file";
+ $fileClass->updateFileManager('move', $fileLoc, $fileName, '', str_replace($iceRoot, "", str_replace("|", "/", $_GET['oldFileName'])), '', $fileOrFolder);
+ $doNext .= 'tabNum = ICEcoder.openFiles.indexOf(\'' . str_replace("|", "/", $_GET['oldFileName']) . '\') + 1; if (0 < tabNum) {ICEcoder.renameTab(tabNum, \'' . $fileLoc . "/" . $fileName . '\');};';
+ $finalAction = "move";
+ // Run any extra processes
+ $extraProcessesClass = new ExtraProcesses($fileLoc, $fileName);
+ $doNext = $extraProcessesClass->onFileDirMove($doNext);
} else {
- if(rename($srcDir, $tgtDir)) {
- // Is a dir or file (needed to create new item in file manager)
- $fileOrFolder = is_dir($docRoot . $fileLoc . "/" . $fileName) ? "folder" : "file";
- $fileClass->updateFileManager('move', $fileLoc, $fileName, '', str_replace($iceRoot, "", str_replace("|", "/", $_GET['oldFileName'])), '', $fileOrFolder);
- $doNext .= 'tabNum = ICEcoder.openFiles.indexOf(\'' . str_replace("|", "/", $_GET['oldFileName']) . '\') + 1; if (0 < tabNum) {ICEcoder.renameTab(tabNum, \'' . $fileLoc . "/" . $fileName . '\');};';
- $finalAction = "move";
- // Run any extra processes
- $extraProcessesClass = new ExtraProcesses($fileLoc, $fileName);
- $doNext = $extraProcessesClass->onFileDirMove($doNext);
- } else {
- $doNext .= "ICEcoder.message('" . $t['Sorry, cannot move'] . "\\\\n" . str_replace("|", "/", $_GET['oldFileName']) . "\\\\n\\\\n" . $t['Maybe public write...'] . "');";
- $finalAction = "nothing";
- }
+ $doNext .= "ICEcoder.message('" . $t['Sorry, cannot move'] . "\\\\n" . str_replace("|", "/", $_GET['oldFileName']) . "\\\\n\\\\n" . $t['Maybe public write...'] . "');";
+ $finalAction = "nothing";
}
} else {
$doNext .= "ICEcoder.message('" . $t['Sorry, cannot move'] . "\\\\n" . str_replace("|", "/", $_GET['oldFileName']) . "\\\\n\\\\n" . $t['Maybe public write...'] . "');";
@@ -272,29 +228,18 @@ if (!$error && "move" === $_GET['action']) {
// ==================
if (!$error && "rename" === $_GET['action']) {
- if (!$demoMode && (isset($ftpSite) || is_writable($docRoot.$iceRoot.str_replace("|", "/", $_GET['oldFileName'])))) {
- // FTP
- if (isset($ftpSite)) {
- $ftpFilepath = ltrim($fileLoc . "/" . $fileName, "/");
- if (!$ftpClass->ftpRename($ftpConn, ltrim($_GET['oldFileName'], "/"), $ftpFilepath)) {
- $doNext .= 'ICEcoder.message("Sorry, could not rename ' . ltrim($_GET['oldFileName'], "/") . ' to ' . $ftpFilepath . '");';
- } else {
- $fileClass->updateFileManager('rename', $fileLoc, $fileName, '', str_replace($iceRoot, "", $_GET['oldFileName']), '', '');
- }
- // Local
+ if (!$demoMode && is_writable($docRoot . $iceRoot . str_replace("|", "/", $_GET['oldFileName']))) {
+ if (true === file_exists($docRoot . $fileLoc)) {
+ rename($docRoot.$iceRoot.str_replace("|", "/", $_GET['oldFileName']), $docRoot . $fileLoc . "/" . $fileName);
+ $fileClass->updateFileManager('rename', $fileLoc, $fileName, '', str_replace($iceRoot, "", $_GET['oldFileName']), '', '');
+ $doNext .= 'tabNum = ICEcoder.openFiles.indexOf(\'' . str_replace("|", "/", $_GET['oldFileName']) . '\') + 1; if (0 < tabNum) {ICEcoder.renameTab(tabNum, \'' . $fileLoc . "/" . $fileName . '\');};';
+ $finalAction = "rename";
+ // Run any extra processes
+ $extraProcessesClass = new ExtraProcesses($fileLoc, $fileName);
+ $doNext = $extraProcessesClass->onFileDirRename($doNext);
} else {
- if (true === file_exists($docRoot . $fileLoc)) {
- rename($docRoot.$iceRoot.str_replace("|", "/", $_GET['oldFileName']), $docRoot . $fileLoc . "/" . $fileName);
- $fileClass->updateFileManager('rename', $fileLoc, $fileName, '', str_replace($iceRoot, "", $_GET['oldFileName']), '', '');
- $doNext .= 'tabNum = ICEcoder.openFiles.indexOf(\'' . str_replace("|", "/", $_GET['oldFileName']) . '\') + 1; if (0 < tabNum) {ICEcoder.renameTab(tabNum, \'' . $fileLoc . "/" . $fileName . '\');};';
- $finalAction = "rename";
- // Run any extra processes
- $extraProcessesClass = new ExtraProcesses($fileLoc, $fileName);
- $doNext = $extraProcessesClass->onFileDirRename($doNext);
- } else {
- $doNext .= "ICEcoder.message('".$t['Sorry, cannot rename'] . "\\\\n" . str_replace("|", "/", $_GET['oldFileName']) . "\\\\n\\\\n" . $t['does not seem...'] . "');";
- $finalAction = "nothing";
- }
+ $doNext .= "ICEcoder.message('".$t['Sorry, cannot rename'] . "\\\\n" . str_replace("|", "/", $_GET['oldFileName']) . "\\\\n\\\\n" . $t['does not seem...'] . "');";
+ $finalAction = "nothing";
}
} else {
$doNext .= "ICEcoder.message('".$t['Sorry, cannot rename'] . "\\\\n" . str_replace("|", "/", $_GET['oldFileName']) . "\\\\n\\\\n" . $t['Maybe public write...'] . "');";
@@ -307,7 +252,7 @@ if (!$error && "rename" === $_GET['action']) {
// PASTE FILE/FOLDER
// =================
-if (!isset($ftpSite) && !$error && "paste" === $_GET['action']) {
+if (!$error && "paste" === $_GET['action']) {
$source = $file;
$dest = str_replace("//", "/", $docRoot . $iceRoot . str_replace("|", "/", $_GET['location']) . "/" . basename($source));
if (!$demoMode && is_writable(dirname($dest))) {
@@ -331,7 +276,7 @@ if (!isset($ftpSite) && !$error && "paste" === $_GET['action']) {
// UPLOAD FILE(S)
// ==============
-if (!isset($ftpSite) && !$error && "upload" === $_GET['action']) {
+if (!$error && "upload" === $_GET['action']) {
if (!$demoMode) {
if ($_FILES['filesInput']){
@@ -358,34 +303,7 @@ if (!isset($ftpSite) && !$error && "upload" === $_GET['action']) {
if (!$error && "delete" === $_GET['action']) {
$filesArray = explode(";", $file); // May contain more than one file here
- // FTP
- if (isset($ftpSite)) {
- if (1 === count($filesArray)) {
- $ftpFileDirInfo = $ftpClass->ftpGetFileInfo($ftpConn, ltrim($fileLoc, "/"), $fileName);
- $itemType = "directory" === $ftpFileDirInfo['type'] ? "dir" : "file";
- $itemPath = ltrim($fileLoc . "/" . $fileName, "/");
- if (!$demoMode && $ftpClass->ftpDelete($ftpConn, $itemType, $itemPath)) {
- if ($fileLoc=="" || "\\" === $fileLoc) {
- $fileLoc = "/";
- };
- // Reload file manager
- $doNext .= 'ICEcoder.selectedFiles = []; ICEcoder.updateFileManagerList(\'delete\', \'' . $fileLoc . '\', \'' . $fileName . '\', false, false, false, \'' . ("dir" === $itemType ? 'folder' : 'file') . '\');';
- $finalAction = "delete";
- // Run any extra processes
- $extraProcessesClass = new ExtraProcesses($fileLoc, $fileName);
- $doNext = $extraProcessesClass->onFileDirDelete($doNext);
- } else {
- $doNext .= "ICEcoder.message('" . $t['Sorry, cannot delete'] . "\\\\n" . $fileLoc . "/" . $fileName . "');";
- $finalAction = "nothing";
- }
- } else {
- $doNext .= "ICEcoder.message('" . $t['Sorry, cannot delete more...'] . "');";
- $finalAction = "nothing";
- }
- // Local
- } else {
- $fileClass->delete();
- }
+ $fileClass->delete();
$doNext .= 'ICEcoder.serverMessage(); ICEcoder.serverQueue("del");';
};
@@ -393,7 +311,7 @@ if (!$error && "delete" === $_GET['action']) {
// REPLACE TEXT IN A FILE
// ======================
-if (!isset($ftpSite) && !$error && "replaceText" === $_GET['action']) {
+if (!$error && "replaceText" === $_GET['action']) {
if (!$demoMode && is_writable($file)) {
$loadedFile = toUTF8noBOM(getData($file), true);
$find = $_GET['find'];
@@ -419,7 +337,7 @@ if (!isset($ftpSite) && !$error && "replaceText" === $_GET['action']) {
// GET CONTENTS OF REMOTE URL
// ==========================
-if (!isset($ftpSite) && !$error && "getRemoteFile" === $_GET['action']) {
+if (!$error && "getRemoteFile" === $_GET['action']) {
$lineNumber = max(isset($_REQUEST['lineNumber']) ? intval($_REQUEST['lineNumber']) : 1, 1);
if ($remoteFile = toUTF8noBOM(getData($file, 'curl'), true)) {
@@ -445,20 +363,9 @@ if (!isset($ftpSite) && !$error && "getRemoteFile" === $_GET['action']) {
// =======================
if (!$error && "perms" === $_GET['action']) {
- if (!$demoMode && (isset($ftpSite) || is_writable($file))) {
- // FTP
- if (isset($ftpSite)) {
- $ftpFilepath = ltrim($fileLoc . "/" . $fileName, "/");
- if (!$ftpClass->ftpPerms($ftpConn, octdec(numClean($_GET['perms'])), $ftpFilepath)) {
- $doNext .= 'ICEcoder.message("Sorry, could not set perms on ' . $ftpFilepath . ' at ' . $ftpHost . '");';
- } else {
- $fileClass->updateFileManager('chmod', $fileLoc, $fileName, numClean($_GET['perms']), '', '', '');
- }
- // Local
- } else {
- chmod($file, octdec(numClean($_GET['perms'])));
- $fileClass->updateFileManager('chmod', $fileLoc, $fileName, numClean($_GET['perms']), '', '', '');
- }
+ if (!$demoMode && is_writable($file)) {
+ chmod($file, octdec(numClean($_GET['perms'])));
+ $fileClass->updateFileManager('chmod', $fileLoc, $fileName, numClean($_GET['perms']), '', '', '');
$finalAction = "perms";
// Run any custom processes
$extraProcessesClass = new ExtraProcesses($fileLoc, $fileName);
@@ -474,7 +381,7 @@ if (!$error && "perms" === $_GET['action']) {
// CHECK FOR A FILE/DIR
// ====================
-if (!isset($ftpSite) && !$error && "checkExists" === $_GET['action']) {
+if (!$error && "checkExists" === $_GET['action']) {
// This action is called under seperate AJAX call and the responseText object stored in ICEcoder.lastFileDirCheckStatusObj
// Nothing really done here though, we do something with the responseText
$finalAction = "checkExists";
diff --git a/lib/ftp-manager.php b/lib/ftp-manager.php
deleted file mode 100644
index 966188a..0000000
--- a/lib/ftp-manager.php
+++ /dev/null
@@ -1,215 +0,0 @@
-parent.parent.ICEcoder.showHide('hide', parent.document.getElementById('blackMask')); parent.parent.ICEcoder.refreshFileManager();";
- } else {
- // Start creating a new chunk for the FTP sites
- $settingsNew = '"ftpSites" => array(
-';
- }
-
- // ======
- // ADDING
- // ======
-
- if ($_GET['action']=="add") {
-
- // Add the new FTP site
- if ($_POST['ftpSiteNEW'] != "") {
- $settingsNew .= ' array(
- "site" => "' . injClean($_POST['ftpSiteNEW']) . '",
- "host" => "' . injClean($_POST['ftpHostNEW']) . '",
- "user" => "' . injClean($_POST['ftpUserNEW']) . '",
- "pass" => "' . injClean($_POST['ftpPassNEW']) . '",
- "pasv" => ' . injClean($_POST['ftpPASVNEW']) . ',
- "mode" => "' . injClean($_POST['ftpModeNEW']) . '",
- "root" => "' . injClean($_POST['ftpRootNEW']) . '"
- ),
-';
- }
-
- }
-
- // ===============================================
- // UPDATING & REMOVING PLUS UPDATE CONFIG SETTINGS
- // ===============================================
-
- if ("choose" !== $_GET['action'] && "edit" !== $_GET['action']) {
-
- // Look at each of the existing FTP sites
- for ($i = 0; $i < count($oldFTPSites); $i++) {
-
- // Updating
- if ("update" === $_GET['action'] && $i == $_GET['ftpSiteRef']) {
- $settingsNew .= ' array(
- "site" => "' . injClean($_POST['ftpSiteNEW']) . '",
- "host" => "' . injClean($_POST['ftpHostNEW']) . '",
- "user" => "' . injClean($_POST['ftpUserNEW']) . '",
- "pass" => "' . injClean($_POST['ftpPassNEW']) . '",
- "pasv" => ' . injClean($_POST['ftpPASVNEW']) . ',
- "mode" => "' . injClean($_POST['ftpModeNEW']) . '",
- "root" => "' . injClean($_POST['ftpRootNEW']) . '"
- ),
-';
- // Deleting
- } elseif ("remove" === $_GET['action'] && $i == $_GET['ftpSiteRef']) {
- // Do nothing, so we ignore this entry now
-
- // Entry is as before
- } else {
- $settingsNew .= ' array(
- "site" => "' . $oldFTPSites[$i]['site'] . '",
- "host" => "' . $oldFTPSites[$i]['host'] . '",
- "user" => "' . $oldFTPSites[$i]['user'] . '",
- "pass" => "' . $oldFTPSites[$i]['pass'] . '",
- "pasv" => ' . ($oldFTPSites[$i]['pasv'] ? 'true' : 'false') . ',
- "mode" => "' . ('FTP_ASCII' === $oldFTPSites[$i]['mode'] ? 'FTP_ASCII' : 'FTP_BINARY') . '",
- "root" => "' . $oldFTPSites[$i]['root'] . '"
- ),
-';
- }
- }
- // Rtrim off the last comma
- $settingsNew = rtrim($settingsNew,',
-');
- $settingsNew .= '
-),' . PHP_EOL;
-
- // Now we have a new settingsNew string to use
- // we can update the FTP sites in the settings file
-
- // Identify the bit to replace
- $repPosStart = strpos($settingsContents, '"ftpSites"');
- $repPosEnd = strpos($settingsContents, '"tutorialOnLogin"');
-
- // Compile our new settings
- $settingsContents = substr($settingsContents, 0, $repPosStart) . $settingsNew . substr($settingsContents, $repPosEnd, strlen($settingsContents));
-
- // Now update the config file
- if (is_writeable("../data/" . $settingsFile)) {
- $fh = fopen("../data/" . $settingsFile, 'w');
- fwrite($fh, $settingsContents);
- fclose($fh);
- // Finally, reload the iFrame screen for the user
- header("Location: ftp-manager.php?updatedFTPSites&csrf=" . $_SESSION["csrf"]);
- echo "";
- die($t['Saving FTP sites']);
- } else {
- echo "";
- }
- }
-}
-?>
-
-
-
-
-ICEcoder FTP manager
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/lib/get-branch.php b/lib/get-branch.php
index 09d8410..60a7dfd 100644
--- a/lib/get-branch.php
+++ b/lib/get-branch.php
@@ -1,10 +1,6 @@
ftpStart();
- // Show user warning if no good connection
- if (!$ftpConn || !$ftpLogin) {
- die('');
- exit;
- }
- // Get our simple and detailed lists and close the FTP connection
- $ftpList = $ftpClass->ftpGetList($ftpConn, $ftpRoot . $location);
- $finalArray = $ftpList['simpleList'];
- $ftpItems = $ftpList['detailedList'];
- $ftpClass->ftpEnd();
-// or get local list
-} else {
- $finalArray = scanDir($scanDir . $location);
-}
+$dirArray = $filesArray = [];
+$finalArray = scanDir($scanDir . $location);
foreach($finalArray as $entry) {
$canAdd = true;
@@ -59,20 +38,14 @@ foreach($finalArray as $entry) {
$canAdd = false;
}
}
- // Only applicable for local dir, ignoring ICEcoder's dir
- if (!isset($ftpSite) && $docRoot . $iceRoot . $location . "/" . $entry === $docRoot . $ICEcoderDir) {
+ // Ignore ICEcoder's dir
+ if ($docRoot . $iceRoot . $location . "/" . $entry === $docRoot . $ICEcoderDir) {
$canAdd = false;
}
if ("." !== $entry && ".." !== $entry && $canAdd) {
- if (!isset($ftpSite)) {
- is_dir($docRoot . $iceRoot . $location . "/".$entry)
+ is_dir($docRoot . $iceRoot . $location . "/".$entry)
? array_push($dirArray, $location . "/" . $entry)
: array_push($filesArray, $location . "/" . $entry);
- } else {
- "directory" === $ftpItems[$entry]['type']
- ? array_push($dirArray, $location . "/" . $entry)
- : array_push($filesArray, $location. "/" . $entry);
- }
}
}
natcasesort($dirArray);
@@ -81,11 +54,7 @@ natcasesort($filesArray);
$finalArray = array_merge($dirArray, $filesArray);
for ($i = 0; $i < count($finalArray); $i++) {
$fileFolderName = str_replace("\\", "/", $finalArray[$i]);
- if (!isset($ftpSite)) {
- $type = is_dir($docRoot . $iceRoot . $fileFolderName) ? "folder" : "file";
- } else {
- $type = "directory" === $ftpItems[basename($fileFolderName)]['type'] ? "folder" : "file";
- }
+ $type = is_dir($docRoot . $iceRoot . $fileFolderName) ? "folder" : "file";
if ("file" === $type) {
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
$ext = "ext-" . pathinfo($docRoot . $iceRoot . $fileFolderName, PATHINFO_EXTENSION);
@@ -113,25 +82,9 @@ for ($i = 0; $i < count($finalArray); $i++) {
(("folder" === $type) ? " parent.ICEcoder.openCloseDir(this,$loadParam);" : "") .
" if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {parent.ICEcoder.openFile()}}\" style=\"position: relative; left:-22px\"> ".xssClean(basename($fileFolderName),"html")." ";
- if (!isset($ftpSite)) {
- $thisPermVal = "Windows" !== $serverType ? intval(substr(sprintf('%o', fileperms($docRoot . $iceRoot . $fileFolderName)), -3)) : 0;
- } else {
- // Work out perms value
- $thisPermVal = 0;
- $r = $ftpItems[basename($fileFolderName)]['rights'];
- // Owner
- $thisPermVal += "r" === substr($r,1,1) ? 400 : 0;
- $thisPermVal += "w" === substr($r,2,1) ? 200 : 0;
- $thisPermVal += "x" === substr($r,3,1) ? 100 : 0;
- // Group
- $thisPermVal += "r" === substr($r,4,1) ? 40 : 0;
- $thisPermVal += "w" === substr($r,5,1) ? 20 : 0;
- $thisPermVal += "x" === substr($r,6,1) ? 10 : 0;
- // Public
- $thisPermVal += "r" === substr($r,7,1) ? 4 : 0;
- $thisPermVal += "w" === substr($r,8,1) ? 2 : 0;
- $thisPermVal += "x" === substr($r,9,1) ? 1 : 0;
- }
+ $thisPermVal = "Windows" !== $serverType
+ ? intval(substr(sprintf('%o', fileperms($docRoot . $iceRoot . $fileFolderName)), -3))
+ : 0;
$permColors = 777 === $thisPermVal ? 'background: #800; color: #eee' : 'color: #888';
echo '';
echo 0 !== $thisPermVal ? $thisPermVal : '';
diff --git a/lib/go-localhost-root.php b/lib/go-localhost-root.php
deleted file mode 100644
index 814d3a8..0000000
--- a/lib/go-localhost-root.php
+++ /dev/null
@@ -1,36 +0,0 @@
- "",'.PHP_EOL.
- substr($settingsContents, ($repPosEnd), strlen($settingsContents));
-
- // Now update the config file
- if (is_writeable("../data/" . $settingsFile)) {
- $fh = fopen("../data/" . $settingsFile, 'w');
- fwrite($fh, $settingsContents);
- fclose($fh);
-
- // Clear any FTP session we may have
- $_SESSION['ftpSiteRef'] = false;
-
- // Now we've reset the root path to localhost root, refresh the file manager to show it
- echo "";
- } else {
- echo "";
- }
- ?>
- intval($_POST['bugFileCheckTimer']) >= 0 ? intval($_POST['bugFileCheckTimer']) : 0,
"bugFileMaxLines" => intval($_POST['bugFileMaxLines']),
"plugins" => $currentSettings['plugins'],
- "ftpSites" => $currentSettings['ftpSites'],
"tutorialOnLogin" => isset($_POST['tutorialOnLogin']),
"previousFiles" => $currentSettings['previousFiles'],
"last10Files" => $currentSettings['last10Files'],
diff --git a/lib/settings.php b/lib/settings.php
index 663ac3c..26a6778 100644
--- a/lib/settings.php
+++ b/lib/settings.php
@@ -188,18 +188,6 @@ if (false === in_array(getUserIP(), $_SESSION['allowedIPs']) && false === in_arr
include(dirname(__FILE__) . "/requirements.php");
};
-// Establish any FTP site to use
-if (true === isset($_SESSION['ftpSiteRef']) && false !== $_SESSION['ftpSiteRef']) {
- $ftpSiteArray = $ICEcoder['ftpSites'][$_SESSION['ftpSiteRef']];
- $ftpSite = $ftpSiteArray['site']; // FTP site domain, eg http://yourdomain.com
- $ftpHost = $ftpSiteArray['host']; // FTP host, eg ftp.yourdomain.com
- $ftpUser = $ftpSiteArray['user']; // FTP username
- $ftpPass = $ftpSiteArray['pass']; // FTP password
- $ftpPasv = $ftpSiteArray['pasv']; // FTP account requires PASV mode?
- $ftpMode = $ftpSiteArray['mode'] == "FTP_ASCII" ? FTP_ASCII : FTP_BINARY; // FTP transfer mode, FTP_ASCII or FTP_BINARY
- $ftpRoot = $ftpSiteArray['root']; // FTP root dir to use as base, eg /htdocs
-}
-
// Save currently opened files in previousFiles and last10Files arrays
include(dirname(__FILE__) . "/settings-save-current-files.php");
diff --git a/lib/template-config-users.php b/lib/template-config-users.php
index 9f48720..bc3dd06 100644
--- a/lib/template-config-users.php
+++ b/lib/template-config-users.php
@@ -1,7 +1,7 @@