top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));top.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" => "'.$_POST['ftpSiteNEW'].'", "host" => "'.$_POST['ftpHostNEW'].'", "user" => "'.$_POST['ftpUserNEW'].'", "pass" => "'.$_POST['ftpPassNEW'].'", "pasv" => '.$_POST['ftpPASVNEW'].', "mode" => "'.$_POST['ftpModeNEW'].'", "root" => "'.$_POST['ftpRootNEW'].'" ), '; } } // =============================================== // UPDATING & REMOVING PLUS UPDATE CONFIG SETTINGS // =============================================== if ($_GET['action']!="choose" && $_GET['action']!="edit") { // Look at each of the existing FTP sites for ($i=0; $i "'.$_POST['ftpHostNEW'].'", "user" => "'.$_POST['ftpUserNEW'].'", "pass" => "'.$_POST['ftpPassNEW'].'", "pasv" => '.$_POST['ftpPASVNEW'].', "mode" => "'.$_POST['ftpModeNEW'].'", "root" => "'.$_POST['ftpRootNEW'].'" ), '; // Deleting } elseif ($_GET['action']=="remove" && $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" => "'.($oldFTPSites[$i]['mode'] == 'FTP_ASCII' ? '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,'"githubLocalPaths"'); // Compile our new settings $settingsContents = substr($settingsContents,0,$repPosStart).$settingsNew.substr($settingsContents,$repPosEnd,strlen($settingsContents)); // Now update the config file if (is_writeable($settingsFile)) { $fh = fopen($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 <?php echo $ICEcoder["versionNo"];?> FTP manager

0) { ?>


'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } ?>
'.$ftpSites[$i]['site'].''.$ftpSites[$i]['host'].'EditDelete
'.$t['Choose'].'
">


" method="POST">
[?] [?]
" style="width: 272px"> " style="width: 272px">
[?] [?]
" style="width: 272px"> " style="width: 272px">
[?] [?]
" style="width: 272px">
">