Moved the Agents into their own repo. Kept the agent.pl just for reference

This commit is contained in:
Frank Harris 2025-09-11 13:27:32 -04:00
parent 22381be29a
commit 8680a02b13
18132 changed files with 0 additions and 2569420 deletions

View file

@ -1,189 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// -------------------------------------------------------------------------
// Check Admin username and password
// Redirect to the login_small page if needed
// -------------------------------------------------------------------------
checkAdminUsernamePassword();
// -------------------------------------------------------------------------
// Send XHTML header
// -------------------------------------------------------------------------
// header("Content-type: application/xhtml+xml; charset=" . __("iso-8859-1"));
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the login screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
if (isset($_POST["input_admin_username"]) == true) { $input_admin_username = htmlEncode2(validateGenericInput($_POST["input_admin_username"])); }
else { $input_admin_username = ""; }
if (isset($_POST["input_admin_password"]) == true) { $input_admin_password = htmlEncode2(validateGenericInput($_POST["input_admin_password"])); }
else { $input_admin_password = ""; }
// -------------------------------------------------------------------------
// Variables
// -------------------------------------------------------------------------
// Title
$title = __("Admin functions");
// Form name, back and forward buttons
$formname = "AdminForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='login';document.forms['" . $formname . "'].submit();";
// Current build number
$application_build_nr = $net2ftp_settings["application_build_nr"];
// Date from and to
$today = date("Y-m-d");
$oneweekago = date("Y-m-d", time() - 3600*24*7);
$datefrom = $oneweekago;
$dateto = $today;
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,264 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// -------------------------------------------------------------------------
// Check Admin username and password
// Redirect to the login_small page if needed
// -------------------------------------------------------------------------
checkAdminUsernamePassword();
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the login screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
if (isset($_POST["input_admin_username"]) == true) { $input_admin_username = htmlEncode2(validateGenericInput($_POST["input_admin_username"])); }
else { $input_admin_username = ""; }
if (isset($_POST["input_admin_password"]) == true) { $input_admin_password = htmlEncode2(validateGenericInput($_POST["input_admin_password"])); }
else { $input_admin_password = ""; }
if (isset($_POST["dbusername2"]) == true) { $dbusername2 = validateUsername($_POST["dbusername2"]); }
else { $dbusername2 = ""; }
if (isset($_POST["dbpassword2"]) == true) { $dbpassword2 = validatePassword($_POST["dbpassword2"]); }
else { $dbpassword2 = ""; }
if (isset($_POST["dbname2"]) == true) { $dbname2 = validateGenericInput($_POST["dbname2"]); }
else { $dbname2 = ""; }
if (isset($_POST["dbserver2"]) == true) { $dbserver2 = validateGenericInput($_POST["dbserver2"]); }
else { $dbserver2 = ""; }
$dbusername2_html = htmlEncode2($dbusername2);
$dbpassword2_html = htmlEncode2($dbpassword2);
$dbname2_html = htmlEncode2($dbname2);
$dbserver2_html = htmlEncode2($dbserver2);
if ($dbserver2 == "") { $dbserver2 = "localhost"; }
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
// Output variable
$net2ftp_output["admin_createtables"][] = "";
// Title
$title = __("Admin functions");
// Form name
$formname = "AdminForm";
// Read the SQL file
$filename = $net2ftp_globals["application_rootdir"] . "/modules/admin_createtables/create_tables.sql");
$handle = fopen($filename, "rb"); // Open the file for reading only
if ($handle == false) { $net2ftp_output["admin_createtables"][] = __("The handle of file %1\$s could not be opened.", $filename); }
clearstatcache(); // for filesize
$sqlquerystring = fread($handle, filesize($filename));
if ($sqlquerystring == false) { $net2ftp_output["admin_createtables"][] = __("The file %1\$s could not be opened.", $filename); }
$result1 = fclose($handle);
if ($result1 == false) { $net2ftp_output["admin_createtables"][] = __("The handle of file %1\$s could not be closed.", $filename); }
// Split the SQL file in individual queries
$sqlquerypieces = explode("\n", $sqlquerystring);
// -------------------------------------------------------------------------
// Variables for screen 1
// -------------------------------------------------------------------------
if ($net2ftp_globals["screen"] == 1) {
// Next screen
$nextscreen = 2;
// Back and forward buttons
$back_onclick = "document.forms['" . $formname . "'].state.value='admin';document.forms['" . $formname . "'].screen.value='1';document.forms['" . $formname . "'].submit();";
$forward_onclick = "document.forms['" . $formname . "'].submit();";
} // end if
// -------------------------------------------------------------------------
// Variables for screen 2
// -------------------------------------------------------------------------
elseif ($net2ftp_globals["screen"] == 2) {
// Next screen
$nextscreen = 1;
// Back and forward buttons
$back_onclick = "document.forms['" . $formname . "'].state.value='admin';document.forms['" . $formname . "'].screen.value='1';document.forms['" . $formname . "'].submit();";
$dbpassword2_length = strlen($dbpassword2);
// ------------------------------------
// Connect
// ------------------------------------
$mydb = mysql_connect($dbserver2, $dbusername2, $dbpassword2);
if ($mydb == false) { $net2ftp_output["admin_createtables"][] = __("The connection to the server <b>%1\$s</b> could not be set up. Please check the database settings you've entered.", $dbserver2_html) . "\n"; }
// ------------------------------------
// Select
// ------------------------------------
if ($mydb != false) {
$mysql_select_db_result = mysql_select_db($dbname2);
if ($mysql_select_db_result == false) { $net2ftp_output["admin_createtables"][] = __("Unable to select the database <b>%1\$s</b>.", $dbserver2_html) . "\n"; }
}
// ------------------------------------
// Query
// ------------------------------------
if ($mydb != false && $mysql_select_db_result != false) {
for ($i=0; $i<sizeof($sqlquerypieces); $i++) {
$mysql_query_results[$i] = mysql_query($sqlquerypieces[$i]);
if ($mysql_query_results[$i] == false) { $net2ftp_output["admin_createtables"][] = __("The SQL query nr <b>%1\$s</b> could not be executed.", $i+1) . "\n"; }
else { $net2ftp_output["admin_createtables"][] = __("The SQL query nr <b>%1\$s</b> was executed successfully.", $i+1) . "\n"; }
}
}
} // end elseif
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,12 +0,0 @@
DROP TABLE IF EXISTS `net2ftp_log_access`;
CREATE TABLE `net2ftp_log_access` (`id` int(10) unsigned NOT NULL auto_increment,`date` date NOT NULL default '0000-00-00',`time` time NOT NULL default '00:00:00',`remote_addr` text NOT NULL,`remote_port` text NOT NULL,`http_user_agent` text NOT NULL,`page` text NOT NULL,`datatransfer` int(10) unsigned default '0',`executiontime` mediumint(8) unsigned default '0',`ftpserver` text NOT NULL,`username` text NOT NULL,`state` text NOT NULL,`state2` text NOT NULL,`screen` text NOT NULL,`directory` text NOT NULL,`entry` text NOT NULL,`http_referer` text NOT NULL,KEY `index1` (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `net2ftp_log_error`;
CREATE TABLE `net2ftp_log_error` (`date` date NOT NULL default '0000-00-00',`time` time NOT NULL default '00:00:00',`ftpserver` text NOT NULL,`username` text NOT NULL,`message` text NOT NULL,`backtrace` text NOT NULL,`state` text NOT NULL,`state2` text NOT NULL,`directory` text NOT NULL,`remote_addr` text NOT NULL,`remote_port` text NOT NULL,`http_user_agent` text NOT NULL,KEY `index1` (`date`,`time`,`ftpserver`(100),`username`(50))) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `net2ftp_log_consumption_ftpserver`;
CREATE TABLE `net2ftp_log_consumption_ftpserver`(`date` date NOT NULL default '0000-00-00',`ftpserver` varchar(255) NOT NULL default '0',`datatransfer` int(10) unsigned default '0',`executiontime` mediumint(8) unsigned default '0',PRIMARY KEY (`date`,`ftpserver`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `net2ftp_log_consumption_ipaddress`;
CREATE TABLE `net2ftp_log_consumption_ipaddress`(`date` date NOT NULL default '0000-00-00',`ipaddress` varchar(15) NOT NULL default '0',`datatransfer` int(10) unsigned default '0',`executiontime` mediumint(8) unsigned default '0',PRIMARY KEY (`date`,`ipaddress`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `net2ftp_users`;
CREATE TABLE `net2ftp_users` (`ftpserver` varchar(255) NOT NULL default '0',`username` text NOT NULL,`homedirectory` text NOT NULL,KEY `index1` (`ftpserver`,`username`(50))) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `net2ftp_log_status`;
CREATE TABLE `net2ftp_log_status` (`month` varchar(6) NOT NULL, `status` int(3) NOT NULL, `changelog` text NOT NULL, PRIMARY KEY (`month`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View file

@ -1,207 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// -------------------------------------------------------------------------
// Check Admin username and password
// Redirect to the login_small page if needed
// -------------------------------------------------------------------------
checkAdminUsernamePassword();
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the login screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
if (isset($_POST["input_admin_username"]) == true) { $input_admin_username = htmlEncode2(validateGenericInput($_POST["input_admin_username"])); }
else { $input_admin_username = ""; }
if (isset($_POST["input_admin_password"]) == true) { $input_admin_password = htmlEncode2(validateGenericInput($_POST["input_admin_password"])); }
else { $input_admin_password = ""; }
if (isset($_POST["datefrom"]) == true) { $datefrom = addslashes(validateGenericInput($_POST["datefrom"])); }
else { $datefrom = ""; }
if (isset($_POST["dateto"]) == true) { $dateto = addslashes(validateGenericInput($_POST["dateto"])); }
else { $dateto = ""; }
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
// Output variable
$net2ftp_output["admin_emptylogs"][] = "";
// Title
$title = __("Admin functions");
// Form name, back and forward buttons
$formname = "AdminForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='admin';document.forms['" . $formname . "'].submit();";
$forward_onclick = "document.forms['" . $formname . "'].submit();";
// -------------------------------------------------------------------------
// Variables for screen 1
// -------------------------------------------------------------------------
// ------------------------------------
// Input checks
// ------------------------------------
// Add slashes to variables which are used in a SQL query, and which are
// potentially unsafe (supplied by the user).
$datefrom = addslashes($datefrom);
$dateto = addslashes($dateto);
if ($datefrom == "" || $datefrom == 0) { return false; }
if ($dateto == "" || $dateto == 0) { return false; }
// ------------------------------------
// Delete empty logs
// ------------------------------------
emptyLogs($datefrom, $dateto);
if (isset($net2ftp_output["emptyLogs"]) == true) {
$net2ftp_output["admin_emptylogs"] = $net2ftp_output["admin_emptylogs"] + $net2ftp_output["emptyLogs"];
}
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,303 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// -------------------------------------------------------------------------
// Check Admin username and password
// Redirect to the login_small page if needed
// -------------------------------------------------------------------------
checkAdminUsernamePassword();
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the login screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
if (isset($_POST["input_admin_username"]) == true) { $input_admin_username = htmlEncode2(validateGenericInput($_POST["input_admin_username"])); }
else { $input_admin_username = ""; }
if (isset($_POST["input_admin_password"]) == true) { $input_admin_password = htmlEncode2(validateGenericInput($_POST["input_admin_password"])); }
else { $input_admin_password = ""; }
if (isset($_POST["datefrom"]) == true) { $datefrom = addslashes(validateGenericInput($_POST["datefrom"])); }
else { $datefrom = ""; }
if (isset($_POST["dateto"]) == true) { $dateto = addslashes(validateGenericInput($_POST["dateto"])); }
else { $dateto = ""; }
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
// Output variable
$net2ftp_output["admin_viewlogs"][] = "";
// Title
$title = __("Admin functions");
// Form name, back and forward buttons
$formname = "AdminForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='admin';document.forms['" . $formname . "'].submit();";
$forward_onclick = "document.forms['" . $formname . "'].submit();";
// -------------------------------------------------------------------------
// Variables for screen 1
// -------------------------------------------------------------------------
// ------------------------------------
// Connect to the database
// ------------------------------------
$mydb = connect2db();
if ($net2ftp_result["success"] == false) { return false; }
// ------------------------------------
// Execute the SQL query and print the data
// ------------------------------------
// Query 1
$sqlquery1 = "SELECT * FROM net2ftp_log_access WHERE date BETWEEN '$datefrom' AND '$dateto' ORDER BY date DESC, time DESC;";
$table1 = printTable($sqlquery1);
if ($net2ftp_result["success"] == false) { return false; }
// Query 2
$sqlquery2 = "SELECT * FROM net2ftp_log_error WHERE date BETWEEN '$datefrom' AND '$dateto' ORDER BY date DESC, time DESC;";
$table2 = printTable($sqlquery2);
if ($net2ftp_result["success"] == false) { return false; }
// Query 3
$sqlquery3 = "SELECT * FROM net2ftp_log_consumption_ftpserver WHERE date BETWEEN '$datefrom' AND '$dateto' ORDER BY datatransfer DESC, date DESC;";
$table3 = printTable($sqlquery3);
if ($net2ftp_result["success"] == false) { return false; }
// Query 4
$sqlquery4 = "SELECT * FROM net2ftp_log_consumption_ipaddress WHERE date BETWEEN '$datefrom' AND '$dateto' ORDER BY datatransfer DESC, date DESC;";
$table4 = printTable($sqlquery4);
if ($net2ftp_result["success"] == false) { return false; }
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function printTable($sqlquery) {
// --------------
// This function executes the SQL query and prints a nice HTML table with the results
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
// -------------------------------------------------------------------------
// Execute the SQL query
// -------------------------------------------------------------------------
$result = mysql_query("$sqlquery");
if ($result == false) {
$errormessage = __("Unable to execute the SQL query <b>%1\$s</b>.", $sqlquery);
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
$nrofrows = mysql_num_rows($result);
$nrofcolumns_withindex = mysql_num_fields($result) + 1;
// -------------------------------------------------------------------------
// Print the table
// -------------------------------------------------------------------------
// Table begin
$output = "<table border=\"1\">\n";
// First row: SQL query
$output .= "<tr><td colspan=\"$nrofcolumns_withindex\" class=\"tdheader1\" style=\"font-size: 120%;\">$sqlquery</td></tr>\n";
if ($nrofrows != 0) {
// Second row: header
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$output .= "<tr>\n";
$output .= "<td>Index</td>\n";
while(list($fieldname, $fieldvalue) = each($row) ) { $output .= "<td>$fieldname</td>\n"; }
$output .= "</tr>\n";
mysql_data_seek($result, 0); // reset row pointer to the first row
// 3rd and next rows: data
$rowcounter = 1;
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$output .= "<tr>\n";
$output .= "<td>$rowcounter</td>\n";
while(list($fieldname, $fieldvalue) = each($row) ) { $output .= "<td>" . htmlEncode2($fieldvalue) . "</td>\n"; }
$output .= "</tr>\n";
$rowcounter++;
}
}
// If there is no data
else {
$output .= "<tr><td colspan=\"$nrofcolumns_withindex\">" . __("No data") . "</td></tr>";
}
// Table end
$output .= "</table>\n";
// -------------------------------------------------------------------------
// Free the $result
// -------------------------------------------------------------------------
mysql_free_result($result);
return $output;
} // End printTable
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,168 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the login screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
// -------------------------------------------------------------------------
// Variables
// -------------------------------------------------------------------------
if ($net2ftp_globals["screen"] == 1) {
// Title
$title = __("Advanced functions");
// Form name, back and forward buttons
$formname = "AdvancedForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
} // end if
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,257 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the login screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
if (isset($_POST["troubleshoot_ftpserver"]) == true) { $troubleshoot_ftpserver = validateFtpserver($_POST["troubleshoot_ftpserver"]); }
else { $troubleshoot_ftpserver = ""; }
if (isset($_POST["troubleshoot_ftpserverport"]) == true) { $troubleshoot_ftpserverport = validateFtpserverport($_POST["troubleshoot_ftpserverport"]); }
else { $troubleshoot_ftpserverport = ""; }
if (isset($_POST["troubleshoot_username"]) == true) { $troubleshoot_username = validateUsername($_POST["troubleshoot_username"]); }
else { $troubleshoot_username = ""; }
if (isset($_POST["troubleshoot_password"]) == true) { $troubleshoot_password = validatePassword($_POST["troubleshoot_password"]); }
else { $troubleshoot_password = ""; }
if (isset($_POST["troubleshoot_directory"]) == true) { $troubleshoot_directory = validateDirectory($_POST["troubleshoot_directory"]); }
else { $troubleshoot_directory = "/"; }
if (isset($_POST["troubleshoot_passivemode"]) == true) { $troubleshoot_passivemode = validatePassivemode($_POST["troubleshoot_passivemode"]); }
else { $troubleshoot_passivemode = ""; }
$troubleshoot_ftpserver_html = htmlEncode2($troubleshoot_ftpserver);
$troubleshoot_ftpserverport_html = htmlEncode2($troubleshoot_ftpserverport);
$troubleshoot_username_html = htmlEncode2($troubleshoot_username);
$troubleshoot_directory_html = htmlEncode2($troubleshoot_directory);
$troubleshoot_passivemode_html = htmlEncode2($troubleshoot_passivemode);
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
// Title
$title = __("Troubleshoot an FTP server");
// Form name
$formname = "AdvancedForm";
// -------------------------------------------------------------------------
// Variables for screen 1
// -------------------------------------------------------------------------
if ($net2ftp_globals["screen"] == 1) {
// Next screen
$nextscreen = 2;
// Back and forward buttons
$back_onclick = "document.forms['" . $formname . "'].state.value='advanced';document.forms['" . $formname . "'].screen.value='1';document.forms['" . $formname . "'].submit();";
$forward_onclick = "document.forms['" . $formname . "'].submit();";
} // end if
// -------------------------------------------------------------------------
// Variables for screen 2
// -------------------------------------------------------------------------
elseif ($net2ftp_globals["screen"] == 2) {
// Back and forward buttons
$back_onclick = "document.forms['" . $formname . "'].state.value='advanced_ftpserver'; document.forms['" . $formname . "'].submit();";
// Initial checks
if ($troubleshoot_passivemode != "yes") { $troubleshoot_passivemode = "no"; }
// Connect
setStatus(1, 10, __("Connecting to the FTP server"));
$conn_id = ftp_connect("$troubleshoot_ftpserver", $troubleshoot_ftpserverport);
// Login with username and password
setStatus(2, 10, __("Logging into the FTP server"));
$ftp_login_result = ftp_login($conn_id, $troubleshoot_username, $troubleshoot_password);
// Passive mode
if ($troubleshoot_passivemode == "yes") {
setStatus(3, 10, __("Setting the passive mode"));
$ftp_pasv_result = ftp_pasv($conn_id, TRUE);
}
else {
$ftp_pasv_result = true;
}
// Get the FTP system type
setStatus(4, 10, __("Getting the FTP system type"));
$ftp_systype_result = ftp_systype($conn_id);
// Change the directory
setStatus(5, 10, __("Changing the directory"));
$ftp_chdir_result = ftp_chdir($conn_id, $troubleshoot_directory);
// Get the current directory from the FTP server
setStatus(6, 10, __("Getting the current directory"));
$ftp_pwd_result = ftp_pwd($conn_id);
// Try to get a raw list
setStatus(7, 10, __("Getting the list of directories and files"));
$ftp_rawlist_result = ftp_rawlist($conn_id, "-a");
if (sizeof($ftp_rawlist_result) <= 1) {
$ftp_rawlist_result = ftp_rawlist($conn_id, "");
}
// Parse the list
setStatus(8, 10, __("Parsing the list of directories and files"));
for($i=0; $i<sizeof($ftp_rawlist_result); $i++) {
$parsedlist[$i] = ftp_scanline($troubleshoot_directory, $ftp_rawlist_result[$i]);
} // end for
// Quiting; ftp_quit doesn't return a value
setStatus(9, 10, __("Logging out of the FTP server"));
ftp_quit($conn_id);
} // end if
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
setStatus(10, 10, __("Printing the result"));
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,203 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/advanced_parsing/advanced_parsing.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the chmod screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
// Title
$title = __("Test the net2ftp list parsing rules");
// Form name, back and forward buttons
$formname = "AdvancedParsingForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='advanced';document.forms['" . $formname . "'].screen.value='1';document.forms['" . $formname . "'].submit();";
// Initialize output variable
$net2ftp_output["advanced_parsing"] = array();
// -------------------------------------------------------------------------
// Open the file with the samples
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_rootdir"] . "/modules/advanced_parsing/list_samples.inc.php");
// -------------------------------------------------------------------------
// For each sample
// -------------------------------------------------------------------------
while(list($sampleName, $sampleLines) = each($list_samples)) {
$net2ftp_output["advanced_parsing"][] = "<span style=\"font-size: 120%; font-weight: bold;\">" . $sampleName . "</span><br />\n";
// ------------------------------------
// Input
// ------------------------------------
$net2ftp_output["advanced_parsing"][] = "<span style=\"text-decoration: underline;\">Sample input</span>:<br />\n";
for ($i=1; $i<=sizeof($sampleLines); $i++) {
$net2ftp_output["advanced_parsing"][] = "Line $i: " . htmlEncode2($sampleLines[$i]) . "<br />\n";
}
$net2ftp_output["advanced_parsing"][] = "<br />\n";
// ------------------------------------
// Output
// ------------------------------------
$net2ftp_output["advanced_parsing"][] = "<span style=\"text-decoration: underline;\">Parsed output</span>:<br />\n";
for ($i=1; $i<=sizeof($sampleLines); $i++) {
// Scan the sample
$outputArray = ftp_scanline("", $sampleLines[$i]);
while(list($fieldName, $fieldValue) = each($outputArray)) {
$net2ftp_output["advanced_parsing"][] = "Line $i: " . $fieldName . ": " . htmlEncode2($fieldValue) . "<br />\n";
} // end while
$net2ftp_output["advanced_parsing"][] = "<br />\n";
}
$net2ftp_output["advanced_parsing"][] = "<br /><br />\n";
}
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,95 +0,0 @@
<?php
// Samples of FTP LIST responses.
// Some samples are from FileZilla source code, file FtpListResult.cpp
// License: GPL
// Some samples are from http://cr.yp.to/ftpparse/ftpparse.c
// By D. J. Bernstein, djb@cr.yp.to http://cr.yp.to/ftpparse.html
// License: Commercial use is fine, if you let me know what programs you're using this in.
// Some samples are provided by net2ftp users to the net2ftp development team
// License: GPL
$list_samples["UNIX-style listing, without inum and without blocks"][1] = "-rw-r--r-- 1 root other 531 Jan 29 03:26 README";
$list_samples["UNIX-style listing, without inum and without blocks"][2] = "dr-xr-xr-x 2 root other 512 Apr 8 1994 etc";
$list_samples["UNIX-style listing, without inum and without blocks"][3] = "dr-xr-xr-x 2 root 512 Apr 8 1994 etc2";
$list_samples["UNIX-style listing, without inum and without blocks"][4] = "lrwxrwxrwx 1 root other 7 Jan 25 00:17 bin -> usr/bin";
$list_samples["Some listings with uncommon date/time format"][1] = "-rw-r--r-- 1 root other 531 09-26 2000 README2";
$list_samples["Some listings with uncommon date/time format"][2] = "-rw-r--r-- 1 root other 531 09-26 13:45 README3";
$list_samples["Some listings with uncommon date/time format"][3] = "-rw-r--r-- 1 root other 531 2005-06-07 21:22 README4";
$list_samples["Also produced by Microsoft's FTP servers for Windows"][1] = "---------- 1 owner group 1803128 Jul 10 10:18 ls-lR.Z";
$list_samples["Also produced by Microsoft's FTP servers for Windows"][2] = "d--------- 1 owner group 0 May 9 19:45 Softlib";
$list_samples["Also WFTPD for MSDOS"][1] = "-rwxrwxrwx 1 noone nogroup 322 Aug 19 1996 message.ftp";
$list_samples["Also NetWare"][1] = "d [R----F--] supervisor 512 Jan 16 18:53 login";
$list_samples["Also NetWare"][2] = "- [R----F--] rhesus 214059 Oct 20 15:27 cx.exe";
$list_samples["Also NetPresenz for the Mac"][1] = "-------r-- 326 1391972 1392298 Nov 22 1995 MegaPhone.sit";
$list_samples["Also NetPresenz for the Mac"][2] = "drwxrwxr-x folder 2 May 10 1996 network";
$list_samples["MSDOS format"][1] = "04-27-00 09:09PM <DIR> licensed";
$list_samples["MSDOS format"][2] = "07-18-00 10:16AM <DIR> pub";
$list_samples["MSDOS format"][3] = "04-14-00 03:47PM 589 readme.htm";
$list_samples["Some other formats some windows servers send"][1] = "-rw-r--r-- 1 root 531 Jan 29 03:26 README5";
$list_samples["Some other formats some windows servers send"][2] = "-rw-r--r-- 1 group domain user 531 Jan 29 03:26 README6";
$list_samples["EPLF directory listings"][1] = "+i8388621.48594,m825718503,r,s280,\teplf test 1.file";
$list_samples["EPLF directory listings"][2] = "+i8388621.50690,m824255907,/,\teplf test 2.dir";
$list_samples["EPLF directory listings"][3] = "+i8388621.48598,m824253270,r,s612,\teplf test 3.file";
$list_samples["MSDOS type listing used by IIS"][1] = "04-27-00 12:09PM <DIR> DOS dir 1";
$list_samples["MSDOS type listing used by IIS"][2] = "04-14-00 03:47PM 589 DOS file 1";
$list_samples["Another type of MSDOS style listings"][1] = "2002-09-02 18:48 <DIR> DOS dir 2";
$list_samples["Another type of MSDOS style listings"][2] = "2002-09-02 19:06 9,730 DOS file 2";
$list_samples["Numerical Unix style format"][1] = "0100644 500 101 12345 123456789 filename";
$list_samples["This one is used by SSH-2.0-VShell_2_1_2_143, this is the old VShell format"][1] = "206876 Apr 04, 2000 21:06 VShell (old)";
$list_samples["This one is used by SSH-2.0-VShell_2_1_2_143, this is the old VShell format"][2] = "0 Dec 12, 2002 02:13 VShell (old) Dir/";
$list_samples["This type of directory listings is sent by some newer versions of VShell both year and time in one line is uncommon."][1] = "-rwxr-xr-x 1 user group 9 Oct 08, 2002 09:47 VShell (new)";
$list_samples["Next ones come from an OS/2 server. The server obviously isn't Y2K aware"][1] = "36611 A 04-23-103 10:57 OS2 test1.file";
$list_samples["Next ones come from an OS/2 server. The server obviously isn't Y2K aware"][2] = " 1123 A 07-14-99 12:37 OS2 test2.file";
$list_samples["Next ones come from an OS/2 server. The server obviously isn't Y2K aware"][3] = " 0 DIR 02-11-103 16:15 OS2 test1.dir";
$list_samples["Next ones come from an OS/2 server. The server obviously isn't Y2K aware"][4] = " 1123 DIR A 10-05-100 23:38 OS2 test2.dir";
$list_samples["Some servers send localized date formats, here the German one"][1] = "dr-xr-xr-x 2 root other 2235 26. Juli, 20:10 datetest1 (ger)";
$list_samples["Some servers send localized date formats, here the German one"][2] = "-r-xr-xr-x 2 root other 2235 2. Okt. 2003 datetest2 (ger)";
$list_samples["Some servers send localized date formats, here the German one"][3] = "-r-xr-xr-x 2 root other 2235 1999/10/12 17:12 datetest3";
$list_samples["Some servers send localized date formats, here the German one"][4] = "-r-xr-xr-x 2 root other 2235 24-04-2003 17:12 datetest4";
$list_samples["Here a Japanese one"][1] = "-rw-r--r-- 1 root sys 8473 4\x8c\x8e 18\x93\xfa 2003\x94\x4e datatest1 (jap)";
$list_samples["VMS style listings"][1] = "vms_dir_1.DIR;1 1 19-NOV-2001 21:41 [root,root] (RWE,RWE,RE,RE)";
$list_samples["VMS style listings"][2] = "vms_file_3;1 155 2-JUL-2003 10:30:13.64";
$list_samples["VMS style listings without time"][1] = "vms_file_4;1 2/8 15-JAN-2000 [IV2_XXX] (RWED,RWED,RE,)";
$list_samples["VMS style listings without time"][2] = "vms_file_5;1 6/8 15-JUI-2002 PRONAS (RWED,RWED,RE,)";
$list_samples["VMS multiline"][1] = "VMS_file_1;1\r\n170774/170775 24-APR-2003 08:16:15 [FTP_CLIENT,SCOT] (RWED,RWED,RE,)";
$list_samples["VMS multiline"][2] = "VMS_file_2;1\r\n10 2-JUL-2003 10:30:08.59 [FTP_CLIENT,SCOT] (RWED,RWED,RE,)";
$list_samples["IBM AS/400 style listing"][1] = "QSYS 77824 02/23/00 15:09:55 *DIR IBM AS/400 Dir1/";
$list_samples["IBM AS/400 style listing"][2] = "QSYS 77824 23/02/00 15:09:55 *FILE IBM AS/400 File1 strangedate";
$list_samples["aligned directory listing with too long size"][1] = "-r-xr-xr-x longowner longgroup123456 Feb 12 17:20 long size test1";
$list_samples["short directory listing with month name"][1] = "-r-xr-xr-x 2 owner group 4512 01-jun-99 shortdate with monthname";
$list_samples["the following format is sent by the Connect:Enterprise server by Sterling Commerce"][1] = "-C--E-----FTP B BCC3I1 7670 1294495 Jan 13 07:42 ConEnt file";
$list_samples["the following format is sent by the Connect:Enterprise server by Sterling Commerce"][2] = "-C--E-----FTS B BCC3I1 7670 1294495 Jan 13 07:42 ConEnt file2";
$list_samples["the following format is sent by the Connect:Enterprise server by Sterling Commerce"][3] = "-AR--M----TCP B ceunix 17570 2313708 Mar 29 08:56 ALL_SHORT1.zip";
$list_samples["Nortel wfFtp router"][1] = "nortel.wfFtp 1014196 06/03/04 Thur. 10:20:03";
$list_samples["VxWorks based server used in Nortel routers"][1] = "2048 Feb-28-1998 05:23:30 nortel.VwWorks dir <DIR>";
?>

View file

@ -1,257 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the login screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
// ----------------------------------------------
// Settings for the test FTP server: ftp.belnet.be
// ----------------------------------------------
$troubleshoot_ftpserver = "ftp.belnet.be";
$troubleshoot_ftpserverport = 21;
$troubleshoot_username = "anonymous";
$troubleshoot_password = "test@net2ftp.com";
$troubleshoot_passivemode = "yes";
$troubleshoot_directory = "/";
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
// Title
$title = __("Troubleshoot your net2ftp installation");
// Form name
$formname = "AdvancedForm";
// -------------------------------------------------------------------------
// Variables for screen 1
// -------------------------------------------------------------------------
// ----------------------------------------------
// Back and forward buttons
// ----------------------------------------------
$back_onclick = "document.forms['" . $formname . "'].state.value='advanced';document.forms['" . $formname . "'].screen.value='1';document.forms['" . $formname . "'].submit();";
$forward_onclick = "document.forms['" . $formname . "'].submit();";
// ----------------------------------------------
// Check if the FTP functions are availabe
// ----------------------------------------------
// See the template file
// ----------------------------------------------
// Check if the /net2ftp/temp folder has been chmodded to 777
// ----------------------------------------------
$tempfilename = @tempnam($net2ftp_globals["application_tempdir"], "net2ftp-test") . ".txt";
$handle = @fopen($tempfilename, "wb");
$string = "This is a test file generated net2ftp, which should have been deleted automatically. The function responsible for this is troubleshoot_webserver(). You can safely delete this file.";
$success1 = @fwrite($handle, $string);
$success2 = @fclose($handle);
$success3 = @unlink($tempfilename);
// ----------------------------------------------
// Connect to an FTP server
// ----------------------------------------------
if (function_exists("ftp_connect") == true) {
// Connect
setStatus(1, 10, __("Connecting to the FTP server"));
$conn_id = ftp_connect("$troubleshoot_ftpserver", $troubleshoot_ftpserverport);
// Login with username and password
setStatus(2, 10, __("Logging into the FTP server"));
$ftp_login_result = ftp_login($conn_id, $troubleshoot_username, $troubleshoot_password);
// Passive mode
if ($troubleshoot_passivemode == "yes") {
setStatus(3, 10, __("Setting the passive mode"));
$ftp_pasv_result = ftp_pasv($conn_id, TRUE);
}
else {
$ftp_pasv_result = true;
}
// Get the FTP system type
setStatus(4, 10, __("Getting the FTP system type"));
$ftp_systype_result = htmlEncode2(ftp_systype($conn_id));
// Change the directory
setStatus(5, 10, __("Changing the directory"));
$ftp_chdir_result = ftp_chdir($conn_id, $troubleshoot_directory);
// Get the current directory from the FTP server
setStatus(6, 10, __("Getting the current directory"));
$ftp_pwd_result = ftp_pwd($conn_id);
// Try to get a raw list
setStatus(7, 10, __("Getting the list of directories and files"));
$ftp_rawlist_result = ftp_rawlist($conn_id, "-a");
if (sizeof($ftp_rawlist_result) <= 1) {
$ftp_rawlist_result = ftp_rawlist($conn_id, "");
}
// Parse the list
setStatus(8, 10, __("Parsing the list of directories and files"));
for($i=0; $i<sizeof($ftp_rawlist_result); $i++) {
$parsedlist[$i] = ftp_scanline($troubleshoot_directory, $ftp_rawlist_result[$i]);
} // end for
// Quiting; ftp_quit doesn't return a value
setStatus(9, 10, __("Logging out of the FTP server"));
ftp_quit($conn_id);
} // end if
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
setStatus(10, 10, __("Printing the result"));
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,181 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the login screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
// url
if (isset($_POST["url_withpw"]) == true) {
// Do not urlEncode2() this variable, it's already encoded in printPHP_SELF()
$url_withpw = $_POST["url_withpw"];
$url_withoutpw = $_POST["url_withoutpw"];
}
else {
$url = "";
}
// text
if (isset($_POST["text"]) == true) { $text = validateGenericInput($_POST["text"]); }
else { $text = ""; }
// -------------------------------------------------------------------------
// Variables
// -------------------------------------------------------------------------
if ($net2ftp_globals["screen"] == 1) {
// Title
$title = __("Bookmark");
// Form name, back and forward buttons
$formname = "BookmarkForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
} // end if
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,569 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
global $net2ftp_globals;
$cookie_expire = time()+60*60*24*30; // 30 days
setcookie("net2ftpcookie_ftpserver", $net2ftp_globals["ftpserver"], $cookie_expire);
setcookie("net2ftpcookie_ftpserverport", $net2ftp_globals["ftpserverport"], $cookie_expire);
setcookie("net2ftpcookie_username", $net2ftp_globals["username"], $cookie_expire);
setcookie("net2ftpcookie_language", $net2ftp_globals["language"], $cookie_expire);
setcookie("net2ftpcookie_skin", $net2ftp_globals["skin"], $cookie_expire);
setcookie("net2ftpcookie_ftpmode", $net2ftp_globals["ftpmode"], $cookie_expire);
setcookie("net2ftpcookie_passivemode", $net2ftp_globals["passivemode"], $cookie_expire);
setcookie("net2ftpcookie_protocol", $net2ftp_globals["protocol"], $cookie_expire);
setcookie("net2ftpcookie_viewmode", $net2ftp_globals["viewmode"], $cookie_expire);
setcookie("net2ftpcookie_sort", $net2ftp_globals["sort"], $cookie_expire);
setcookie("net2ftpcookie_sortorder", $net2ftp_globals["sortorder"], $cookie_expire);
setcookie("net2ftpcookie_directory", $net2ftp_globals["directory"], $cookie_expire);
} // end function net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// -------------------------------------------------------------------------
// Do not print anything for Mobile skins
// -------------------------------------------------------------------------
if ($net2ftp_globals["skin"] == "mobile" || $net2ftp_globals["skin"] == "iphone") {
echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/browse/browse_main_mobile.js\"></script>\n";
}
// -------------------------------------------------------------------------
// For the other skins, do print more Javascript functions
// -------------------------------------------------------------------------
else {
// ------------------------------------
// Code
// ------------------------------------
echo "<script type=\"text/javascript\"><!--\n";
echo "function createDirectoryTreeWindow(directory, FormAndFieldName) {\n";
echo " directoryTreeWindow = window.open(\"\",\"directoryTreeWindow\",\"height=450,width=300,resizable=yes,scrollbars=yes\");\n";
echo " var d = directoryTreeWindow.document;\n";
echo " d.writeln('<html>');\n";
echo " d.writeln('<head>');\n";
echo " d.writeln('<title>" . __("Choose a directory") . "<\/title>');\n";
echo " d.writeln('<\/head>');\n";
echo " d.writeln('<bo' + 'dy on' + 'load=\"document.DirectoryTreeForm.submit();\">');\n";
// echo " d.writeln('<body>');\n";
echo " d.writeln('" . __("Please wait...") . "<br /><br />');\n";
echo " d.writeln('<form name=\"DirectoryTreeForm\" id=\"DirectoryTreeForm\" action=\"" . printPHP_SELF("createDirectoryTreeWindow") . "\" method=\"post\" />');\n";
printLoginInfo_javascript();
echo " d.writeln('<input type=\"hidden\" name=\"state\" value=\"browse\" />');\n";
echo " d.writeln('<input type=\"hidden\" name=\"state2\" value=\"popup\" />');\n";
echo " d.writeln('<input type=\"hidden\" name=\"directory\" value=\"' + directory + '\" />');\n";
echo " d.writeln('<input type=\"hidden\" name=\"FormAndFieldName\" value=\"' + FormAndFieldName + '\" />');\n";
echo " d.writeln('<\/form>');\n";
echo " d.writeln('<\/div>');\n";
echo " d.writeln('<\/body>');\n";
echo " d.writeln('<\/html>');\n";
echo " d.close();\n";
echo "} // end function createDirectoryTreeWindow\n";
echo "//--></script>\n";
// ------------------------------------
// Include
// ------------------------------------
if ($net2ftp_globals["state2"] == "main") {
echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/browse/browse_main.js.php?skin=" . $net2ftp_globals["skin"] . "\"></script>\n";
}
if ($net2ftp_globals["state2"] == "popup") {
echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/browse/browse_popup.js\"></script>\n";
}
}
} // end function net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
// -------------------------------------------------------------------------
// Do not print anything for Mobile skins
// -------------------------------------------------------------------------
if ($net2ftp_globals["skin"] == "mobile" || $net2ftp_globals["skin"] == "iphone") {
}
// -------------------------------------------------------------------------
// For the other skins, do print more Javascript functions
// -------------------------------------------------------------------------
else {
}
} // end function net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end function net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the browse screen ($state2=="main") or the directory popup screen ($state2=="popup")
// For the browse screen ($state2=="main"), 2 template files are called
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// -------------------------------------------------------------------------
// Check if the directory name contains \' and if it does, print an error message
// Note: these directories cannot be browsed, but can be deleted
// -------------------------------------------------------------------------
// if (strstr($directory, "\'") != false) {
// $errormessage = __("Directories with names containing \' cannot be displayed correctly. They can only be deleted. Please go back and select another subdirectory.");
// setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
// return false;
// }
// -------------------------------------------------------------------------
// Variables
// With status update if $state2=="main"
// -------------------------------------------------------------------------
// ------------------------------------
// Open connection
// ------------------------------------
if ($net2ftp_globals["state2"] == "main") { setStatus(2, 10, __("Connecting to the FTP server")); }
$conn_id = ftp_openconnection();
if ($net2ftp_result["success"] == false) { return false; }
// ------------------------------------
// Get raw list of directories and files; parse the raw list and return a nice list
// This function may change the current $directory; a warning message is returned in that case
// ------------------------------------
if ($net2ftp_globals["state2"] == "main") { setStatus(4, 10, __("Getting the list of directories and files")); }
$list = ftp_getlist($conn_id, $net2ftp_globals["directory"]);
if ($net2ftp_result["success"] == false) { return false; }
// ------------------------------------
// Close connection
// ------------------------------------
ftp_closeconnection($conn_id);
// ------------------------------------
// Sort the list
// ------------------------------------
$list_directories = sort_list($list["directories"]);
$list_files = sort_list($list["files"]);
$list_symlinks = sort_list($list["symlinks"]);
$list_unrecognized = sort_list($list["unrecognized"]);
$warning_directory = $list["stats"]["warnings"];
$directory = $list["stats"]["newdirectory"];
$directory_html = htmlEncode2($directory);
$directory_url = urlEncode2($directory);
$directory_js = javascriptEncode2($directory);
$updirectory = upDir($directory);
$updirectory_html = htmlEncode2($updirectory);
$updirectory_url = urlEncode2($updirectory);
$updirectory_js = javascriptEncode2($updirectory);
// ------------------------------------
// Calculate the list of HTTP URLs
// ------------------------------------
if ($net2ftp_globals["state2"] == "main") {
$list_links_js = ftp2http($net2ftp_globals["directory"], $list_files, "no");
$list_links_url = ftp2http($net2ftp_globals["directory"], $list_files, "yes");
}
// ------------------------------------
// Consumption message
// ------------------------------------
$warning_consumption = "";
if (checkConsumption() == false) {
$warning_consumption .= "<b>" . __("Daily limit reached: you will not be able to transfer data") . "</b><br /><br />\n";
$warning_consumption .= __("In order to guarantee the fair use of the web server for everyone, the data transfer volume and script execution time are limited per user, and per day. Once this limit is reached, you can still browse the FTP server but not transfer data to/from it.") . "<br /><br />\n";
$warning_consumption .= __("If you need unlimited usage, please install net2ftp on your own web server.") . "<br />\n";
}
// ------------------------------------
// Browse message
// ------------------------------------
if ($net2ftp_settings["message_browse"] != "" && $net2ftp_settings["message_browse"] != "Setting message_browse does not exist") {
$warning_message = $net2ftp_settings["message_browse"];
}
// ------------------------------------
// Directory tree
// ------------------------------------
$directory_exploded = explode("/", stripDirectory($directory));
if ($directory != "/" && checkAuthorizedDirectory("/") == true) { $directory_tree = "<a href=\"javascript:submitBrowseForm('/','','browse','main');\">root</a> "; }
else { $directory_tree = "root "; }
$directory_goto = "";
for ($i=0; $i<sizeof($directory_exploded)-1; $i++) {
$directory_goto = glueDirectories($directory_goto, $directory_exploded[$i]);
$directory_goto_url = urlEncode2($directory_goto);
if (checkAuthorizedDirectory($directory_goto) == true) { $directory_tree .= "/<a href=\"javascript:submitBrowseForm('" . $directory_goto_url . "','','browse','main');\">" . htmlEncode2($directory_exploded[$i]) . "</a> "; }
else { $directory_tree .= "/" . $directory_exploded[$i] . " "; }
}
$directory_tree .= "/" . $directory_exploded[sizeof($directory_exploded)-1];
// ------------------------------------
// Language
// ------------------------------------
$language_onchange = "document.BrowseForm.language.value=document.forms['BrowseForm'].language2.options[document.forms['BrowseForm'].language2.selectedIndex].value; submitBrowseForm('$directory_js', '', 'browse', 'main');";
// ------------------------------------
// Skin
// ------------------------------------
$skin_onchange = "document.BrowseForm.skin.value=document.forms['BrowseForm'].skin2.options[document.forms['BrowseForm'].skin2.selectedIndex].value; submitBrowseForm('$directory_js', '', 'browse', 'main');";
// ------------------------------------
// $rowcounter counts the total nr of rows
// ------------------------------------
$rowcounter = 0;
// ------------------------------------
// Column spans
// ------------------------------------
$action_colspan = 1;
if ($net2ftp_settings["functionuse_view"] == "yes") { $action_colspan++; }
if ($net2ftp_settings["functionuse_edit"] == "yes") { $action_colspan++; }
if ($net2ftp_settings["functionuse_update"] == "yes") { $action_colspan++; }
// Total nr of columns
$total_colspan = $action_colspan + 9;
// ------------------------------------
// Name, Type, Size, ...
// Determine the sort criteria and direction (ascending/descending)
// ------------------------------------
$sortArray["dirfilename"]["text"] = __("Name");
$sortArray["type"]["text"] = __("Type");
$sortArray["size"]["text"] = __("Size");
$sortArray["owner"]["text"] = __("Owner");
$sortArray["group"]["text"] = __("Group");
$sortArray["permissions"]["text"] = __("Perms");
$sortArray["mtime"]["text"] = __("Mod Time");
$icon_directory = $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/images/mime";
// Loop over all the sort possibilities
while(list($key, $value) = each($sortArray)) {
// The list is sorted by the current $key
// Print the icon representing the current sortorder
// Print the link to sort using the other sortorder
if ($net2ftp_globals["sort"] == $key) {
// Ascending
if ($net2ftp_globals["sortorder"] == "ascending") {
$sortArray[$key]["title"] = __("Click to sort by %1\$s in descending order", $value["text"]);
$sortArray[$key]["onclick"] = "do_sort('" . $key . "','descending');";
$icon = "ascend.png";
$alt = __("Ascending order");
}
// Descending
else {
$sortArray[$key]["title"] = __("Click to sort by %1\$s in ascending order", $value["text"]);
$sortArray[$key]["onclick"] = "do_sort('" . $key . "','ascending');";
$icon = "descend.png";
$alt = __("Descending order");
}
}
// The list is not sorted by the current $key
// Do not print an icon
// Print the link to sort ascending
else {
$sortArray[$key]["title"] = __("Click to sort by %1\$s in ascending order", $value["text"]);
$sortArray[$key]["onclick"] = "do_sort('" . $key . "','ascending');";
$icon = "";
$alt = "";
}
// The icon to be printed is determined above
// Now, print the full HTML depending on the browser agent, version and platform
if ($icon != "") {
if ($net2ftp_globals["browser_agent"] == "IE" && ($net2ftp_globals["browser_version"] == "5.5" || $net2ftp_globals["browser_version"] == "6") && $net2ftp_globals["browser_platform"] == "Win") {
$sortArray[$key]["icon"] = "<img src=\"$icon_directory/spacer.gif\" alt=\"$alt\" style=\"border: 0px; width: 16px; height: 16px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='$icon_directory/$icon', sizingMethod='scale');\" />\n";
}
else {
$sortArray[$key]["icon"] = "<img src=\"$icon_directory/$icon\" alt=\"$alt\" style=\"border: 0px; width: 16px; height: 16px;\" />\n";
}
}
else {
$sortArray[$key]["icon"] = "";
}
}
// ------------------------------------
// popup - FormAndFieldname
// ------------------------------------
if (isset($_POST["FormAndFieldName"]) == true) { $FormAndFieldName = validateGenericInput($_POST["FormAndFieldName"]); }
else { $FormAndFieldName = ""; }
// ------------------------------------
// Action URL
// Used for Up, Subdirectories, Files (download + actions)
// ------------------------------------
$action_url = printPHP_SELF("actions");
// ------------------------------------
// Data transfer statistics
// Print this only if the consumption statistics are available (logging must be on, using a MySQL database)
// ------------------------------------
if (isset($net2ftp_globals["consumption_ipaddress_datatransfer"]) == true || isset($net2ftp_globals["consumption_ftpserver_datatransfer"]) == true) {
$print_consumption = true;
$consumption_ipaddress_datatransfer = formatFilesize($net2ftp_globals["consumption_ipaddress_datatransfer"]);
$consumption_ftpserver_datatransfer = formatFilesize($net2ftp_globals["consumption_ftpserver_datatransfer"]);
}
else {
$print_consumption = false;
}
// ------------------------------------
// HTTP URL
// ------------------------------------
$list_files_tmp[1]["dirfilename_url"] = "";
$httplink = ftp2http($directory, $list_files_tmp, "no");
// -------------------------------------------------------------------------
// Print the output - part 2
// -------------------------------------------------------------------------
if ($net2ftp_globals["state2"] == "main") {
setStatus(6, 10, __("Printing the list of directories and files"));
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/browse_main.template.php");
}
elseif ($net2ftp_globals["state2"] == "popup") {
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/browse_popup.template.php");
}
} // end function net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// **
function sort_list($list) {
// --------------
// This function sorts the list of directories and files
// Written by Slynderdale
// --------------
// -------------------------------------------------------------------------
// Global variables and settings
// -------------------------------------------------------------------------
global $net2ftp_globals;
// -------------------------------------------------------------------------
// If the list is empty, return immediately
// -------------------------------------------------------------------------
if ($net2ftp_globals["sort"] == "" || is_array($list) == false || sizeof($list) <= 1) { return $list; }
// -------------------------------------------------------------------------
// Default values
// -------------------------------------------------------------------------
// Sort flags
if ($net2ftp_globals["sort"] == "size") { $sortflag = SORT_NUMERIC; }
else { $sortflag = SORT_REGULAR; }
// Sort ascending or descending
if ($net2ftp_globals["sortorder"] == "ascending") { $sortfunction = "asort"; }
else { $sortfunction = "arsort"; }
// -------------------------------------------------------------------------
// Create a temporary array $temp which contains only the key $i and the value based on which the sorting is done
// -------------------------------------------------------------------------
// ------------------------------------
// Sorting according to name, size, owner, group, permissions
// ------------------------------------
if ($net2ftp_globals["sort"] != "mtime" && $net2ftp_globals["sort"] != "type") {
for($i=1; $i<=sizeof($list); $i++) {
$temp[$i] = strtolower($list[$i][$net2ftp_globals["sort"]]);
}
}
// ------------------------------------
// When sorting according to the modification time, do not sort alphabetically (April, February, January, March),
// but according to the corresponding Unix timestamp
// ------------------------------------
elseif ($net2ftp_globals["sort"] == "mtime") {
for($i=1; $i<=sizeof($list); $i++) {
// Some FTP servers return the date and time in a non-standard format
// For example: "Apr 06 12:57". Transform this to "06 April 2005 12:57"
if (preg_match("/([a-zA-Z]{3})[ ]+([0-9]{1,2})[ ]+([0-9]{1,2}:[0-9]{2})/", $list[$i]["mtime"], $regs) == true) {
$month = $regs[1];
$day = $regs[2];
$hour = $regs[3];
$year = date("Y");
if ($month == "Jan") { $month = "January"; }
elseif ($month == "Feb") { $month = "February"; }
elseif ($month == "Mar") { $month = "March"; }
elseif ($month == "Apr") { $month = "April"; }
elseif ($month == "May") { $month = "May"; }
elseif ($month == "Jun") { $month = "June"; }
elseif ($month == "Jul") { $month = "July"; }
elseif ($month == "Aug") { $month = "August"; }
elseif ($month == "Sep") { $month = "September"; }
elseif ($month == "Oct") { $month = "October"; }
elseif ($month == "Nov") { $month = "November"; }
elseif ($month == "Dec") { $month = "December"; }
$mtime_correct = "$day $month $year $hour";
$temp[$i] = strtotime($mtime_correct);
}
else {
$temp[$i] = strtotime($list[$i]["mtime"]);
}
} // end for
}
// ------------------------------------
// When sorting according to the file type, get the mime type for each entry
// ------------------------------------
elseif ($net2ftp_globals["sort"] == "type") {
for($i=1; $i<=sizeof($list); $i++) {
$mime = getMime($list[$i]);
$temp[$i] = $mime["mime_type"];
} // end for
}
// -------------------------------------------------------------------------
// Execute the sorting on the $temp array
// -------------------------------------------------------------------------
$sortfunction($temp, $sortflag);
// -------------------------------------------------------------------------
// Fill the $return array
// -------------------------------------------------------------------------
$i=1;
while(list($tname, $tvalue) = each($temp)) {
$return[$i] = $list[$tname];
$i++;
}
// -------------------------------------------------------------------------
// Return the result
// -------------------------------------------------------------------------
return $return;
} // end function sort_list
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,102 +0,0 @@
<?php
header("Content-type: text/javascript");
if (isset($_GET["skin"]) == true && $_GET["skin"] == "india") { $extracheck = "|| (state == 'edit' && state2 == '') || state == 'view' || state == 'update'"; }
else { $extracheck = ""; }
?>
function submitBrowseForm(directory, entry, state, state2) {
// Check that at least 1 checkbox is checked
var nr_checkboxes_checked = 0;
if (state == 'calculatesize' || state == 'chmod' || state == 'copymovedelete' || state == 'downloadzip' ||
state == 'findstring' || state == 'rename' || state == 'unzip' || state == 'zip' <?php echo $extracheck; ?>) {
for (var i = 0; i < document.forms['BrowseForm'].elements.length; i++) {
if (document.forms['BrowseForm'].elements[i].type == 'checkbox') {
if (document.forms['BrowseForm'].elements[i].checked == true) { nr_checkboxes_checked++; break; }
}
}
if (nr_checkboxes_checked == 0) {
alert('Please select at least one directory or file.');
return false;
}
}
// For the skins with a <select> drop-down box on top (e.g. India), determine the value of the
// 'entry' variable based on the first selected entry
if (entry == '' && (state == 'view' || state == 'edit' || state == 'update')) {
for (var i = 0; i < document.forms['BrowseForm'].elements.length; i++) {
if (document.forms['BrowseForm'].elements[i].type == 'checkbox') {
if (document.forms['BrowseForm'].elements[i].checked == true) { entry = document.forms['BrowseForm'].elements[i].value; break; }
}
}
}
// Set BrowseForm values
document.forms['BrowseForm'].state.value=state;
document.forms['BrowseForm'].state2.value=state2;
document.forms['BrowseForm'].directory.value=directory;
document.forms['BrowseForm'].entry.value=entry;
// Set the select back to the first entry
for (var i = 0; i < document.forms['BrowseForm'].elements.length; i++) {
if (document.forms['BrowseForm'].elements[i].name == 'BrowseSelect') { document.forms['BrowseForm'].BrowseSelect.selectedIndex = 0; }
}
// Submit
document.forms['BrowseForm'].submit();
}
function do_sort(sort, sortorder) {
document.forms['BrowseForm'].state.value='browse';
document.forms['BrowseForm'].state2.value='main';
document.forms['BrowseForm'].sort.value=sort;
document.forms['BrowseForm'].sortorder.value=sortorder;
document.forms['BrowseForm'].submit();
}
function CheckAll(myform) {
var nr_checkboxes = 0;
for (var i = 0; i < myform.elements.length; i++) {
if (myform.elements[i].type == 'checkbox') {
myform.elements[i].checked = !(myform.elements[i].checked);
nr_checkboxes = nr_checkboxes + 1;
}
}
for (var j = 1; j <= nr_checkboxes; j++) {
setColor_js(j, 'checkbox')
}
}
function setStatus_js(text) {
id = 'status';
if (document.getElementById) {
document.getElementById(id).value = text;
}
else if (document.all) {
document.all[id].value = text;
}
}
function toggleElement(name) {
var name_shown = name + '_shown';
var name_hidden = name + '_hidden';
if (document.getElementById) {
var element_shown = document.getElementById(name_shown);
var element_hidden = document.getElementById(name_hidden);
}
else if (document.all) {
var element_shown = document.all[name_shown];
var element_hidden = document.all[name_hidden];
}
if(element_shown.style.display == "none" || element_shown.style.display == false) {
element_shown.style.display = "block";
element_hidden.style.display = "none";
}
else if(element_shown.style.display == "block") {
element_shown.style.display = "none";
element_hidden.style.display = "block";
}
}

View file

@ -1,42 +0,0 @@
function submitBrowseForm(directory, entry, state, state2) {
// Check that at least 1 checkbox is checked
var nr_checkboxes_checked = 0;
if (state == 'calculatesize' || state == 'chmod' || state == 'copymovedelete' || state == 'downloadzip' ||
state == 'findstring' || state == 'rename' || state == 'unzip' || state == 'zip' || (state == 'edit' && state2 == '') || state == 'view' || state == 'update') {
for (var i = 0; i < document.forms['BrowseForm'].elements.length; i++) {
if (document.forms['BrowseForm'].elements[i].type == 'checkbox') {
if (document.forms['BrowseForm'].elements[i].checked == true) { nr_checkboxes_checked++; break; }
}
}
if (nr_checkboxes_checked == 0) {
alert('Please select at least one directory or file.');
return false;
}
}
// For the skins with a <select> drop-down box on top, determine the value of the
// 'entry' variable based on the first selected entry
if (entry == '' && (state == 'view' || state == 'edit' || state == 'update')) {
for (var i = 0; i < document.forms['BrowseForm'].elements.length; i++) {
if (document.forms['BrowseForm'].elements[i].type == 'checkbox') {
if (document.forms['BrowseForm'].elements[i].checked == true) { entry = document.forms['BrowseForm'].elements[i].value; break; }
}
}
}
// Set BrowseForm values
document.forms['BrowseForm'].state.value=state;
document.forms['BrowseForm'].state2.value=state2;
document.forms['BrowseForm'].directory.value=directory;
document.forms['BrowseForm'].entry.value=entry;
// Set the select back to the first entry
for (var i = 0; i < document.forms['BrowseForm'].elements.length; i++) {
if (document.forms['BrowseForm'].elements[i].name == 'BrowseSelect') { document.forms['BrowseForm'].BrowseSelect.selectedIndex = 0; }
}
// Submit
document.forms['BrowseForm'].submit();
}

View file

@ -1,21 +0,0 @@
function submitDirectoryTreeForm(last_directory_index) {
if (document.forms['DirectoryTreeForm'].DirectoryTreeSelect.selectedIndex <= last_directory_index) {
if (document.forms['DirectoryTreeForm'].DirectoryTreeSelect.options[document.forms['DirectoryTreeForm'].DirectoryTreeSelect.selectedIndex].value != 'up') {
if (document.forms['DirectoryTreeForm'].directory.value == '/') {
document.forms['DirectoryTreeForm'].directory.value = '/' + document.forms['DirectoryTreeForm'].DirectoryTreeSelect.options[document.forms['DirectoryTreeForm'].DirectoryTreeSelect.selectedIndex].value;
}
else {
document.forms['DirectoryTreeForm'].directory.value = document.forms['DirectoryTreeForm'].directory.value + '/' + document.forms['DirectoryTreeForm'].DirectoryTreeSelect.options[document.forms['DirectoryTreeForm'].DirectoryTreeSelect.selectedIndex].value;
}
}
else {
document.forms['DirectoryTreeForm'].directory.value = document.forms['DirectoryTreeForm'].updirectory.value;
}
}
else {
document.forms['DirectoryTreeForm'].state.value = 'followsymlink';
document.forms['DirectoryTreeForm'].state2.value = 'popup';
document.forms['DirectoryTreeForm'].entry.value = document.forms['DirectoryTreeForm'].DirectoryTreeSelect.options[document.forms['DirectoryTreeForm'].DirectoryTreeSelect.selectedIndex].value;
}
document.forms['DirectoryTreeForm'].submit();
}

View file

@ -1,190 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the login screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
if (isset($_POST["list"]) == true) { $list = getSelectedEntries($_POST["list"]); }
else { $list = ""; }
// -------------------------------------------------------------------------
// Variables
// -------------------------------------------------------------------------
// Title
$title = __("Size of selected directories and files");
// Form name, back and forward buttons
$formname = "CalculateSizeForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
// Open connection
setStatus(2, 10, __("Connecting to the FTP server"));
$conn_id = ftp_openconnection();
if ($net2ftp_result["success"] == false) { return false; }
// Calculate the size
$options = array();
$result['size'] = 0;
$result['skipped'] = 0;
$result = ftp_processfiles("calculatesize", $conn_id, $net2ftp_globals["directory"], $list, $options, $result, 0);
// Close connection
ftp_closeconnection($conn_id);
// Print message
$net2ftp_output["calculatesize"][] = __("The total size taken by the selected directories and files is:") . " <b>" . formatFilesize($result['size']) . "</b> (" . $result['size'] . " Bytes)";
if ($result['skipped'] > 0) {
$net2ftp_output["calculatesize"][] = __("The number of files which were skipped is:") . " <b>" . $result['skipped'] . "</b>";
}
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,280 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/chmod/chmod.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the chmod screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
if (isset($_POST["list"]) == true) { $list = getSelectedEntries($_POST["list"]); }
else { $list = ""; }
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
// Title
$title = __("Chmod directories and files");
// Form name, back and forward buttons
$formname = "ChmodForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
$forward_onclick = "document.forms['" . $formname . "'].submit();";
// -------------------------------------------------------------------------
// Variables for screen 1
// -------------------------------------------------------------------------
if ($net2ftp_globals["screen"] == 1) {
// Next screen
$nextscreen = 2;
// Initialize variables
$directory_index = 1;
$file_index = 1;
$symlink_index = 1;
for ($i=1; $i<=count($list["all"]); $i++) {
if ($list["all"][$i]["dirorfile"] == "d") { $list["all"][$i]["message"] = __("Set the permissions of directory <b>%1\$s</b> to: ", $list["all"][$i]["dirfilename"]) . "<br />\n"; }
elseif ($list["all"][$i]["dirorfile"] == "-") { $list["all"][$i]["message"] = __("Set the permissions of file <b>%1\$s</b> to: ", $list["all"][$i]["dirfilename"]) . "<br />\n"; }
elseif ($list["all"][$i]["dirorfile"] == "l") { $list["all"][$i]["message"] = __("Set the permissions of symlink <b>%1\$s</b> to: ", $list["all"][$i]["dirfilename"]) . "<br />\n"; }
$owner_chmod = 0;
if (substr($list["all"][$i]["permissions"], 0, 1) == "r") { $owner_chmod+=4; $list["all"][$i]["owner_read"] = "checked=\"checked\""; }
else { $list["all"][$i]["owner_read"] = ""; }
if (substr($list["all"][$i]["permissions"], 1, 1) == "w") { $owner_chmod+=2; $list["all"][$i]["owner_write"] = "checked=\"checked\""; }
else { $list["all"][$i]["owner_write"] = ""; }
if (substr($list["all"][$i]["permissions"], 2, 1) == "x") { $owner_chmod+=1; $list["all"][$i]["owner_execute"] = "checked=\"checked\""; }
else { $list["all"][$i]["owner_execute"] = ""; }
$group_chmod = 0;
if (substr($list["all"][$i]["permissions"], 3, 1) == "r") { $group_chmod+=4; $list["all"][$i]["group_read"] = "checked=\"checked\""; }
else { $list["all"][$i]["group_read"] = ""; }
if (substr($list["all"][$i]["permissions"], 4, 1) == "w") { $group_chmod+=2; $list["all"][$i]["group_write"] = "checked=\"checked\""; }
else { $list["all"][$i]["group_write"] = ""; }
if (substr($list["all"][$i]["permissions"], 5, 1) == "x") { $group_chmod+=1; $list["all"][$i]["group_execute"] = "checked=\"checked\""; }
else { $list["all"][$i]["group_execute"] = ""; }
$other_chmod = 0;
if (substr($list["all"][$i]["permissions"], 6, 1) == "r") { $other_chmod+=4; $list["all"][$i]["other_read"] = "checked=\"checked\""; }
else { $list["all"][$i]["other_read"] = ""; }
if (substr($list["all"][$i]["permissions"], 7, 1) == "w") { $other_chmod+=2; $list["all"][$i]["other_write"] = "checked=\"checked\""; }
else { $list["all"][$i]["other_write"] = ""; }
if (substr($list["all"][$i]["permissions"], 8, 1) == "x") { $other_chmod+=1; $list["all"][$i]["other_execute"] = "checked=\"checked\""; }
else { $list["all"][$i]["other_execute"] = ""; }
$list["all"][$i]["chmodvalue"] = $owner_chmod.$group_chmod.$other_chmod;
if ($list["all"][$i]["dirorfile"] == "d") { $list["directories"][$directory_index]["chmodvalue"] = $list["all"][$i]["chmodvalue"]; $directory_index++; }
elseif ($list["all"][$i]["dirorfile"] == "-") { $list["files"][$file_index]["chmodvalue"] = $list["all"][$i]["chmodvalue"]; $file_index++; }
elseif ($list["all"][$i]["dirorfile"] == "l") { $list["symlinks"][$symlink_index]["chmodvalue"] = $list["all"][$i]["chmodvalue"]; $symlink_index++; }
} // end for
} // end if
// -------------------------------------------------------------------------
// Variables for screen 2
// -------------------------------------------------------------------------
elseif ($net2ftp_globals["screen"] == 2) {
// Initialize variables
$directory_index = 1;
$file_index = 1;
$symlink_index = 1;
// Calculate the chmod octal
for ($i=1; $i<=count($list["all"]); $i++) {
if (isset($list["all"][$i]["owner_read"]) == false) { $list["all"][$i]["owner_read"] = 0; }
if (isset($list["all"][$i]["owner_write"]) == false) { $list["all"][$i]["owner_write"] = 0; }
if (isset($list["all"][$i]["owner_execute"]) == false) { $list["all"][$i]["owner_execute"] = 0; }
if (isset($list["all"][$i]["group_read"]) == false) { $list["all"][$i]["group_read"] = 0; }
if (isset($list["all"][$i]["group_write"]) == false) { $list["all"][$i]["group_write"] = 0; }
if (isset($list["all"][$i]["group_execute"]) == false) { $list["all"][$i]["group_execute"] = 0; }
if (isset($list["all"][$i]["other_read"]) == false) { $list["all"][$i]["other_read"] = 0; }
if (isset($list["all"][$i]["other_write"]) == false) { $list["all"][$i]["other_write"] = 0; }
if (isset($list["all"][$i]["other_execute"]) == false) { $list["all"][$i]["other_execute"] = 0; }
$ownerOctal = $list["all"][$i]["owner_read"] + $list["all"][$i]["owner_write"] + $list["all"][$i]["owner_execute"];
$groupOctal = $list["all"][$i]["group_read"] + $list["all"][$i]["group_write"] + $list["all"][$i]["group_execute"];
$otherOctal = $list["all"][$i]["other_read"] + $list["all"][$i]["other_write"] + $list["all"][$i]["other_execute"];
$chmodOctal = $ownerOctal . $groupOctal . $otherOctal;
if ($chmodOctal > 777 || $chmodOctal < 0) {
$errormessage = __("The chmod nr <b>%1\$s</b> is out of the range 000-777. Please try again.", $chmodOctal);
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
else {
$list["all"][$i]["chmodoctal"] = $chmodOctal;
if ($list["all"][$i]["dirorfile"] == "d") { $list["directories"][$directory_index]["chmodoctal"] = $list["all"][$i]["chmodoctal"]; $directory_index++; }
elseif ($list["all"][$i]["dirorfile"] == "-") { $list["files"][$file_index]["chmodoctal"] = $list["all"][$i]["chmodoctal"]; $file_index++; }
elseif ($list["all"][$i]["dirorfile"] == "l") { $list["symlinks"][$symlink_index]["chmodoctal"] = $list["all"][$i]["chmodoctal"]; $symlink_index++; }
}
} // End for
// Open connection
setStatus(2, 10, __("Connecting to the FTP server"));
$conn_id = ftp_openconnection();
if ($conn_id == false) { return false; }
// Chmod the entries
setStatus(4, 10, __("Processing the entries"));
ftp_chmod2($conn_id, $net2ftp_globals["directory"], $list, 0);
if ($net2ftp_result["success"] == false) { return false; }
// Close connection
ftp_closeconnection($conn_id);
} // end elseif
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,127 +0,0 @@
function update_field(id,text) {
if (document.getElementById) {
document.getElementById(id).value = text;
}
else if (document.all) {
document.all[id].value = text;
}
}
function get_field(id) {
if (document.getElementById) {
var value = document.getElementById(id).value;
}
else if (document.all) {
var value = document.all[id].value;
}
return value;
}
function update_input(num) {
var myform = document.forms['ChmodForm'];
var myfield = 'chmod';
var regexp = /list\[([0-9]+)\]\[(owner|group|other)_(read|write|execute)\]/i;
var myArray = new Array();
var maxfields = 0;
for (var i = 0; i < myform.elements.length; i++) {
if (regexp.test(myform.elements[i].name)) {
var ar = regexp.exec(myform.elements[i].name);
var checked = myform.elements[i].checked;
if (maxfields<ar[1]) maxfields = ar[1];
myArray[myArray.length] = new Array(ar[1],ar[2],ar[3],checked);
}
}
if (!num || num=="all" || num == '') num = 0;
for(var i=0; i<maxfields; i++) {
var id = i+1;
if (num==0 || num==id) {
var owner = 0;
var group = 0;
var other = 0;
var add = 0;
for (var j=0; j<myArray.length; j++) {
checked = myArray[j][3];
if (checked && id==myArray[j][0]) {
if(myArray[j][2]=='read') add = 4;
else if(myArray[j][2]=='write') add = 2;
else if(myArray[j][2]=='execute') add = 1;
if(myArray[j][1]=='owner') owner += add;
else if(myArray[j][1]=='group') group += add;
else if(myArray[j][1]=='other') other += add;
}
}
update_field(myfield+id,owner+''+group+''+other);
if (num!=0 && num==id) break;
}
}
}
function update_checkbox(num) {
var myform = document.forms['ChmodForm'];
var myfield = 'chmod';
var regexp = /list\[([0-9]+)\]\[(owner|group|other)_(read|write|execute)\]/i;
if (!num || num=="all" || num == '') num = 0;
for (var i = 0; i < myform.elements.length; i++) {
var name = myform.elements[i].name;
if (name.substr(0,myfield.length) == myfield) {
var id = name.substr(myfield.length,name.length);
if (id>0 && (num==0 || num==id)) {
var field = get_field(myfield+id);
var o = field.substr(0,1);
var g = field.substr(1,1);
var e = field.substr(2,1);
if (field.length==3 && o>=0 && o<=7 && g>=0 && g<=7 && e>=0 && e<=7) {
for (var j = 0; j < myform.elements.length; j++) {
if (regexp.test(myform.elements[j].name)) {
var ar = regexp.exec(myform.elements[j].name);
if (ar[1]==id) {
var check = false;
if (ar[2]=='owner') {
if (ar[3]=='read' && (o==4 || o==5 || o==6 || o==7))
check = true;
if (ar[3]=='write' && (o==2 || o==3 || o==6 || o==7))
check = true;
if (ar[3]=='execute' && (o==1 || o==3 || o==5 || o==7))
check = true;
}
else if (ar[2]=='group') {
if (ar[3]=='read' && (g==4 || g==5 || g==6 || g==7))
check = true;
if (ar[3]=='write' && (g==2 || g==3 || g==6 || g==7))
check = true;
if (ar[3]=='execute' && (g==1 || g==3 || g==5 || g==7))
check = true;
}
else if (ar[2]=='other') {
if (ar[3]=='read' && (e==4 || e==5 || e==6 || e==7))
check = true;
if (ar[3]=='write' && (e==2 || e==3 || e==6 || e==7))
check = true;
if (ar[3]=='execute' && (e==1 || e==3 || e==5 || e==7))
check = true;
}
if (check==true) myform.elements[j].checked = 1;
else myform.elements[j].checked = 0;
}
}
}
}
else {
update_input(id);
}
}
}
}
}
function CopyCheckboxToAll(myform, mysourcefieldname, mytargetfieldname) {
for (var i = 0; i < myform.elements.length; i++) {
if (myform.elements[i].name.indexOf(mysourcefieldname) >= 0) {
for (var j = 0; j < myform.elements.length; j++) {
if (myform.elements[j].name.indexOf(mytargetfieldname) >= 0) {
myform.elements[j].checked = myform.elements[i].checked;
}
}
}
}
}

View file

@ -1,52 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
setcookie("net2ftpcookie_ftpserver", "", 1);
setcookie("net2ftpcookie_ftpserverport", "", 1);
setcookie("net2ftpcookie_username", "", 1);
setcookie("net2ftpcookie_language", "", 1);
setcookie("net2ftpcookie_skin", "", 1);
setcookie("net2ftpcookie_ftpmode", "", 1);
setcookie("net2ftpcookie_passivemode", "", 1);
setcookie("net2ftpcookie_protocol", "", 1);
setcookie("net2ftpcookie_viewmode", "", 1);
setcookie("net2ftpcookie_sort", "", 1);
setcookie("net2ftpcookie_sortorder", "", 1);
setcookie("net2ftpcookie_directory", "", 1);
header("Location: index.php");
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,290 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_result;
// -------------------------------------------------------------------------
// Mobile skins
// -------------------------------------------------------------------------
if ($net2ftp_globals["skin"] == "mobile" || $net2ftp_globals["skin"] == "iphone") {
echo "<script type=\"text/javascript\"><!--\n";
echo "function CopyValueToAll(myform, mysourcefield, mytargetfieldname) {\n";
echo " for (var i = 0; i < myform.elements.length; i++) {\n";
echo " if (myform.elements[i].name.indexOf(mytargetfieldname) >= 0) {\n";
echo " myform.elements[i].value = mysourcefield.value;\n";
echo " }\n";
echo " }\n";
echo "}\n";
echo "//--></script>\n";
}
// -------------------------------------------------------------------------
// Other skins
// -------------------------------------------------------------------------
else {
echo "<script type=\"text/javascript\"><!--\n";
echo "function createDirectoryTreeWindow(directory, FormAndFieldName) {\n";
echo " directoryTreeWindow = window.open(\"\",\"directoryTreeWindow\",\"height=450,width=300,resizable=yes,scrollbars=yes\");\n";
echo " var d = directoryTreeWindow.document;\n";
echo " d.writeln('<html>');\n";
echo " d.writeln('<head>');\n";
echo " d.writeln('<title>" . __("Choose a directory") . "<\/title>');\n";
echo " d.writeln('<\/head>');\n";
echo " d.writeln('<bo' + 'dy on' + 'load=\"document.DirectoryTreeForm.submit();\">');\n";
// echo " d.writeln('<body>');\n";
echo " d.writeln('" . __("Please wait...") . "<br /><br />');\n";
echo " d.writeln('<form name=\"DirectoryTreeForm\" id=\"DirectoryTreeForm\" action=\"" . printPHP_SELF("createDirectoryTreeWindow") . "\" method=\"post\" />');\n";
printLoginInfo_javascript();
echo " d.writeln('<input type=\"hidden\" name=\"state\" value=\"browse\" />');\n";
echo " d.writeln('<input type=\"hidden\" name=\"state2\" value=\"popup\" />');\n";
echo " d.writeln('<input type=\"hidden\" name=\"directory\" value=\"' + directory + '\" />');\n";
echo " d.writeln('<input type=\"hidden\" name=\"FormAndFieldName\" value=\"' + FormAndFieldName + '\" />');\n";
echo " d.writeln('<\/form>');\n";
echo " d.writeln('<\/div>');\n";
echo " d.writeln('<\/body>');\n";
echo " d.writeln('<\/html>');\n";
echo " d.close();\n";
echo "} // end function createDirectoryTreeWindow\n";
echo "\n";
echo "function CopyValueToAll(myform, mysourcefield, mytargetfieldname) {\n";
echo " for (var i = 0; i < myform.elements.length; i++) {\n";
echo " if (myform.elements[i].name.indexOf(mytargetfieldname) >= 0) {\n";
echo " myform.elements[i].value = mysourcefield.value;\n";
echo " }\n";
echo " }\n";
echo "}\n";
echo "//--></script>\n";
}
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the copy/move/delete screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
if (isset($_POST["list"]) == true) { $list = getSelectedEntries($_POST["list"]); }
else { $list = ""; }
if (isset($_POST["ftpserver2"]) == true) { $net2ftp_globals["ftpserver2"] = validateFtpserver($_POST["ftpserver2"]); }
else { $net2ftp_globals["ftpserver2"] = ""; }
if (isset($_POST["ftpserverport2"]) == true) { $net2ftp_globals["ftpserverport2"] = validateFtpserverport($_POST["ftpserverport2"]); }
else { $net2ftp_globals["ftpserverport2"] = ""; }
if (isset($_POST["username2"]) == true) { $net2ftp_globals["username2"] = validateUsername($_POST["username2"]); }
else { $net2ftp_globals["username2"] = ""; }
if (isset($_POST["password2"]) == true) { $net2ftp_globals["password2"] = validatePassword($_POST["password2"]); }
else { $net2ftp_globals["password2"] = ""; }
if (isset($_POST["protocol2"]) == true) { $net2ftp_globals["protocol2"] = validateProtocol($_POST["protocol2"]); }
else { $net2ftp_globals["protocol2"] = ""; }
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
// Title
if ($net2ftp_globals["state2"] == "copy") {
$title = __("Copy directories and files");
}
elseif ($net2ftp_globals["state2"] == "move") {
$title = __("Move directories and files");
}
elseif ($net2ftp_globals["state2"] == "delete") {
$title = __("Delete directories and files");
}
// Form name, back and forward buttons
$formname = "CopyMoveDeleteForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
$forward_onclick = "document.forms['" . $formname . "'].submit();";
// -------------------------------------------------------------------------
// Variables for screen 1
// -------------------------------------------------------------------------
if ($net2ftp_globals["screen"] == 1) {
// Next screen
$nextscreen = 2;
// Protocol
$protocol["inputType"] = "hidden";
$protocol["list"][1] = "FTP";
if (function_exists("ssh2_connect") == true) { $protocol["list"][2] = "FTP over SSH2"; $protocol["inputType"] = "select"; }
if (function_exists("ftp_ssl_connect") == true) { $protocol["list"][3] = "FTP with SSL"; $protocol["inputType"] = "select"; }
} // end if
// -------------------------------------------------------------------------
// Variables for screen 2
// -------------------------------------------------------------------------
elseif ($net2ftp_globals["screen"] == 2) {
// ---------------------------------------
// Open connection to the source server
// ---------------------------------------
setStatus(2, 10, __("Connecting to the FTP server"));
$conn_id_source = ftp_openconnection();
if ($net2ftp_result["success"] == false) { return false; }
// ---------------------------------------
// Open connection to the target server, if it is different from the source server, or if the username
// is different (different users may have different authorizations on the same FTP server)
// ---------------------------------------
if (($net2ftp_globals["ftpserver2"] != "" || $net2ftp_globals["username2"] != "") &&
($net2ftp_globals["ftpserver2"] != $net2ftp_globals["ftpserver"] || $net2ftp_globals["username2"] != $net2ftp_globals["username"])) {
$conn_id_target = ftp_openconnection2(); // Note: ftp_openconnection2 cleans the input values
if ($net2ftp_result["success"] == false) { return false; }
}
else { $conn_id_target = $conn_id_source; }
// ---------------------------------------
// Copy, move or delete the files and directories
// ---------------------------------------
ftp_copymovedelete($conn_id_source, $conn_id_target, $list, $net2ftp_globals["state2"], 0);
// ---------------------------------------
// Close the connection to the source server
// ---------------------------------------
ftp_closeconnection($conn_id_source);
// ---------------------------------------
// Close the connection to the target server, if it is different from the source server
// ---------------------------------------
if ($conn_id_source != $conn_id_target) { ftp_closeconnection($conn_id_target); }
} // end elseif
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,48 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
global $net2ftp_globals, $net2ftp_settings;
if ($net2ftp_settings["functionuse_downloadfile"] == "yes") {
ftp_downloadfile($net2ftp_globals["directory"], $net2ftp_globals["entry"]);
}
else {
$errormessage = __("This function has been disabled by the Administrator of this website.");
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,55 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
global $net2ftp_globals, $net2ftp_settings;
if (isset($_POST["list"]) == true) { $list = getSelectedEntries($_POST["list"]); }
elseif (isset($_GET["list"]) == true) { $list = getSelectedEntries($_GET["list"]); }
else { $list = ""; }
if ($net2ftp_settings["functionuse_downloadzip"] == "yes") {
$zipactions["download"] = "yes";
$zipactions["email"] = "no";
$zipactions["save"] = "no";
ftp_zip("", $net2ftp_globals["directory"], $list, $zipactions, "", 0);
}
else {
$errormessage = __("This function has been disabled by the Administrator of this website.");
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,763 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
if (isset($_POST["textareaType"]) == true) { $textareaType = validateTextareaType($_POST["textareaType"]); }
else { $textareaType = ""; }
// -------------------------------------------------------------------------
// Do not print anything for Mobile skins
// -------------------------------------------------------------------------
if ($net2ftp_globals["skin"] == "mobile" || $net2ftp_globals["skin"] == "iphone") {
}
// -------------------------------------------------------------------------
// For the other skins, do print more Javascript functions
// -------------------------------------------------------------------------
else {
if ($textareaType == "" || $textareaType == "plain") {
echo "<script type=\"text/javascript\"><!--\n";
echo "function TabText() {\n";
echo " if (event != null) {\n";
echo " if (event.srcElement) {\n";
echo " if (event.srcElement.value) {\n";
echo " if (event.keyCode == 9) {\n";
echo " if (document.selection != null) {\n";
echo " document.selection.createRange().text = '\\t';\n";
echo " event.returnValue = false;\n";
echo " }\n";
echo " else {\n";
echo " event.srcElement.value += '\\t';\n";
echo " return false;\n";
echo " }\n";
echo " }\n";
echo " }\n";
echo " }\n";
echo " }\n";
echo "}\n";
echo "//--></script>\n";
}
// Include
echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/edit/edit.js\"></script>\n";
}
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the edit screen
// For screen == 1, the file is read from the FTP server
// For screen == 2, the textarea is changed, the file is not read from the FTP server but comes from the HTML form
// For screen == 3, the file is saved to the FTP server
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
if (isset($_POST["textareaType"]) == true) { $textareaType = validateTextareaType($_POST["textareaType"]); }
else { $textareaType = ""; }
if (isset($_POST["text"]) == true) { $text = $_POST["text"]; }
else { $text = ""; }
if (isset($_POST["text_splitted"]) == true) { $text_splitted = $_POST["text_splitted"]; }
else { $text_splitted = ""; }
if (isset($_POST["encodingSelect"]) == true) { $encodingSelect = $_POST["encodingSelect"]; }
else { $encodingSelect = ""; }
if (isset($_POST["breakSelect"]) == true) { $breakSelect = $_POST["breakSelect"]; }
else { $breakSelect = ""; }
$text_encoding_selected = "";
$line_break_selected = "";
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
// Form name, back and forward buttons
$formname = "EditForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
// Directory + file name
$dirfilename = htmlEncode2(glueDirectories($net2ftp_globals["directory"], $net2ftp_globals["entry"]));
// TextareaSelect onchange
$onchange = "document.forms['EditForm'].screen.value=2;document.forms['EditForm'].textareaType.value=document.forms['EditForm'].textareaSelect.options[document.forms['EditForm'].textareaSelect.selectedIndex].value;document.forms['EditForm'].submit();";
// Character encoding (requires multibyte string module to be installed)
// With this, you can save a text with specified encoding and line break sequence
// http://www.net2ftp.org/forums/viewtopic.php?id=2449
if (($net2ftp_globals["language"] == "ja" || $net2ftp_globals["language"] == "tc" || $net2ftp_messages["iso-8859-1"] == "UTF-8") && function_exists("mb_detect_encoding") == true) {
// $textarea_encodings is an array which contains the possible character encodings
$textarea_encodings = getTextareaEncodingsArray();
// $textarea_breaks is an array which contains the possible line breaks
$textarea_breaks[] = "CRLF";
$textarea_breaks[] = "CR";
$textarea_breaks[] = "LF";
// $text_encoding_old is the original encoding which is detected when the file is first read
// $text_encoding_new is the requested encoding from the drop-down box
// Default = encoding used for the page, which is defined by the language file in /languages/xx.inc.php
// HTML uses BIG5, PHP uses BIG-5 (Traditional Chinese)
// If the HTML encoding is not foreseen in the PHP function, set it to the default ISO-8859-1
// $text_encoding is changed further on too
if($encodingSelect != "" && in_array($encodingSelect, $textarea_encodings)) { $text_encoding_new = $encodingSelect; }
else { $text_encoding_new = ""; }
// $line_break_old is the original line break which is detected when the file is first read
// $line_break is the requested line break from the drop-down box
if($breakSelect != "" && in_array($breakSelect, $textarea_breaks) == true) { $line_break_new = $breakSelect; }
else { $line_break_new = "LF"; }
}
// Programming language (for Ace syntax highlighting)
if ($textareaType == "ace") {
// See examples at http://ace.ajax.org/build/kitchen-sink.html
$ace_theme = "eclipse";
$filename_extension = get_filename_extension($net2ftp_globals["entry"]);
if ($filename_extension == "abap") { $ace_mode = "abap"; }
elseif ($filename_extension == "css") { $ace_mode = "css"; }
elseif ($filename_extension == "cgi") { $ace_mode = "perl"; }
elseif ($filename_extension == "htm") { $ace_mode = "html"; }
elseif ($filename_extension == "html") { $ace_mode = "html"; }
elseif ($filename_extension == "java") { $ace_mode = "java"; }
elseif ($filename_extension == "js") { $ace_mode = "javascript"; }
elseif ($filename_extension == "javascript") { $ace_mode = "javascript"; }
elseif ($filename_extension == "pl") { $ace_mode = "perl"; }
elseif ($filename_extension == "perl") { $ace_mode = "perl"; }
elseif ($filename_extension == "php") { $ace_mode = "php"; }
elseif ($filename_extension == "phps") { $ace_mode = "php"; }
elseif ($filename_extension == "phtml") { $ace_mode = "php"; }
elseif ($filename_extension == "py") { $ace_mode = "python"; }
elseif ($filename_extension == "ruby") { $ace_mode = "ruby"; }
elseif ($filename_extension == "sh") { $ace_mode = "sh"; }
elseif ($filename_extension == "sql") { $ace_mode = "sql"; }
elseif ($filename_extension == "txt") { $ace_mode = "text"; }
elseif ($filename_extension == "xml") { $ace_mode = "xml"; }
else { $ace_mode = "text"; }
}
else {
$ace_mode = "";
}
// -------------------------------------------------------------------------
// Variables for screen 1
// Read the remote file (edit), or read the local template (new file)
// -------------------------------------------------------------------------
if ($net2ftp_globals["screen"] == 1) {
// Template file
$templatefile = $net2ftp_globals["application_rootdir"] . "/modules/edit/template.txt";
// Edit: read the file from the FTP server
if ($net2ftp_globals["state2"] == "") {
$text = ftp_readfile("", $net2ftp_globals["directory"], $net2ftp_globals["entry"]);
if ($net2ftp_result["success"] == false) { return false; }
// Character encoding (requires multibyte string module to be installed)
// Detect the original encoding of the text, and change the encoding of the text to the encoding of the page
if (($net2ftp_globals["language"] == "ja" || $net2ftp_globals["language"] == "tc" || $net2ftp_messages["iso-8859-1"] == "UTF-8") && function_exists("mb_detect_encoding") == true) {
// Detect original encoding
$text_encoding_old = mb_detect_encoding($text, $textarea_encodings);
$text_encoding_selected = $text_encoding_old;
// If original encoding is detected and different from the page encoding, convert the text to the page encoding
if($text_encoding_old != "" && strcasecmp($text_encoding_old, $net2ftp_messages["iso-8859-1"]) != 0) {
$text = mb_convert_encoding($text, $net2ftp_messages["iso-8859-1"], $text_encoding_old);
}
// Detect original line break
if (strpos($text, "\r\n") !== false) { $line_break_old = "CRLF"; }
elseif (strpos($text, "\n") !== false) { $line_break_old = "LF"; }
elseif (strpos($text, "\r") !== false) { $line_break_old = "CR"; }
else { $line_break_old = "LF"; }
$line_break_selected = $line_break_old;
}
}
// New file: read the template file
elseif ($net2ftp_globals["state2"] == "newfile") {
$handle = fopen($templatefile, "r"); // Open the local template file for reading only
if ($handle == false) {
$errormessage = __("Unable to open the template file");
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
clearstatcache(); // for filesize
$text = trim(fread($handle, filesize($templatefile)));
if ($text == false) {
$errormessage = __("Unable to read the template file");
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
@fclose($handle);
}
// Save status
$savestatus = __("Status: This file has not yet been saved");
$savestatus_short = __("Not yet saved");
}
// -------------------------------------------------------------------------
// Variables for screen 2
// Change the textarea without saving the changes to the FTP server
// -------------------------------------------------------------------------
elseif ($net2ftp_globals["screen"] == 2) {
// For HTML WYSIWYG editors, split the HTML
if (($textareaType == "tinymce" || $textareaType == "ckeditor") && $text_splitted == "") {
$text_splitted = splitHtml($text, $textareaType);
}
// For other textareas, join the HTML
elseif (($textareaType == "plain" || $textareaType == "ace") && $text == "" && isset($text_splitted["top"]) == true) {
$text = $text_splitted["top"];
$text .= $text_splitted["middle"];
$text .= $text_splitted["bottom"];
}
// Save status
$savestatus = __("Status: This file has not yet been saved");
$savestatus_short = __("Not yet saved");
}
// -------------------------------------------------------------------------
// Variables for screen 3
// Save the changes to the FTP server
// -------------------------------------------------------------------------
elseif ($net2ftp_globals["screen"] == 3) {
// Check if a filename is specified
if (strlen($net2ftp_globals["entry"])<1) {
$errormessage = __("Please specify a filename");
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
// For HTML WYSIWYG editors, join the HTML
if ($textareaType == "tinymce" || $textareaType == "ckeditor") {
$text = $text_splitted["top"];
$text .= $text_splitted["middle"];
$text .= $text_splitted["bottom"];
}
// $text_file contains the text which is written to the FTP server
// It is equal to the text shown on screen, except if a different character encoding is chosen
$text_file = $text;
// Character encoding (requires multibyte string module to be installed)
// Change the encoding of the text from the original or page encoding to the selected encoding
if (($net2ftp_globals["language"] == "ja" || $net2ftp_globals["language"] == "tc" || $net2ftp_messages["iso-8859-1"] == "UTF-8") && function_exists("mb_detect_encoding") == true) {
$break_map = array("CRLF" => "\r\n", "CR" => "\r", "LF" => "\n");
if(isset($break_map[$line_break_new]) == true) {
$text_file = preg_replace('/(\\r\\n)|\\r|\\n/', $break_map[$line_break_new], $text_file);
}
if($text_encoding_new != "" && strcasecmp($text_encoding_new, $net2ftp_messages["iso-8859-1"]) != 0) {
$text_file = mb_convert_encoding($text_file, $text_encoding_new, $net2ftp_messages["iso-8859-1"]);
}
$text_encoding_selected = $text_encoding_new;
$line_break_selected = $line_break_new;
}
// Write the string to the FTP server
// Note: this function also replaces CarriageReturn+LineFeed by LineFeed
ftp_writefile("", $net2ftp_globals["directory"], $net2ftp_globals["entry"], $text_file);
if ($net2ftp_result["success"] == false) {
setErrorVars(true, "", "", "", ""); // Continue anyway and print warning message
$savestatus = __("Status: <b>This file could not be saved</b>");
$savestatus_short = __("Could not be saved");
}
else {
$mytime = mytime();
$mytime_short = mytime_short();
$ftpmode = ftpAsciiBinary($net2ftp_globals["entry"]);
if ($ftpmode == FTP_ASCII) { $printftpmode = "FTP_ASCII"; }
elseif ($ftpmode == FTP_BINARY) { $printftpmode = "FTP_BINARY"; }
$savestatus = __("Status: Saved on <b>%1\$s</b> using mode %2\$s", $mytime, $printftpmode);
$savestatus_short = __("Saved at %1\$s", $mytime_short);
}
}
// -------------------------------------------------------------------------
// Convert special characters to HTML entities
// -------------------------------------------------------------------------
// Plain textarea
if ($textareaType == "" || $textareaType == "plain") {
$text = htmlspecialchars($text, ENT_QUOTES);
}
// CKEditor
elseif ($textareaType == "ckeditor") {
$text_splitted["top"] = htmlspecialchars($text_splitted["top"], ENT_QUOTES);
$text_splitted["bottom"] = htmlspecialchars($text_splitted["bottom"], ENT_QUOTES);
// Do not encode the middle part, this is done by CKEditor itself
// $text_splitted["middle"] = htmlspecialchars($text_splitted["middle"], ENT_QUOTES);
}
// TinyMCE
elseif ($textareaType == "tinymce") {
$text_splitted["top"] = htmlspecialchars($text_splitted["top"], ENT_QUOTES);
$text_splitted["middle"] = htmlspecialchars($text_splitted["middle"], ENT_QUOTES);
$text_splitted["bottom"] = htmlspecialchars($text_splitted["bottom"], ENT_QUOTES);
}
// Ace
elseif ($textareaType == "ace") {
$text = htmlspecialchars($text, ENT_QUOTES);
$ace_onclick = "document.forms['" . $formname . "'].text.value=editor.getValue();";
}
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/edit.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function printTextareaSelect($onchange) {
// --------------
// This function prints a select with the available textareas
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_globals;
$pluginProperties = getPluginProperties();
if (isset($_POST["textareaType"]) == true) { $textareaType = validateTextareaType($_POST["textareaType"]); }
else { $textareaType = ""; }
$filename_extension = get_filename_extension($net2ftp_globals["entry"]);
// Convert *htm* to html
if (strpos($filename_extension, "htm") !== false) { $filename_extension = "html"; }
echo "<select name=\"textareaSelect\" id=\"textareaSelect\" onchange=\"$onchange\">\n";
if ($textareaType == "" || $textareaType == "plain") { $plainselected = "selected=\"selected\""; }
echo "<option value=\"plain\" $plainselected>Normal textarea</option>\n";
while(list($pluginName, $value) = each($pluginProperties)) {
// Print only the plugins which have 'use' set to yes
// which are textareas
// which are suitable for this browser
// which are suitable for this type of file
if ($pluginProperties[$pluginName]["use"] == "yes" && $pluginProperties[$pluginName]["type"] == "textarea" && in_array($net2ftp_globals["browser_agent"], $pluginProperties[$pluginName]["browsers"]) == true && in_array($filename_extension, $pluginProperties[$pluginName]["filename_extensions"]) == true) {
if ($pluginName == $textareaType) { $selected = "selected=\"selected\""; }
else { $selected = ""; }
echo "<option value=\"$pluginName\" $selected>" . $pluginProperties[$pluginName]["label"] . "</option>\n";
} // end if
} // end while
echo "</select>\n";
} // End function printTextareaSelect
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function printEncodingSelect($text_encoding) {
// --------------
// This function prints a select with the available encodings
// --------------
global $net2ftp_globals, $net2ftp_messages;
if (($net2ftp_globals["language"] == "ja" || $net2ftp_globals["language"] == "tc" || $net2ftp_messages["iso-8859-1"] == "UTF-8") && function_exists("mb_detect_encoding") == true) {
$textarea_encodings = getTextareaEncodingsArray();
echo "<select name=\"encodingSelect\" id=\"encodingSelect\" style=\"width: 100px;\">\n";
foreach($textarea_encodings as $value) {
if(strcasecmp($value, $text_encoding) == 0) { $selected = "selected=\"selected\""; }
else { $selected = ""; }
echo "<option value=\"$value\" $selected>$value</option>\n";
}
echo "</select>\n";
}
} // End function printEncodingSelect
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function printLineBreakSelect($line_break) {
// --------------
// This function prints a select with the available line-break sequences.
// --------------
global $net2ftp_messages, $net2ftp_globals;
if (($net2ftp_globals["language"] == "ja" || $net2ftp_globals["language"] == "tc" || $net2ftp_messages["iso-8859-1"] == "UTF-8") && function_exists("mb_detect_encoding") == true) {
echo "<select name=\"breakSelect\" id=\"breakSelect\" style=\"width: 60px;\">\n";
foreach(array("CRLF", "CR", "LF") as $value) {
if(strcasecmp($value, $line_break) == 0) { $selected = "selected=\"selected\""; }
else { $selected = ""; }
echo "<option value=\"$value\" $selected>$value</option>\n";
}
echo "</select>\n";
}
} // End function printLineBreakSelect
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function getTextareaEncodingsArray() {
// --------------
// This function returns an array which contains the possible character encodings
// See the "Supported Character Encodings" section at http://www.php.net/manual/en/ref.mbstring.php
// --------------
global $net2ftp_globals;
if ($net2ftp_globals["language"] == "ja") {
$textarea_encodings[] = "UTF-8";
$textarea_encodings[] = "EUC-JP";
$textarea_encodings[] = "SJIS";
}
elseif ($net2ftp_globals["language"] == "tc" || $net2ftp_globals["language"] == "zh") {
$textarea_encodings[] = "UTF-8";
$textarea_encodings[] = "BIG-5";
}
else {
// BIG-5 must be before SJIS, otherwise BIG-5 text is incorrectly identified as SJIS
$textarea_encodings[] = "UTF-8";
$textarea_encodings[] = "ISO-8859-1";
}
/*
$textarea_encodings[] = "ISO-8859-1";
$textarea_encodings[] = "UCS-4";
$textarea_encodings[] = "UCS-4BE";
$textarea_encodings[] = "UCS-4LE";
$textarea_encodings[] = "UCS-2";
$textarea_encodings[] = "UCS-2BE";
$textarea_encodings[] = "UCS-2LE";
$textarea_encodings[] = "UTF-32";
$textarea_encodings[] = "UTF-32BE";
$textarea_encodings[] = "UTF-32LE";
$textarea_encodings[] = "UTF-16";
$textarea_encodings[] = "UTF-16BE";
$textarea_encodings[] = "UTF-16LE";
$textarea_encodings[] = "UTF-7";
$textarea_encodings[] = "UTF7-IMAP";
$textarea_encodings[] = "UTF-8";
$textarea_encodings[] = "ASCII";
$textarea_encodings[] = "EUC-JP";
$textarea_encodings[] = "SJIS";
$textarea_encodings[] = "eucJP-win";
$textarea_encodings[] = "SJIS-win";
$textarea_encodings[] = "ISO-2022-JP";
$textarea_encodings[] = "JIS";
$textarea_encodings[] = "ISO-8859-2";
$textarea_encodings[] = "ISO-8859-3";
$textarea_encodings[] = "ISO-8859-4";
$textarea_encodings[] = "ISO-8859-5";
$textarea_encodings[] = "ISO-8859-6";
$textarea_encodings[] = "ISO-8859-7";
$textarea_encodings[] = "ISO-8859-8";
$textarea_encodings[] = "ISO-8859-9";
$textarea_encodings[] = "ISO-8859-10";
$textarea_encodings[] = "ISO-8859-13";
$textarea_encodings[] = "ISO-8859-14";
$textarea_encodings[] = "ISO-8859-15";
$textarea_encodings[] = "byte2be";
$textarea_encodings[] = "byte2le";
$textarea_encodings[] = "byte4be";
$textarea_encodings[] = "byte4le";
$textarea_encodings[] = "BASE64";
$textarea_encodings[] = "HTML-ENTITIES";
$textarea_encodings[] = "7bit";
$textarea_encodings[] = "8bit";
$textarea_encodings[] = "EUC-CN";
$textarea_encodings[] = "CP936";
$textarea_encodings[] = "HZ";
$textarea_encodings[] = "EUC-TW";
$textarea_encodings[] = "CP950";
$textarea_encodings[] = "EUC-KR";
$textarea_encodings[] = "UHC (CP949)";
$textarea_encodings[] = "ISO-2022-KR";
$textarea_encodings[] = "Windows-1251 (CP1251)";
$textarea_encodings[] = "Windows-1252 (CP1252)";
$textarea_encodings[] = "CP866 (IBM866)";
$textarea_encodings[] = "KOI8-R";
*/
return $textarea_encodings;
} // End function getTextareaEncodingsArray
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function syntaxTextareaEncode($string) {
// --------------
// Replace tabs, line-feeds and carriage-returns by \t and \n respectively.
// --------------
$tab = chr(9);
$lf = chr(10);
$cr = chr(13);
$newstring = $string;
// Replace \' and '
$newstring = str_replace("\'", "\\\'", $newstring);
$newstring = str_replace("'", "\'", $newstring);
// Replace $cr$lf by $lf
$newstring = str_replace("$cr$lf", "$lf", $newstring);
// Replace $lf and $tab
$newstring = str_replace($lf, "\\n", $newstring);
$newstring = str_replace($tab, "\\t", $newstring);
return $newstring;
} // end syntaxTextareaEncode
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function splitHtml($text, $textareaType) {
// --------------
// This function reads an HTML file, and returns the head and the body parts.
// --------------
$pattern = "/(.*?)<body([^\\>]*)\\>(.*)\\<\\/body\\>(.*)/is";
// Everything before the <body tag ==> {1}
// Start of the body tag <body
// Body tag contents ==> {2}
// Body contents ==> {3}
// </body> tag
// Stuff after the </body> tag ==> {4}
$preg_match_result = preg_match($pattern, $text, $matches);
if ($preg_match_result != 0) {
$text_splitted["top"] = $matches[1];
$text_splitted["top"] .= "<body" . $matches[2] . ">";
$text_splitted["middle"] = $matches[3];
$text_splitted["bottom"] = "</body>" . $matches[4];
}
else {
$text_splitted["top"] = "";
$text_splitted["middle"] = $text;
$text_splitted["bottom"] = "";
}
return $text_splitted;
} // end splitHtml
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,22 +0,0 @@
function toggleTextarea(name) {
var name_shown = name + '_shown';
var name_hidden = name + '_hidden';
if (document.getElementById) {
var element_shown = document.getElementById(name_shown);
var element_hidden = document.getElementById(name_hidden);
}
else if (document.all) {
var element_shown = document.all[name_shown];
var element_hidden = document.all[name_hidden];
}
if(element_shown.style.display == "none" || element_shown.style.display == false) {
element_shown.style.display = "block";
element_hidden.style.display = "none";
}
else if(element_shown.style.display == "block") {
element_shown.style.display = "none";
element_hidden.style.display = "block";
}
}

View file

@ -1,3 +0,0 @@
[Enter code here]

View file

@ -1,280 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/findstring/findstring.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the search screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
if (isset($_POST["list"]) == true) { $list = getSelectedEntries($_POST["list"]); }
else { $list = ""; }
if (isset($_POST["searchoptions"]) == true) { $searchoptions = $_POST["searchoptions"]; }
if (isset($searchoptions["string"]) == false) { $searchoptions["string"] = ""; }
if (isset($searchoptions["case_sensitive"]) == false) { $searchoptions["case_sensitive"] = ""; }
if (isset($searchoptions["filename"]) == false) { $searchoptions["filename"] = ""; }
if (isset($searchoptions["size_from"]) == false) { $searchoptions["size_from"] = ""; }
if (isset($searchoptions["size_to"]) == false) { $searchoptions["size_to"] = ""; }
if (isset($searchoptions["modified_from"]) == false) { $searchoptions["modified_from"] = ""; }
if (isset($searchoptions["modified_to"]) == false) { $searchoptions["modified_to"] = ""; }
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
// Title
// See below
// Form name, back and forward buttons
$formname = "FindstringForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
$forward_onclick = "document.forms['" . $formname . "'].submit();";
// Next screen
$nextscreen = 2;
// -------------------------------------------------------------------------
// Variables for screen 1
// -------------------------------------------------------------------------
if ($net2ftp_globals["screen"] == 1) {
// Title
$title = __("Search directories and files");
// From and to dates
$tomorrow = date("Y-m-d", time() + 3600*24);
$oneweekago = date("Y-m-d", time() - 3600*24*7);
$modified_from = $oneweekago;
$modified_to = $tomorrow;
} // end if
// -------------------------------------------------------------------------
// Variables for screen 2
// -------------------------------------------------------------------------
elseif ($net2ftp_globals["screen"] == 2) {
// Title
$title = __("Search results");
// Check if $searchoptions["string"] is a valid string
if (is_string($searchoptions["string"]) == false) {
$errormessage = __("Please enter a valid search word or phrase.");
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
// Check if $searchoptions["filename"] is a valid filename with a possible wildcard character *
if ($searchoptions["filename"] != "" && preg_match("/^[a-zA-Z0-9_ *\.-]*$/", $searchoptions["filename"]) == 0) {
$errormessage = __("Please enter a valid filename.");
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
// Check if $searchoptions["size_from"] and $searchoptions["size_to"] are valid numbers
if ($searchoptions["size_from"] != "" && is_numeric($searchoptions["size_from"]) == false) {
$errormessage = __("Please enter a valid file size in the \"from\" textbox, for example 0.");
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
if ($searchoptions["size_to"] != "" && is_numeric($searchoptions["size_to"]) == false) {
$errormessage = __("Please enter a valid file size in the \"to\" textbox, for example 500000.");
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
// Check if $searchoptions["modified_from"] and $searchoptions["modified_to"] are valid dates
if ($searchoptions["modified_from"] != "" && preg_match("/^[0-9-]*$/", $searchoptions["modified_from"]) == 0) {
$errormessage = __("Please enter a valid date in Y-m-d format in the \"from\" textbox.");
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
if ($searchoptions["modified_to"] != "" && preg_match("/^[0-9-]*$/", $searchoptions["modified_to"]) == 0) {
$errormessage = __("Please enter a valid date in Y-m-d format in the \"to\" textbox.");
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
// ------------
// CONVERSIONS
// ------------
// Convert the wildcard character * in the filename by the wildcard .* that can be read by preg_match
// So this *.* becomes this .*..*
$searchoptions["filename"] = str_replace("*", ".*", $searchoptions["filename"]);
// Convert the mtime to a unix timestamp
$searchoptions["modified_from"] = strtotime($searchoptions["modified_from"]);
$searchoptions["modified_to"] = strtotime($searchoptions["modified_to"]);
// Open connection
setStatus(2, 10, __("Connecting to the FTP server"));
$conn_id = ftp_openconnection();
if ($net2ftp_result["success"] == false) { return false; }
// Find the files
$result = array();
setStatus(4, 10, __("Searching the files..."));
$result = ftp_processfiles("findstring", $conn_id, $net2ftp_globals["directory"], $list, $searchoptions, $result, 0);
if ($net2ftp_result["success"] == false) { return false; }
// Close connection
ftp_closeconnection($conn_id);
if (sizeof($result) == 0) {
$net2ftp_output["findstring"][] = __("The word <b>%1\$s</b> was not found in the selected directories and files.", $searchoptions["string"]);
}
else {
$net2ftp_output["findstring"][] = __("The word <b>%1\$s</b> was found in the following files:", $searchoptions["string"]);
for ($i=0; $i<sizeof($result); $i++) {
$net2ftp_output["findstring"][] = glueDirectories($result[$i]["directory"], $result[$i]["dirfilename"]) . " line " . $result[$i]["line"];
} // end for
}
} // end if
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,9 +0,0 @@
function submitFindstringForm(directory, entry, state, state2, screen) {
document.forms['FindstringForm'].directory.value=directory;
document.forms['FindstringForm'].entry.value=entry;
document.forms['FindstringForm'].state.value=state;
document.forms['FindstringForm'].state2.value=state2;
document.forms['FindstringForm'].screen.value=screen;
document.forms['FindstringForm'].submit();
}

View file

@ -1,120 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// -------------------------------------------------------------------------
// Construct the symlink target
// -------------------------------------------------------------------------
// A symlink has $entry = FreeBSD -> mirror/ftp.freebsd.org/pub/FreeBSD
// Get the 1st part before the "->" (this is what we need to access, not the 2nd part)
$pos = strpos($net2ftp_globals["entry"], " -> ");
$entry_part1 = substr($net2ftp_globals["entry"], 0, $pos);
// Glue the current directory with the symlink
// and resolve the .. which it may contain (this is done by validateDirectory)
$symlinktarget = validateDirectory(glueDirectories($net2ftp_globals["directory"], $entry_part1));
// -------------------------------------------------------------------------
// Check if the symlink points to a directory
// -------------------------------------------------------------------------
// ------------------------------------
// Open connection
// ------------------------------------
$conn_id = ftp_openconnection();
if ($net2ftp_result["success"] == false) { return false; }
// ------------------------------------
// Get raw list of directories and files
// ------------------------------------
$list = ftp_getlist($conn_id, $symlinktarget);
if ($net2ftp_result["success"] == false) {
$is_directory = false;
setErrorVars(true, "", "", "", "");
}
else {
$is_directory = true;
}
// ------------------------------------
// Close connection
// ------------------------------------
ftp_closeconnection($conn_id);
// -------------------------------------------------------------------------
// Directory (main or popup): redirect to Browse page
// -------------------------------------------------------------------------
if ($is_directory == true) {
$action_url = printPHP_SELF("actions");
$action_url = str_replace("&amp;", "&", $action_url);
header("Location: " . $action_url . "&state=browse&state2=" . $net2ftp_globals["state2"] . "&directory=" . $symlinktarget);
}
// -------------------------------------------------------------------------
// File (popup): redirect to Browse page of same directory
// -------------------------------------------------------------------------
elseif ($net2ftp_globals["state2"] == "popup") {
$action_url = printPHP_SELF("actions");
$action_url = str_replace("&amp;", "&", $action_url);
header("Location: " . $action_url . "&state=browse&state2=" . $net2ftp_globals["state2"] . "&directory=" . $net2ftp_globals["directory"]);
}
// -------------------------------------------------------------------------
// File (main): download the file
// -------------------------------------------------------------------------
elseif ($net2ftp_globals["state2"] == "main") {
if ($net2ftp_settings["functionuse_downloadfile"] == "yes") {
$newdirectory = dirname($symlinktarget);
$newfile = basename($symlinktarget);
ftp_downloadfile($newdirectory, $newfile);
}
else {
$errormessage = __("This function has been disabled by the Administrator of this website.");
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
}
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,136 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the login screen
// --------------
global $net2ftp_globals;
require_once($net2ftp_globals["application_skinsdir"] . "/openlaszlo/getcookies.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,129 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" dir="ltr">
<head>
<title>net2ftp help</title>
<link rel="stylesheet" type="text/css" href="main.css.php?ltr=ltr" />
</head>
<body style="margin-left: 70px; margin-right: 70px;">
<div style="border: 1px solid black; background-color: #CCCCCC; padding: 10px; margin-top: 20px;">
Welcome! The purpose of these pages is to provide help for the 3 kinds of people using net2ftp:
<ul>
<li> <a href="02-user.html">Users</a> - how to upload files, how to copy a directory</li>
<li> <a href="03-administrator.html">Administrators</a> - how to install net2ftp on your own web server</li>
<li> <a href="04-developer.html">Developers</a> - how the code is structured</li>
</ul>
</div>
<br />
Follow the links above to go to the section that you're interested in, or continue to read below for a brief explanation of what is net2ftp.
<br /><br />
<div style="text-align: center;">
<script type="text/javascript"><!--
google_ad_client = "pub-8420366685399799";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="4549075632";
google_color_border = "E5E5E5";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<br />
<div class="header21">What is net2ftp?</div>
<b>net2ftp is a web-based FTP client written in PHP.</b>
Lets explain this in detail.
<i>Web-based</i> means that net2ftp runs on a web server, and that you use a browser (for example Internet Explorer or Mozilla).
<i>FTP</i> is the communication method to access files on a remote computer. You need it to access your files on the account given by your provider to host your homepage. FTP is different from HTTP in that it was made specially to transfer (big) files. If a transfer is interrupted, with FTP you can resume it where it broke off, whereas with HTTP you can not.
<i>PHP</i> is a programming language that is used to make dynamic websites.
<br /><br />
You can use net2ftp at <a href="http://www.net2ftp.com">http://www.net2ftp.com</a>, or you can install it on your own web server and use it from there.
<br /><br />
<div class="header21">User features</div>
<ul>
<li> Navigate the FTP server<br /> <span style="font-size: 80%;">
Once you have logged in, you can browse from directory to directory and see all the subdirectories and files.</span></li>
<li> Upload files<br /> <span style="font-size: 80%;">
There are 3 different ways to upload files: the standard upload form, the upload-and-unzip functionality, and the Java Applet.</span></li>
<li> Download files<br /> <span style="font-size: 80%;">
Click on a filename to quickly download one file.<br />
Select multiple files and click on Download; the selected files will be downloaded in a zip archive.</span></li>
<li> Zip files<br /> <span style="font-size: 80%;">
... and save the zip archive on the FTP server, or email it to someone.</span></li>
<li> Unzip files<br /> <span style="font-size: 80%;">
Different formats are supported: .zip, .tar, .tgz and .gz.</span></li>
<li> Install software<br /> <span style="font-size: 80%;">
Choose from a list of popular applications (PHP required on the target server).</span></li>
<li> Copy, move and delete<br /> <span style="font-size: 80%;">
Directories are handled recursively, meaning that their content
(subdirectories and files) will also be copied, moved or deleted.</span></li>
<li> Copy or move to a 2nd FTP server<br /> <span style="font-size: 80%;">
Handy to import files to your FTP server, or to export files from your FTP server to another FTP server.</span></li>
<li> Rename and chmod<br /> <span style="font-size: 80%;">
Chmod handles directories recursively.</span></li>
<li> View code with syntax highlighting<br /> <span style="font-size: 80%;">
PHP functions are linked to the documentation on php.net.</span></li>
<li> Plain text editor<br /> <span style="font-size: 80%;">
Edit text right from your browser; every time you save the changes the new file is transferred to the FTP server.</span></li>
<li> HTML editors<br /> <span style="font-size: 80%;">
Edit HTML a What-You-See-Is-What-You-Get (WYSIWYG) form; there are 2 different editors to choose from (FCKEditor and TinyMCE).</span></li>
<li> Code editor<br /> <span style="font-size: 80%;">
Edit HTML and PHP in an editor with syntax highlighting (CodePress).</span></li>
<li> Search for words or phrases<br /> <span style="font-size: 80%;">
Filter out files based on the filename, last modification time and filesize.</span></li>
<li> Calculate size<br /> <span style="font-size: 80%;">
Calculate the size of directories and files.</span></li>
</ul>
<br />
<div class="header21">Administrator features</div>
<ul>
<li> Safe Mode<br /> <span style="font-size: 80%;">
net2ftp works perfectly under safemode.</span></li>
<li> MySQL database<br /> <span style="font-size: 80%;">
... is optional. A MySQL database is only needed for logging, and for the Daily Limit (see below).</span></li>
<li> Authorizations<br /> <span style="font-size: 80%;">
Allow the users to connect to all FTP servers, or to only a predefined list of FTP servers.<br />
The input box on the login page will change accordingly.</span></li>
<li> Logging<br /> <span style="font-size: 80%;">
Activate or deactivate 3 kinds of logging: pages requested, logins and errors.</span></li>
<li> Daily Limit<br /> <span style="font-size: 80%;">
Restrict each user's daily data transfer volume and script execution
time. Once a user reaches the daily consumption limit, he will still be
able to browse FTP servers, but the transfer of data to/from the server
will be blocked.</span></li>
<li> Large File Limit<br /> <span style="font-size: 80%;">
Files bigger than this limit can't be downloaded/uploaded/copied/etc
but can still be renamed/deleted/chmodded.</span></li>
<li> Banned keywords<br /> <span style="font-size: 80%;">
Directories and files containing banned keywords can't be processed.
This is to avoid net2ftp being used to upload Paypal and Ebay scams.</span></li>
<li> Templates<br /> <span style="font-size: 80%;">
Change the layout of net2ftp as you want using the template files.</span></li>
<li> Integration in other PHP applications<br /> <span style="font-size: 80%;">
net2ftp can easily be integrated in other PHP applications.
Modules for <a href="http://www.mamboserver.com">Mambo</a>, <a href="http://www.drupal.org">Drupal</a> and <a href="http://www.xoops.org">Xoops</a> are provided in the zip file.</span></li>
</ul>
<br /><br /><br /><br />
</body>
</html>

View file

@ -1,259 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" dir="ltr">
<head>
<title>net2ftp help</title>
<link rel="stylesheet" type="text/css" href="main.css.php?ltr=ltr" />
</head>
<body style="margin-left: 70px; margin-right: 70px;">
<div class="header21">What is FTP?</div>
You want to build a website, so you start creating web pages on your computer.<br /><br />
Next, you need to publish them: you need to put those pages on a web server so that everyone would be able to view them.<br /><br />
To transfer the files from your computer to that web server, a special protocol (transfer method) is used: FTP - the File Transfer Protocol.
This protocol was designed to be able to handle big files; it can for example resume a transfer if it was interrupted in the middle.
<br /><br />
<div style="text-align: center;">
<script type="text/javascript"><!--
google_ad_client = "pub-8420366685399799";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="4568160369";
google_color_border = "E5E5E5";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<br />
<div class="header21">What is net2ftp?</div>
The normal way to connect to your FTP server is to use an FTP client and to communicate via the FTP protocol. This is however not always possible:
<ul>
<li>you may be behind a corporate firewall at work, which may block the FTP communications;</li>
<li>you may be on holiday and connecting to the internet via a CyberCafe, where you may not be allowed to install an FTP client.</li>
</ul><br />
When you use net2ftp these problems are solved: you connect to net2ftp using a regular web browser, and net2ftp translates your requests and takes care of the FTP communication.<br /><br />
net2ftp also provides additional features, on top of the regular FTP features: the possibility to edit code using your web browser, to view the code with syntax highlighting, to upload-and-unzip archives, and to search for words on the FTP server.<br /><br />
<br /><br />
<div class="header21">Icons used</div>
net2ftp uses the beautiful icons made by <a href="http://www.icon-king.com">David Vignoni</a> for <a href="http://www.kde.org">KDE</a>.<br /><br />
Their meaning should be pretty straight-forward, but just in case, here are the conventions used:<br /><br />
<img src="../../skins/blue/images/actions/back.png" alt="Icon" /> Cancel and go back<br />
<img src="../../skins/blue/images/actions/button_ok.png" alt="Icon" /> Execute the action<br />
<img src="../../skins/blue/images/actions/filesave.png" alt="Icon" /> Save the file<br />
<img src="../../skins/blue/images/actions/bookmark.png" alt="Icon" /> Bookmark the page<br />
<img src="../../skins/blue/images/actions/reload.png" alt="Icon" /> Refresh the page<br />
<img src="../../skins/blue/images/actions/exit.png" alt="Icon" /> Logout<br /><br />
All icons will also display a tooltip with additional information if you keep your mouse pointer on the button for a second, without clicking on it.<br />
Try with this icon: <img src="../../skins/blue/images/actions/bookmark.png" alt="Bookmark this page" />
<br /><br />
<div style="font-size: 80%; margin-left: 20px;">
Note: these PNG icons have transparent regions which are not displayed correctly on Internet Explorer on this Help page: the transparent regions appear as grey.
This is a bug specific to Internet Explorer; refer to the <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294714">Microsoft website</a> for more details.
In net2ftp itself however, a fix has been applied which corrects this.
</div>
<br /><br />
<div class="header21">Logging in</div>
Enter your FTP server, username and password.
The FTP server name can be "ftp.my-domain.com" if you have your own domain name.
If you don't have your own domain name, then it depends on your web hosting company.
It can be for example "ftp.geocities.com" or "ftp-www.earthlink.net".
<br /><br />
If you don't know your FTP server, username or password, then check out the support pages of your hosting company or contact their helpdesk.<br />
<br /><br />
<div class="header21">Browsing the FTP server</div>
The first time you log in, you will see the contents of the root directory "/".
To go to a subdirectory, simply click on the subdirectory's name.
To go up to the parent directory, click on the top row with the label Up.
<br /><br />
If you know the name of the subdirectory you want to go to, you can also enter that name directly in the textbox on top of the page, and press ENTER.<br />
If you don't know the name exactly, click on <img src="../../skins/blue/images/actions/view_tree.png" alt="Icon" />.
A window will pop up, which allows you to browse the FTP server and choose a directory.
Double-click on a subdirectory to go to that subdirectory. To go up, double-click on "..".
Once you are in the subdirectory you wanted to find, click on Choose.
The subdirectory name will be copied from the popup to the main window.
<br /><br />
It can happen that the FTP server returns the list of directories and files in an uncommon format.
In that case net2ftp shows you the lines bottom of the screen, under the heading "FTP server's output which is not recognized is shown below".
<br /><br />
If you want this fixed please contact the net2ftp developers.
They will analyse the output of your FTP server and improve the way net2ftp scans it.
<br /><br />
<div class="header21">Upload files, upload-and-unzip archives</div>
On the Browse Screen, click on the Upload button to go to the Upload Screen.<br /><br />
There is one column on the left to upload files, and there can also be a right column to upload-and-unzip archives.<br /><br />
Click on the Browse button to specify which file on your computer you want to upload or upload-and-unzip to the FTP server.<br /><br />
Once you are ready to start the upload, click on <img src="../../skins/blue/images/actions/button_ok.png" alt="Icon" />.<br /><br />
The result screen will tell you if the upload was successful or not.<br />
To upload a file, you need write permissions on that directory of the FTP server. <br />
The file should also not be too big, as on most web servers the execution time of a script may be limited to 30 seconds.<br />
<br /><br />
<div class="header21">Upload files using a Java applet (JUpload)</div>
On the Browse Screen, click on the Java Upload button.<br /><br />
Click on the Add button to add directories and files to the upload queue (top left).<br />
When you select a directory, all the files inside will be transferred, and subdirectories will be created automatically.<br /><br />
Once you are ready to start the upload, click on the Upload button.<br /><br />
The results of the upload are printed just below the upload queue (bottom left).<br />
Two upload progress bars are displayed on the right: one indicating the progress of the current file, and the other indicating the total progress.<br /><br />
As for the normal upload, the maximum filesize and maximum execution time is limited; by default this is 2 MB and 30 seconds.<br />
If the total size of the files in the upload queue is larger than a certain limit, the Java Applet will split the request in several smaller parts.<br />
<br /><br />
<div class="header21">Downloading and zipping</div>
To download a file, simply click on its filename.<br /><br />
To zip-and-download files and directories, select them on the Browse Screen and click on Download.<br />
The directories and their contents will be retrieved and zipped.<br />
A popup window will ask you where you would like to save the Zip file on your computer.<br /><br />
Note that if the files inside are too big, the script will timeout and you won't be able to download anything.<br />
If this happens, try again with less directories and omit those which contain big files.<br /><br />
You can also zip files and email them in attachment, or save them on the FTP server.<br />
On the Browse Screen, select the directories and files and click on Zip.<br />
<br /><br />
<div class="header21">View code with syntax highlighting</div>
On the Browse Screen, click on the View link on the same line as the filename.<br />
<br /><br />
<div class="header21">Edit text</div>
On the Browse Screen, click on the Edit link on the same line as the filename.<br />
Edit the text and press <img src="../../skins/blue/images/actions/filesave.png" alt="Icon" /> to save the changes (you'll need write permissions for that). <br /><br />
Depending on the type of file you're editing, alternative textareas can be used:<br />
<ul>
<li> For HTML files, there are 2 WYSIWYG (What-You-See-Is-What-You-Get) textareas: <a href="http://www.fckeditor.net">FCKEditor</a> and <a href="http://tinymce.moxiecode.com/">TinyMCE</a>. </li>
<li> To edit code with syntax highlighting use CodePress; it can highlight PHP, Javascript, Java and HTML code. </li>
</ul>
<br /><br />
<div class="header21">Copy, move, delete</div>
Select some files or directories and click on the Copy, Move or Delete button.<br /><br />
If you copy or move, then choose the target directory.
This can be different for each directory or file that you selected.
To set all target directories to the same value, enter the target directory in the top textbox and click on the button "Set all targetdirectories".<br /><br />
If you don't know the exact name of the target directory, click on <img src="../../skins/blue/images/actions/view_tree.png" alt="Icon" />. A window will pop up, which allows you to browse the FTP server and choose a directory. Double-click on a subdirectory to go to that subdirectory. To go up, double-click on "..". Once you are in the subdirectory you wanted to find, click on Choose. The subdirectory name will be copied from the popup to the main window.<br />
To copy or move files to a second FTP server, enter the FTP server name, username and password on top.<br />
You need write permissions to be able to copy or move files to a directory.<br /><br />
Once you are ready, click on <img src="../../skins/blue/images/actions/button_ok.png" alt="Icon" />.<br /><br />
The result screen will tell you if the action was successful or not.
If the files were too big, the script will run until the timeout is reached.
On most web servers the execution time of a script is limited to 30 seconds.
<br /><br />
<div class="header21">Rename</div>
Select directories or files and click on Rename on the Browse Screen.<br />
The next screen will ask for the new names.<br />
Fill these in and click on <img src="../../skins/blue/images/actions/button_ok.png" alt="Icon" />.
<br /><br />
<div class="header21">Chmod</div>
Select directories or files and click on Chmod on the Browse Screen.<br />
The next screen show the current permissions; select or unselect the checkboxes which represent a permission.<br />
Click on <img src="../../skins/blue/images/actions/button_ok.png" alt="Icon" />.<br /><br />
Note that for the moment directories are not chmodded recursively -- subdirectories and files will remain unaffected. In the future, recursive chmodding will be added to net2ftp.<br />
<br /><br />
<div class="header21">Update a file (beta function)</div>
This function is still in development, use it at your own risk. It can be activated or deactivated by the administrator in settings.inc.php.<br /><br />
The purpose of this function is to merge a new version of a text file with an older version stored on the FTP server.<br /><br />
On the Browse Screen, click on Update link on the same line as the filename.<br />
<ul>
<li> First, upload the new file.</li>
<li> net2ftp will compare the old file stored on the FTP server with the new file that was uploaded, and a the code will be printed the changes highlighted in red and green.
There are only 2 kinds of changes: a line can be deleted or added -- more complex changes such as move or edit are not foreseen, they're handled as a delete + an add.
Select the changes and indicate if you accept or reject them. By default all changes are marked as accepted.</li>
<li> Once you're done, submit the page, and the merged text will be shown in the Edit Screen.
At this point, nothing is saved yet, the original file is not yet overwritten. Once you've reviewed the changes, save them.</li>
</ul>
<br /><br />
<div class="header21">Access keys</div>
Since version 0.81, most actions can be executed with the keyboard.<br />
On Windows, use ALT + a letter. On Apple computers, use CTRL + a letter.<br />
On Internet Explorer, ALT + a letter will only focus on the page element; press ENTER to execute the action.<br /><br />
Which letter can be used is shown in the tooltip.<br />
For example: to go back, the tooltip is "Back (accesskey b)".<br />
To display a tooltip, leave your mouse cursor for a few seconds over an icon or link without clicking it.<br /><br />
Internet Explorer, Netscape and Mozilla browsers support Access Keys, but Opera doesn't.
<br /><br />
<div class="header21">Daily consumption limit</div>
Since version 0.81, the Administrator can choose to restrict each user's daily data transfer volume and script execution time.<br />
By default the data transfer volume is set to 50 MB per day and the script execution time to 2500 seconds per day - but this may be changed by the Administrator.<br />
Both figures are logged per IP address, and per FTP server.<br /><br />
Once the daily consumption limit is reached, you will still be able to browse FTP servers, but the transfer of data to/from the server will be blocked.<br />
If you need unrestricted access to net2ftp, contact your net2ftp Administrator or install net2ftp on your own web server.<br />
<br /><br /><br /><br />
</body>
</html>

View file

@ -1,179 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" dir="ltr">
<head>
<title>net2ftp help</title>
<link rel="stylesheet" type="text/css" href="main.css.php?ltr=ltr" />
</head>
<body style="margin-left: 70px; margin-right: 70px;">
<div class="header21">Web server requirements</div>
<ul>
<li> Web server: any web server which can run PHP. The most popular one is <a href="http://httpd.apache.org" target="_blank">Apache</a>.</li>
<li> <a href="http://www.php.net" target="_blank">PHP</a>: at least version 4.2.3. net2ftp works under <a href="http://www.php.net/manual/en/features.safe-mode.php" target="_blank">Safe Mode</a>. One advanced feature requires PHP 5 (send raw FTP command).</li>
<li> Disk space: 7.5 MB for net2ftp (less if you remove the plugins), and a few MB for the temporary files.</li>
</ul>
<br />
<div style="text-align: center;">
<script type="text/javascript"><!--
google_ad_client = "pub-8420366685399799";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQidTQgAIaCDFyD7PiBqtPKN2uuIEB";
google_ad_channel = "0194414494";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<br />
<div class="header21">Installation procedure</div>
<br />
1 - Unzip all the files on your computer, and upload them to your server.<br /><br />
2 - The /temp directory should be chmodded to 777 (you can use <a href="http://www.net2ftp.com">net2ftp.com</a> to do this).<br /><br />
3 - Set your settings in the settings.inc.php file; read "Next steps" below for more details.<br /><br />
4 - A database is only required if you want to log the actions of the users. To create the tables, execute the SQL queries below (also in the "create_tables.sql" file). This can be done easily in <a href="http://www.phpmyadmin.net/" target="_blank">PhpMyAdmin</a>, the popular front-end to MySQL.<br />
<br />
<textarea cols="70" rows="8" style="white-space: nowrap;">
DROP TABLE IF EXISTS `net2ftp_logAccess`;
DROP TABLE IF EXISTS `net2ftp_log_access`;
CREATE TABLE `net2ftp_log_access` (`id` int(10) unsigned NOT NULL auto_increment,`date` date NOT NULL default '0000-00-00',`time` time NOT NULL default '00:00:00',`remote_addr` text NOT NULL,`remote_port` text NOT NULL,`http_user_agent` text NOT NULL,`page` text NOT NULL,`datatransfer` int(10) unsigned default '0',`executiontime` mediumint(8) unsigned default '0',`ftpserver` text NOT NULL,`username` text NOT NULL,`state` text NOT NULL,`state2` text NOT NULL,`screen` text NOT NULL,`directory` text NOT NULL,`entry` text NOT NULL,`http_referer` text NOT NULL,KEY `index1` (`id`)) TYPE=MyISAM;
DROP TABLE IF EXISTS `net2ftp_logError`;
DROP TABLE IF EXISTS `net2ftp_log_error`;
CREATE TABLE `net2ftp_log_error` (`date` date NOT NULL default '0000-00-00',`time` time NOT NULL default '00:00:00',`ftpserver` text NOT NULL,`username` text NOT NULL,`message` text NOT NULL,`backtrace` text NOT NULL,`state` text NOT NULL,`state2` text NOT NULL,`directory` text NOT NULL,`remote_addr` text NOT NULL,`remote_port` text NOT NULL,`http_user_agent` text NOT NULL,KEY `index1` (`date`,`time`,`ftpserver`(100),`username`(50))) TYPE=MyISAM;
DROP TABLE IF EXISTS `net2ftp_logConsumptionFtpserver`;
DROP TABLE IF EXISTS `net2ftp_log_consumption_ftpserver`;
CREATE TABLE `net2ftp_log_consumption_ftpserver`(`date` date NOT NULL default '0000-00-00',`ftpserver` varchar(255) NOT NULL default '0',`datatransfer` int(10) unsigned default '0',`executiontime` mediumint(8) unsigned default '0',PRIMARY KEY (`date`,`ftpserver`)) TYPE=MyISAM;
DROP TABLE IF EXISTS `net2ftp_logConsumptionIpaddress`;
DROP TABLE IF EXISTS `net2ftp_log_consumption_ipaddress`;
CREATE TABLE `net2ftp_log_consumption_ipaddress`(`date` date NOT NULL default '0000-00-00',`ipaddress` varchar(15) NOT NULL default '0',`datatransfer` int(10) unsigned default '0',`executiontime` mediumint(8) unsigned default '0',PRIMARY KEY (`date`,`ipaddress`)) TYPE=MyISAM;
DROP TABLE IF EXISTS `net2ftp_users`;
CREATE TABLE `net2ftp_users` (`ftpserver` varchar(255) NOT NULL default '0',`username` text NOT NULL,`homedirectory` text NOT NULL,KEY `index1` (`ftpserver`,`username`(50))) TYPE=MyISAM;
</textarea><br />
<br /><br />
<div class="header21">Next steps</div>
<ul>
<li> Important settings in settings.inc.php:
<ul>
<li> Enter an Admin panel password. If no password is entered, the Admin panel is not accessible.</li>
<li> Turn logging on or off (requires a MySQL database).</li>
<li> Choose if you want to set a daily consumption limit (requires a MySQL database).
Since version 0.81, it is possible to restrict each user's daily data transfer volume and script execution time.
By default the data transfer volume is set to 50 MB per day and the script execution time to 1000 seconds per day - but this may be changed.
Both figures are logged per IP address, and per FTP server.
Once the daily consumption limit is reached, you will still be able to browse FTP servers, but the transfer of data to/from the server will be blocked.
If you need unrestricted access to net2ftp, contact your net2ftp Administrator or install net2ftp on your own web server.</li>
</ul>
</li>
<li> Set authorizations in settings_authorizations.inc.php:
<ul>
<li> Allow the users to connect to any FTP server, or only to a restricted list of FTP servers</li>
<li> Ban certain FTP servers</li>
<li> Ban certain IP addresses; users connecting from these addresses will not be able to use the website</li>
<li> Allow the users to connect to any FTP server port, or only to one port</li>
<li> Set the user home directories in the table net2ftp_users.
This will direct a user to his home directory when he logs in, and also restrict the browsing to this directory.
The other actions (rename, copy, ...) are not protected!!
If you need tighter security, set the user permissions directly on the FTP server.
</li>
</ul>
</li>
<li> To allow large file uploads and transfers, you may have to change these settings:
<ul>
<li> in the file php.ini (directory C:\windows or /etc): upload_max_filesize, post_max_size, max_execution_time, memory_limit</li>
<li> in the file php.conf (directory /etc/httpd/conf.d): LimitRequestBody</li>
</ul>
</li>
<li>Protect the /temp directory. If you use the Apache web server, the .htaccess file which is provided already does this.</li>
<li> In your php.ini file, register_globals can be set to "off" (this is more secure), but the application will off course also work if it is set to "on".</li>
<li> The files are transmitted using the BINARY mode by default. There is a list of file extensions (txt, php, ...) which are transmitted in ASCII mode. Edit this list if needed, it is located in /includes/filesystem.inc.php. Look for function ftpAsciiBinary.</li>
</ul>
<br /><br />
<div class="header21">Integration of net2ftp in an existing website</div>
<div class="header31">General tips and tricks</div>
The overall architecture of net2ftp has been completely reviewed in version 0.90, to allow easy integration of net2ftp in other web-based PHP applications.
The index.php file is a school example of how to integrate net2ftp: <br /><br />
<ul>
<li> Set the constants NET2FTP_APPLICATION_ROOTDIR and NET2FTP_APPLICATION_ROOTDIR_URL </li>
<li> Include the net2ftp file main.inc.php </li>
<li> Execute 5 net2ftp() calls to send the HTTP headers, print the Javascript code, etc. </li>
<li> Check if an error occured to print out an error message. </li>
</ul>
<br /><br />
<div class="header31">Linking directly to a particular net2ftp page</div>
It is possible to direct users to a particular net2ftp page (browse a particular directory, upload page, ...).
Log in, go to the page you want to link to, and click on the Bookmark button: <img src="../../skins/blue/images/actions/bookmark.png" alt="Icon" />.
The next page will show you the link to use; this link does not contain any login information (username or password).
When the users click on the link, they will be prompted for their login information by a popup window.
<br /><br />
<div class="header31">Mambo, Drupal and Xoops modules</div>
Ready-made net2ftp modules for Mambo, Drupal and Xoops are provided with net2ftp version 0.90!
Detailed installation instructions are given in the readme.txt file in the respective directories.
In all cases you'll first need to install the standalone version of net2ftp, and then install the Mambo, Drupal or Xoops module.
Read the instructions carefully, as each step is important.
<br /><br />
<div class="header31">Web-based control panels</div>
net2ftp has been integrated in the following control panels:
<ul>
<li> Zpanel: <a href="http://www.thezpanel.com/">http://www.thezpanel.com/</a></li>
<li> Web-cp (as of version 0.6): <a href="http://www.web-cp.net/demo.php">http://www.web-cp.net/demo.php</a></li>
</ul>
<br /><br />
<div class="header21">Known bugs and limitations</div>
<div class="header31">PHP bugs</div>
<ul>
<li> There is a bug in the PHP FTP function ftp_get() which causes end-of-line characters to be wrongly translated.
As a result, \r\n becomes \r on Windows when using the ASCII mode.
There is a workaround: on the net2ftp login screen, the BINARY mode is chosen by default.
Refer to <a href="http://bugs.php.net/bug.php?id=27633">http://bugs.php.net/bug.php?id=27633</a> for more details.
<br />UPDATE 2004-12-13: A patch has been posted for this bug on the PHP internals mailing list.
<br />UPDATE 2005-04-08: This bug is fixed in PHP version 4.3.11 and 5.0.4.
</li>
</ul>
<div class="header31">If your web server runs on Windows</div>
If you can log in but you cannot see any directory or file in the Browse Screen, then it is probably caused by a filesystem permission problem on your web server.<br /><br />
<span style="text-decoration: underline;">Quote from the PHP bug report database:</span><br />
<i>
ftp_rawlist requires write permissions to the system's tempoarary directory. <br />
IIS's default installation does not include this in the permissions for IUSR.<br />
The bug is in system configuration, not PHP.<br />
</i><br />
This was discussed in the following PHP bug reports:<br />
<a href="http://bugs.php.net/bug.php?id=8874" target="_blank">http://bugs.php.net/bug.php?id=8874</a><br />
<a href="http://bugs.php.net/bug.php?id=13720" target="_blank">http://bugs.php.net/bug.php?id=13720</a><br />
<a href="http://bugs.php.net/bug.php?id=16057" target="_blank">http://bugs.php.net/bug.php?id=16057</a><br /><br />
<div class="header31">If your FTP server is the IIS FTP server</div>
In the FTP server's configuration, set it for UNIX style directory listings rather than MSDOS style listings.
<br /><br />
</body>
</html>

View file

@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" dir="ltr">
<head>
<title>net2ftp help</title>
<link rel="stylesheet" type="text/css" href="main.css.php?ltr=ltr" />
</head>
<body style="margin-left: 70px; margin-right: 70px;">
<div class="header21">Participate in the development!</div>
There is no real "development team"; net2ftp is mainly developed by David, while other people occasionally send in bug reports, patches and new language files.
It's up to you to decide which part you want to work on, depending on your skills and what you feel is most important.
<br /><br />
Experience in web development with PHP, HTML and MySQL is required to work on net2ftp itself.
However, there are lots of other things to do even if you have little experience: testing beta releases of net2ftp, translating net2ftp in a new language or maintaining existing translations or completing these Help pages.
<br /><br />
Before you start any major development, please post a message on the <a href="http://www.net2ftp.org/forums">forum</a> or mail David (david at net2ftp dot com - put "net2ftp" in the subject of your email) to check if no-one else is working on the same topic and to discuss integration aspects.
Same if you need help to locate something in the code - feel free to ask.
</body>
</html>

View file

@ -1,409 +0,0 @@
<!DOCTYPE html PUBLIC "XHTML 1.0 Transitional" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" dir="ltr">
<head>
<meta http-equiv="Content-type" content="text/html;charset=iso-8859-1" />
<meta name="keywords" content="net2ftp, web, ftp, based, web-based, xftp, client, PHP, SSL, SSH, SSH2, password, server, free, gnu, gpl, gnu/gpl, net, net to ftp, netftp, connect, user, gui, interface, web2ftp, edit, editor, online, code, php, upload, download, copy, move, delete, zip, tar, unzip, untar, recursive, rename, chmod, syntax, highlighting, host, hosting, ISP, webserver, plan, bandwidth" />
<meta name="description" content="net2ftp is a web based FTP client. It is mainly aimed at managing websites using a browser. Edit code, upload/download files, copy/move/delete directories recursively, rename files and directories -- without installing any software." />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="apple-touch-icon" href="favicon.png"/>
<title>net2ftp - a web based FTP client</title>
<script type="text/javascript" src="../../skins/shinra/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="../../skins/shinra/js/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript" src="../../skins/shinra/js/easing.js"></script>
<script type="text/javascript" src="../../skins/shinra/js/jquery.scrollTo-1.4.2-min.js"></script>
<script type="text/javascript" src="../../skins/shinra/js/jquery.cycle.all.js"></script>
<script type="text/javascript" src="../../skins/shinra/js/custom.js"></script>
<script type="text/javascript" src="../../skins/shinra/js/DD_belatedPNG.js"></script>
<script type="text/javascript" src="../../skins/shinra/js/superfish-1.4.8/js/hoverIntent.js"></script>
<script type="text/javascript" src="../../skins/shinra/js/superfish-1.4.8/js/superfish.js"></script>
<script type="text/javascript" src="../../skins/shinra/js/superfish-1.4.8/js/supersubs.js"></script>
<script type="text/javascript" src="../../skins/shinra/js/poshytip-1.0/src/jquery.poshytip.min.js"></script>
<script type="text/javascript" src="../../skins/shinra/js/html5.js"></script>
<link rel="stylesheet" href="../../skins/shinra/css/main.css.php?ltr=ltr&amp;image_url=skins%2Fshinra%2Fimages" type="text/css" />
<link rel="stylesheet" href="../../skins/shinra/css/style.css.php?show_ads=no" type="text/css" media="screen" />
<link rel="stylesheet" href="../../skins/shinra/css/social-icons.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../skins/shinra/css/ie8-hacks.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../skins/shinra/css/superfish.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../skins/shinra/css/superfish-left.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../skins/shinra/skins/glossy/style.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../skins/shinra/js/poshytip-1.0/src/tip-twitter/tip-twitter.css" type="text/css" />
<link rel="stylesheet" href="../../skins/shinra/js/poshytip-1.0/src/tip-yellowsimple/tip-yellowsimple.css" type="text/css" />
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Ubuntu" type="text/css">
</head>
<body onload="">
<!-- WRAPPER -->
<div id="wrapper">
<!-- HEADER -->
<div id="header" style="height: 100px;">
<img id="logo" src="../../skins/blue/images/img/logo.png" alt="net2ftp" />
</div>
<!-- ENDS HEADER -->
<!-- MAIN -->
<div id="main">
<!-- content -->
<div id="content">
<!-- title -->
<div id="page-title">
<span class="title">Help for users</span>
<span class="subtitle"></span>
</div>
<!-- ENDS title -->
<!-- Posts -->
<div id="posts" class="single">
<!-- post -->
<div class="post">
<h1><a id="ftp">What is FTP?</a></h1>
<div>
<p>
You want to build a website, so you start creating web pages on your computer.<br /><br />
Next, you need to publish them: you need to put those pages on a web server so that everyone would be able to view them.<br /><br />
To transfer the files from your computer to that web server, a special protocol (transfer method) is used: FTP - the File Transfer Protocol.
This protocol was designed to be able to handle big files; it can for example resume a transfer if it was interrupted in the middle.
</p>
</div>
</div>
<!-- ENDS post -->
<!-- post -->
<div class="post">
<h1><a id="net2ftp">What is net2ftp?</a></h1>
<div>
<p>
The normal way to connect to your FTP server is to use an FTP client and to communicate via the FTP protocol. This is however not always possible:
<div class="lists-star">
<ul>
<li>you may be behind a corporate firewall at work, which may block the FTP communications;</li>
<li>you may be on holiday and connecting to the internet via a CyberCafe, where you may not be allowed to install an FTP client.</li>
</ul>
</div>
When you use net2ftp these problems are solved: you connect to net2ftp using a regular web browser, and net2ftp translates your requests and takes care of the FTP communication.<br /><br />
net2ftp also provides additional features, on top of the regular FTP features: the possibility to edit code using your web browser, to view the code with syntax highlighting, to upload-and-unzip archives, and to search for words on the FTP server.
</p>
</div>
</div>
<!-- ENDS post -->
<!-- post -->
<div class="post">
<h1><a id="icons">Icons used</a></h1>
<div>
<p>
net2ftp uses the beautiful icons made by <a href="http://www.icon-king.com">David Vignoni</a> for <a href="http://www.kde.org">KDE</a>.<br /><br />
Their meaning should be pretty straight-forward, but just in case, here are the conventions used:<br /><br />
<img src="../../skins/shinra/images/actions/back.png" alt="Icon" /> Cancel and go back<br />
<img src="../../skins/shinra/images/actions/button_ok.png" alt="Icon" /> Execute the action<br />
<img src="../../skins/shinra/images/actions/filesave.png" alt="Icon" /> Save the file<br />
<img src="../../skins/shinra/images/actions/bookmark.png" alt="Icon" /> Bookmark the page<br />
<img src="../../skins/shinra/images/actions/reload.png" alt="Icon" /> Refresh the page<br />
<img src="../../skins/shinra/images/actions/exit.png" alt="Icon" /> Logout<br /><br />
All icons will also display a tooltip with additional information if you keep your mouse pointer on the button for a second, without clicking on it.<br />
Try with this icon: <img src="../../skins/shinra/images/actions/bookmark.png" alt="Bookmark this page" />
</p>
</div>
</div>
<!-- ENDS post -->
<!-- post -->
<div class="post">
<h1><a id="login">Logging in</a></h1>
<div>
<p>
Enter your FTP server, username and password.
The FTP server name can be "ftp.my-domain.com" if you have your own domain name.
If you don't have your own domain name, then it depends on your web hosting company.
It can be for example "ftp.geocities.com" or "ftp-www.earthlink.net".
<br /><br />
If you don't know your FTP server, username or password, then check out the support pages of your hosting company or contact their helpdesk.
</p>
</div>
</div>
<!-- ENDS post -->
<!-- post -->
<div class="post">
<h1><a id="browse">Browsing the FTP server</a></h1>
<div>
<p>
The first time you log in, you will see the contents of the root directory "/".
To go to a subdirectory, simply click on the subdirectory's name.
To go up to the parent directory, click on the top row with the label Up.
<br /><br />
If you know the name of the subdirectory you want to go to, you can also enter that name directly in the textbox on top of the page, and press ENTER.<br />
If you don't know the name exactly, click on <img src="../../skins/shinra/images/actions/view_tree.png" alt="Icon" />.
A window will pop up, which allows you to browse the FTP server and choose a directory.
Double-click on a subdirectory to go to that subdirectory. To go up, double-click on "..".
Once you are in the subdirectory you wanted to find, click on Choose.
The subdirectory name will be copied from the popup to the main window.
<br /><br />
It can happen that the FTP server returns the list of directories and files in an uncommon format.
In that case net2ftp shows you the lines bottom of the screen, under the heading "FTP server's output which is not recognized is shown below".
<br /><br />
If you want this fixed please contact the net2ftp developers.
They will analyse the output of your FTP server and improve the way net2ftp scans it.
</p>
</div>
</div>
<!-- ENDS post -->
<!-- post -->
<div class="post">
<h1><a id="upload">Upload files, upload-and-unzip archives</a></h1>
<div>
<p>
On the Browse Screen, click on the Upload button to go to the Upload Screen.<br /><br />
There is one column on the left to upload files, and there can also be a right column to upload-and-unzip archives.<br /><br />
Click on the Browse button to specify which file on your computer you want to upload or upload-and-unzip to the FTP server.<br /><br />
Once you are ready to start the upload, click on <img src="../../skins/shinra/images/actions/button_ok.png" alt="Icon" />.<br /><br />
The result screen will tell you if the upload was successful or not.<br />
To upload a file, you need write permissions on that directory of the FTP server. <br />
The file should also not be too big, as on most web servers the execution time of a script may be limited to 30 seconds.
</p>
</div>
</div>
<!-- ENDS post -->
<!-- post -->
<div class="post">
<h1><a id="jupload">Upload files using a Java applet (JUpload)</a></h1>
<div>
<p>
On the Browse Screen, click on the Java Upload button.<br /><br />
Click on the Add button to add directories and files to the upload queue (top left).<br />
When you select a directory, all the files inside will be transferred, and subdirectories will be created automatically.<br /><br />
Once you are ready to start the upload, click on the Upload button.<br /><br />
The results of the upload are printed just below the upload queue (bottom left).<br />
Two upload progress bars are displayed on the right: one indicating the progress of the current file, and the other indicating the total progress.<br /><br />
As for the normal upload, the maximum filesize and maximum execution time is limited; by default this is 2 MB and 30 seconds.<br />
If the total size of the files in the upload queue is larger than a certain limit, the Java Applet will split the request in several smaller parts.
</p>
</div>
</div>
<!-- ENDS post -->
<!-- post -->
<div class="post">
<h1><a id="download">Downloading and zipping</a></h1>
<div>
<p>
To download a file, simply click on its filename.<br /><br />
To zip-and-download files and directories, select them on the Browse Screen and click on Download.<br />
The directories and their contents will be retrieved and zipped.<br />
A popup window will ask you where you would like to save the Zip file on your computer.<br /><br />
Note that if the files inside are too big, the script will timeout and you won't be able to download anything.<br />
If this happens, try again with less directories and omit those which contain big files.<br /><br />
You can also zip files and email them in attachment, or save them on the FTP server.<br />
On the Browse Screen, select the directories and files and click on Zip.
</p>
</div>
</div>
<!-- ENDS post -->
<!-- post -->
<div class="post">
<h1><a id="view">View code with syntax highlighting</a></h1>
<div>
<p>
On the Browse Screen, click on the View link on the same line as the filename.
</p>
</div>
</div>
<!-- ENDS post -->
<!-- post -->
<div class="post">
<h1><a id="edit">Edit text</a></h1>
<div>
<p>
On the Browse Screen, click on the Edit link on the same line as the filename.<br />
Edit the text and press <img src="../../skins/shinra/images/actions/filesave.png" alt="Icon" /> to save the changes (you'll need write permissions for that). <br /><br />
Depending on the type of file you're editing, alternative textareas can be used:<br />
<div class="lists-star">
<ul>
<li> For HTML files, there are 2 WYSIWYG (What-You-See-Is-What-You-Get) textareas: <a href="http://www.fckeditor.net">FCKEditor</a> and <a href="http://tinymce.moxiecode.com/">TinyMCE</a>. </li>
<li> To edit code with syntax highlighting use Ace; it can highlight PHP, Javascript, Java and HTML code. </li>
</ul>
</div>
</p>
</div>
</div>
<!-- ENDS post -->
<!-- post -->
<div class="post">
<h1><a id="copy">Copy, move, delete</a></h1>
<div>
<p>
Select some files or directories and click on the Copy, Move or Delete button.<br /><br />
If you copy or move, then choose the target directory.
This can be different for each directory or file that you selected.
To set all target directories to the same value, enter the target directory in the top textbox and click on the button "Set all targetdirectories".<br /><br />
If you don't know the exact name of the target directory, click on <img src="../../skins/shinra/images/actions/view_tree.png" alt="Icon" />. A window will pop up, which allows you to browse the FTP server and choose a directory. Double-click on a subdirectory to go to that subdirectory. To go up, double-click on "..". Once you are in the subdirectory you wanted to find, click on Choose. The subdirectory name will be copied from the popup to the main window.<br />
To copy or move files to a second FTP server, enter the FTP server name, username and password on top.<br />
You need write permissions to be able to copy or move files to a directory.<br /><br />
Once you are ready, click on <img src="../../skins/shinra/images/actions/button_ok.png" alt="Icon" />.<br /><br />
The result screen will tell you if the action was successful or not.
If the files were too big, the script will run until the timeout is reached.
On most web servers the execution time of a script is limited to 30 seconds.
</p>
</div>
</div>
<!-- ENDS post -->
<!-- post -->
<div class="post">
<h1><a id="rename">Rename</a></h1>
<div>
<p>
Select directories or files and click on Rename on the Browse Screen.<br />
The next screen will ask for the new names.<br />
Fill these in and click on <img src="../../skins/shinra/images/actions/button_ok.png" alt="Icon" />.
</p>
</div>
</div>
<!-- ENDS post -->
<!-- post -->
<div class="post">
<h1><a id="chmod">Chmod</a></h1>
<div>
<p>
Select directories or files and click on Chmod on the Browse Screen.<br />
The next screen show the current permissions; select or unselect the checkboxes which represent a permission.<br />
Click on <img src="../../skins/shinra/images/actions/button_ok.png" alt="Icon" />.<br /><br />
Note that for the moment directories are not chmodded recursively -- subdirectories and files will remain unaffected. In the future, recursive chmodding will be added to net2ftp.
</p>
</div>
</div>
<!-- ENDS post -->
<!-- post -->
<div class="post">
<h1><a id="access">Access keys</a></h1>
<div>
<p>
Since version 0.81, most actions can be executed with the keyboard.<br />
On Windows, use ALT + a letter. On Apple computers, use CTRL + a letter.<br />
On Internet Explorer, ALT + a letter will only focus on the page element; press ENTER to execute the action.<br /><br />
Which letter can be used is shown in the tooltip.<br />
For example: to go back, the tooltip is "Back (accesskey b)".<br />
To display a tooltip, leave your mouse cursor for a few seconds over an icon or link without clicking it.<br /><br />
Internet Explorer, Netscape and Mozilla browsers support Access Keys, but Opera doesn't.
</p>
</div>
</div>
<!-- ENDS post -->
<!-- post -->
<div class="post">
<h1><a id="daily">Daily consumption limit</a></h1>
<div>
<p>
Since version 0.81, the Administrator can choose to restrict each user's daily data transfer volume and script execution time.<br />
By default the data transfer volume is set to 50 MB per day and the script execution time to 2500 seconds per day - but this may be changed by the Administrator.<br />
Both figures are logged per IP address, and per FTP server.<br /><br />
Once the daily consumption limit is reached, you will still be able to browse FTP servers, but the transfer of data to/from the server will be blocked.<br />
If you need unrestricted access to net2ftp, contact your net2ftp Administrator or install net2ftp on your own web server.
</p>
</div>
</div>
<!-- ENDS post -->
</div>
<!-- ENDS Posts -->
<!-- sidebar -->
<ul id="sidebar">
<!-- init sidebar -->
<li>
<h6>Jump to:</h6>
<ul>
<li class="cat-item"><a href="#ftp">What is FTP?</a></li>
<li class="cat-item"><a href="#net2ftp">What is net2ftp?</a></li>
<li class="cat-item"><a href="#icons">Icons used</a></li>
<li class="cat-item"><a href="#login">Logging in</a></li>
<li class="cat-item"><a href="#browse">Browsing the FTP server</a></li>
<li class="cat-item"><a href="#upload">Upload files, upload-and-unzip archives</a></li>
<li class="cat-item"><a href="#jupload">Upload files using a Java applet (JUpload)</a></li>
<li class="cat-item"><a href="#download">Downloading and zipping</a></li>
<li class="cat-item"><a href="#view">View code with syntax highlighting</a></li>
<li class="cat-item"><a href="#edit">Edit text</a></li>
<li class="cat-item"><a href="#copy">Copy, move, delete</a></li>
<li class="cat-item"><a href="#rename">Rename</a></li>
<li class="cat-item"><a href="#chmod">Chmod</a></li>
<li class="cat-item"><a href="#access">Access keys</a></li>
<li class="cat-item"><a href="#daily">Daily consumption limit</a></li>
</ul>
</li>
<!-- ENDS init sidebar -->
</ul>
<!-- ENDS sidebar -->
</div>
<!-- ENDS content -->
</div>
<!-- ENDS MAIN -->
<!-- FOOTER -->
<div id="footer">
<!-- Bottom -->
<div id="bottom">
Powered by <a href="http://www.net2ftp.com">net2ftp</a> on a template designed by <a href="http://www.luiszuno.com">Luiszuno</a>
<div id="to-top" class="poshytip" title="To top"></div>
</div>
<!-- ENDS Bottom -->
</div>
<!-- ENDS FOOTER -->
</div>
<!-- ENDS WRAPPER -->
</body>
</html>

View file

@ -1,376 +0,0 @@
<?php
header("Content-type: text/css");
if ($_GET["ltr"] != "rtl") { $left = "left"; $right = "right"; }
else { $left = "right"; $right = "left"; }
?>
/*------------------------------------------------------------------------
General settings
------------------------------------------------------------------------*/
body {
background-color : #FFFFFF;
color: #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: normal;
line-height: normal;
margin-top: 3px;
margin-bottom: 3px;
margin-<?php echo $left; ?>: 3px;
margin-<?php echo $right; ?>: 3px;
}
A:link {
color: #0000FF;
text-decoration: underline;
}
A:visited {
color: #0000FF;
text-decoration: underline;
}
A:hover {
}
li {
margin-top: 5px;
}
h1, h2, h3, p, form {
margin: 0;
}
.menu_header {
background-color: #3333DD;
color: #FFFFFF;
font-size: 110%;
font-weight: bold;
padding-<?php echo $left; ?>: 10px;
padding-<?php echo $right; ?>: 10px;
padding-top: 3px;
padding-bottom: 3px;
}
.menu_item {
line-height: 130%;
padding-top: 3px;
padding-bottom: 3px;
padding-<?php echo $left; ?>: 10px;
padding-<?php echo $right; ?>: 10px;
padding-bottom: 30px;
}
/*------------------------------------------------------------------------
Header level 1-3
------------------------------------------------------------------------*/
.header_table {
background-color: #3333DD;
color: #FFFFFF;
width: 100%;
}
.header11 {
background-color: #3333DD;
color: #FFFFFF;
border: 3px;
border-style: solid;
border-color: #CCCCCC;
margin-<?php echo $left; ?>: auto;
margin-<?php echo $right; ?>: auto;
margin-top: 10px;
margin-bottom: 10px;
width: 200px;
padding-bottom : 8px;
padding-top : 8px;
padding-<?php echo $left; ?> : 12px;
padding-<?php echo $right; ?> : 12px;
font-family: arial black, monaco, chicago;
font-size: 180%;
letter-spacing: 4px;
line-height: 30px;
text-align: center;
}
.header21 {
color: #3333DD;
font-size: 150%;
font-weight: bold;
margin-top: 10px;
margin-bottom: 10px;
padding-top : 5px;
}
.header31 {
color: #3333DD;
font-size: 110%;
font-weight: bold;
text-decoration: underline;
}
/*------------------------------------------------------------------------
Form objects: textboxes, buttons,...
------------------------------------------------------------------------*/
.input {
background-color: #FFFFFF;
color: #000000;
border-color: #330066;
border-width: 1px;
}
.longinput {
background-color: #FFFFFF;
color: #000000;
border-color: #330066;
border-width: 1px;
width: 300px;
}
.textarea {
background-color: #FFFFFF;
border-color: black;
border-width: 1px;
}
.microbutton {
background-color: #DEDEDE;
color: #000000;
height: 17px;
font-size: 8px;
}
.smallbutton {
background-color: #DEDEDE;
color: #000000;
height: 20px;
font-size: 10px;
}
.smalllongbutton {
background-color: #DEDEDE;
color: #000000;
height: 20px;
font-size: 10px;
}
.button {
background-color: #DEDEDE;
color: #000000;
height: 25px;
}
.longbutton {
background-color: #DEDEDE;
color: #000000;
height: 25px;
width: 120px;
}
.extralongbutton {
background-color: #DEDEDE;
color: #000000;
height: 25px;
}
.uploadinputbutton {
background-color: #FFFFFF;
height: 20px;
}
/*------------------------------------------------------------------------
Browse
------------------------------------------------------------------------*/
.browse_table {
margin-top: 0px;
width: 100%;
border: 2px solid #CCCCFF;
}
.browse_rows_heading {
color: #000000;
background-color: #CCCCFF;
font-size: 110%;
font-weight: bold;
}
.browse_rows_actions {
color: #000000;
background-color: #CCCCFF;
font-size: 80%;
font-weight: normal;
text-align: <?php echo $left; ?>;
}
.browse_rows_odd {
color: #000000;
background-color: #FFFFFF;
font-size: 80%;
font-weight: normal;
text-align: <?php echo $left; ?>;
}
.browse_rows_even {
color: #000000;
background-color: #EFEFEF;
font-size: 80%;
font-weight: normal;
text-align: <?php echo $left; ?>;
}
.browse_rows_separator {
color: #000000;
background-color: #CCCCFF;
font-size: 80%;
text-align: center;
}
/*------------------------------------------------------------------------
View
------------------------------------------------------------------------*/
.view {
border: 1px;
border-style: solid;
border-color: #000066;
background-color: #FFFFFF;
font-family: Courier;
font-size: 90%;
margin-<?php echo $left; ?>: 10px;
margin-<?php echo $right; ?>: 10px;
margin-bottom: 10px;
margin-top: 10px;
padding: 10px;
}
/*------------------------------------------------------------------------
Edit
------------------------------------------------------------------------*/
.edit {
font-size: 11px;
font-family: Courier;
}
/*------------------------------------------------------------------------
Error
------------------------------------------------------------------------*/
.error-table {
border: 2px;
border-style: solid;
border-color: #FF0000;
margin: 10px;
padding: 0px;
width: 750px;
}
.error-header {
background-color: #FF0000;
color: #FFFFFF;
text-decoration: underline;
font-size: 120%;
font-weight: bold;
line-height: 25px;
padding-<?php echo $left; ?>: 10px;
padding-<?php echo $right; ?>: 10px;
padding-top: 5px;
padding-bottom: 5px;
}
.error-text {
color: #FF0000;
font-size: 100%;
text-align: <?php echo $left; ?>;
padding: 10px;
}
.warning-box {
background-color: #FFDD00;
color: #000000;
border: 2px;
border-style: solid;
border-color: #FFCC33;
margin-<?php echo $left; ?>: auto;
margin-<?php echo $right; ?>: auto;
width: 90%;
}
.warning-text {
padding-bottom : 5px;
padding-top : 5px;
padding-<?php echo $left; ?> : 10px;
padding-<?php echo $right; ?> : 10px;
}
/*------------------------------------------------------------------------
Admin
------------------------------------------------------------------------*/
.tdheader1 {
font-size: 80%;
font-weight: bold;
text-align: center;
}
.tditem1 {
font-size: 65%;
font-weight: normal;
text-align: <?php echo $left; ?>;
}
/*------------------------------------------------------------------------
Process bar
From the PHP Pear package HTML_Progress
http://pear.laurent-laville.org/HTML_Progress/examples/horizontal/string.php
------------------------------------------------------------------------*/
.p_561b57 .progressBar {
background-color: #FFFFFF;
width: 172px;
height: 24px;
position: relative;
<?php echo $left; ?>: 0px;
top: 0px;
}
.p_561b57 .progressBarBorder {
background-color: #FFFFFF;
width: 172px;
height: 24px;
position: relative;
<?php echo $left; ?>: 0px;
top: 0px;
border-width: 0px;
border-style: solid;
border-color: #000000;
}
.p_561b57 .installationProgress {
width: 300px;
text-align: <?php echo $left; ?>;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
background-color: #FFFFFF;
}
.p_561b57 .cellI {
width: 15px;
height: 20px;
font-family: Courier, Verdana;
font-size: 8px;
float: <?php echo $left; ?>;
background-color: #CCCCCC;
}
.p_561b57 .cellA {
width: 15px;
height: 20px;
font-family: Courier, Verdana;
font-size: 8px;
float: <?php echo $left; ?>;
background-color: #006600;
visibility: hidden;
}

View file

@ -1,23 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" dir="ltr">
<head>
<title>net2ftp help</title>
<link rel="stylesheet" type="text/css" href="main.css.php?ltr=ltr" />
</head>
<body>
<table align="center" style="border: 2px solid #3333DD;" cellspacing="0" cellpadding="5">
<tr>
<td style="text-align: center; background-color: #3333DD; color: #FFFFFF; font-size: large;">net2ftp help</td>
</tr>
<tr>
<td style="text-align: center;">
<a href="01-welcome.html" target="middle">Welcome!</a> |
<a href="02-user.html" target="middle">User</a> |
<a href="03-administrator.html" target="middle">Administrator</a> |
<a href="04-developer.html" target="middle">Developer</a>
</td>
</tr>
</table>
</body>
</html>

View file

@ -1,308 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/install/install.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the chmod screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
if (isset($_POST["list"]) == true) { $list = getSelectedEntries($_POST["list"]); }
else { $list = ""; }
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
// Title
$title = __("Install software packages");
// Form name, back and forward buttons
$formname = "InstallForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
// -------------------------------------------------------------------------
// Screen 1
// -------------------------------------------------------------------------
if ($net2ftp_globals["screen"] == 1) {
// ----------------------------------------------
// Read the net2ftp installer script template $text
// ----------------------------------------------
$templatefile = $net2ftp_globals["application_rootdir"] . "/modules/install/net2ftp_installer.txt";
$handle = fopen($templatefile, "r"); // Open the local template file for reading only
if ($handle == false) {
$errormessage = __("Unable to open the template file");
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
clearstatcache(); // for filesize
$text = fread($handle, filesize($templatefile));
if ($text == false) {
$errormessage = __("Unable to read the template file");
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
@fclose($handle);
// ----------------------------------------------
// Read the list of packages
// ----------------------------------------------
$packagelistfile_net2ftp = "http://www.net2ftp.com/package_list.txt";
$packagelistfile_local = $net2ftp_globals["application_rootdir"] . "/modules/install/package_list.txt";
// Get the list of packages from net2ftp.com
$handle_net2ftp = @fopen($packagelistfile_net2ftp, "r");
clearstatcache(); // for filesize
$packagelist_net2ftp = @fread($handle_net2ftp, filesize($packagelistfile_net2ftp));
@fclose($handle_net2ftp);
// If net2ftp.com can't be reached, get it from the local installation
if ($packagelist_net2ftp == false) {
$handle_local = @fopen($packagelistfile_local, "r");
clearstatcache(); // for filesize
$packagelist_local = @fread($handle_local, filesize($packagelistfile_local));
@fclose($handle_local);
}
// Issue an error message if no list could be read
if ($packagelist_net2ftp != "") { $packagelist = $packagelist_net2ftp; }
elseif ($packagelist_local != "") { $packagelist = $packagelist_local; }
else {
$errormessage = __("Unable to get the list of packages");
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
// ----------------------------------------------
// Security code
// Random key generator by goochivasquez -at- gmail (15-Apr-2005 11:53)
// ----------------------------------------------
// Random key generator
$keychars = "abcdefghijklmnopqrstuvwxyz0123456789";
$length = 20;
$security_code = "";
for ($i=0;$i<$length;$i++) { $security_code .= substr($keychars,rand(1,strlen($keychars)),1); }
// Random key generator
$keychars = "abcdefghijklmnopqrstuvwxyz0123456789";
$length = 5;
$tempdir_extension = "";
for ($i=0;$i<$length;$i++) { $tempdir_extension .= substr($keychars,rand(1,strlen($keychars)),1); }
$tempdir_ftp = glueDirectories($net2ftp_globals["directory"], "net2ftp_temp_") . $tempdir_extension;
// ----------------------------------------------
// Replace certain values
// ----------------------------------------------
$text = str_replace("NET2FTP_SECURITY_CODE", $security_code, $text);
$text = str_replace("NET2FTP_TEMPDIR_EXTENSION", $tempdir_extension, $text);
$text = str_replace("NET2FTP_PACKAGELIST", $packagelist, $text);
$text = str_replace("NET2FTP_FTP_SERVER", $net2ftp_globals["ftpserver"], $text);
$text = str_replace("NET2FTP_FTPSERVER_PORT", $net2ftp_globals["ftpserverport"], $text);
$text = str_replace("NET2FTP_USERNAME", $net2ftp_globals["username"], $text);
$text = str_replace("NET2FTP_DIRECTORY", $net2ftp_globals["directory"], $text);
// ----------------------------------------------
// Open connection
// ----------------------------------------------
setStatus(2, 10, __("Connecting to the FTP server"));
$conn_id = ftp_openconnection();
if ($conn_id == false) { return false; }
// ----------------------------------------------
// Create temporary /net2ftp_temp directory
// ----------------------------------------------
setStatus(4, 10, __("Creating a temporary directory on the FTP server"));
ftp_newdirectory($conn_id, $tempdir_ftp);
if ($net2ftp_result["success"] == false) { setErrorVars(true, "", "", "", ""); }
// ----------------------------------------------
// Chmodding the temporary /net2ftp_temp directory to 777
// ----------------------------------------------
setStatus(6, 10, __("Setting the permissions of the temporary directory"));
$sitecommand = "chmod 0777 " . $tempdir_ftp;
$ftp_site_result = @ftp_site($conn_id, $sitecommand);
// ----------------------------------------------
// Put a .htaccess in the /net2ftp_temp directory to avoid anyone else reading the contents it
// (Works only for Apache web servers...)
// ----------------------------------------------
ftp_writefile($conn_id, $tempdir_ftp, ".htaccess", "deny from all");
if ($net2ftp_result["success"] == false) { setErrorVars(true, "", "", "", ""); }
// ----------------------------------------------
// Write the net2ftp installer script to the FTP server
// ----------------------------------------------
setStatus(8, 10, __("Copying the net2ftp installer script to the FTP server"));
ftp_writefile($conn_id, $net2ftp_globals["directory"], "net2ftp_installer.php", $text);
if ($net2ftp_result["success"] == false) { return false; }
// ----------------------------------------------
// Close connection
// ----------------------------------------------
ftp_closeconnection($conn_id);
// ----------------------------------------------
// Variables for screen 1
// ----------------------------------------------
// URL to the installer script
$list_files[1]["dirfilename_js"] = "net2ftp_installer.php?security_code=" . $security_code;
$ftp2http_result = ftp2http($net2ftp_globals["directory"], $list_files, "no");
$net2ftp_installer_url = $ftp2http_result[1];
} // end if
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

File diff suppressed because it is too large Load diff

View file

@ -1,95 +0,0 @@
<option value="" style="font-weight: bold; text-decoration: underline;">Blogs</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/evocms/b2evolution-1.8.0-2006-07-09.zip">b2evolution 1.8.0</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/nucleuscms/nucleus3.23.zip">Nucleus 3.23 English</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/nucleuscmsde/nucleus3.23_de.zip">Nucleus 3.23 German</option>
<option value="http://wordpress.org/latest.tar.gz">WordPress (latest version)</option>
<option value="" style="font-weight: bold; text-decoration: underline;">Content management</option>
<option value="http://ftp.osuosl.org/pub/drupal/files/projects/drupal-4.6.8.tar.gz">Drupal 4.6.8</option>
<option value="http://ftp.osuosl.org/pub/drupal/files/projects/drupal-4.7.2.tar.gz">Drupal 4.7.2</option>
<option value="http://ez.no/content/download/137355/877522/file/ezpublish-3.8.3-gpl.tar.gz">eZ Publish 3.8.3</option>
<option value="http://www.geeklog.net/filemgmt/visit.php?lid=747">Geeklog</option>
<option value="http://developer.joomla.org/sf/frs/do/downloadFile/projects.joomla/frs.joomla_1_0.1_0_10/frs5790?dl=1">Joomla 1.0.10</option>
<option value="http://mamboxchange.com/frs/download.php/7368/mambov4.5.3h.tar.gz">Mambo 4.5.3h</option>
<option value="http://mamboxchange.com/frs/download.php/7877/MamboV4.5.4.tar.gz">Mambo 4.5.4</option>
<option value="http://mamboxchange.com/frs/download.php/8046/MamboV4.6RC2.tar.gz">Mambo 4.6 RC2</option>
<option value="http://download.moodle.org/stable16/moodle-latest-16.tgz">Moodle 1.6.1 stable</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/phpwcms/phpwcms_1.2.5-DEV.tgz">phpWCMS 1.2.5</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/phpwebsite/phpwebsite-0.10.2-full.tar.gz">phpWebSite 0.10.2 full</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/phpwebsite/phpwebsite-0.10.2-full.tar.gz">phpWebSite 0.10.2 full</option>
<option value="http://noc.postnuke.com/frs/download.php/987/PostNuke-0.762.tar.gz">Post-Nuke 0.762</option>
<option value="http://siteframe.org/files/2/34/siteframe-5.0.2-768.tar.gz">Siteframe 5.0.2</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/typo3/dummy-4.0.tar.gz">TYPO3 4.0 dummy</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/typo3/typo3_src-4.0.tar.gz">TYPO3 4.0 source</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/xoops/xoops-2.0.14.tar.gz">Xoops 2.0.14</option>
<option value="" style="font-weight: bold; text-decoration: underline;">Customer relationship</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/cslive/craftysyntax2.12.9.tar.gz">Crafty Syntax Live Help 2.12.9</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/helpcenterlive/hcl_2-1-2.zip">Help Center Live 2.1.2</option>
<option value="http://www.phpsupporttickets.com/pages/php_support_tickets/dist/free/PHP_S_Tickets_v2.2.tar.gz">PHP Support Tickets</option>
<option value="http://www.support-logic.com/download/index.php?cmd=download&id=22">Support Logic Helpdesk 1.3</option>
<option value="http://www.sheddnet.net/forums/attachment.php?attachmentid=77&d=1146954912">Support Services Manager 1.0.2</option>
<option value="" style="font-weight: bold; text-decoration: underline;">Development</option>
<option value="http://www.net2ftp.com/download/net2ftp_v0.93.zip">net2ftp 0.93 full version</option>
<option value="http://www.net2ftp.com/download/net2ftp_v0.93_light.zip">net2ftp 0.93 light version</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.8.2.tar.gz">phpMyAdmin 2.8.2</option>
<option value="" style="font-weight: bold; text-decoration: underline;">Discussion boards</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/phpbb/phpBB-2.0.21.tar.gz">phpBB 2.0.21</option>
<option value="http://www.punbb.org/download/punbb-1.2.12.tar.gz">punBB 1.2.12</option>
<option value="http://www.simplemachines.org/download/index.php/smf_1-0-7_install.tar.gz">Simple Machines Forum 1.0.7</option>
<option value="" style="font-weight: bold; text-decoration: underline;">E-Commerce</option>
<option value="https://www.cubecart.com/site/helpdesk/index.php?_m=downloads&_a=viewdownload&downloaditemid=44&nav=0,5">CubeCart</option>
<option value="http://www.oscommerce.com/redirect.php/go,28">OS Commerce 2.2 Milestone 2 Update 051113</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/zencart/zen-cart-v1.1.4d.zip">Zen Cart 1.1.4d</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/zencart/zen-cart-1-2-7-d_full-release.zip">Zen Cart 1.2.7d full release</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/zencart/zen-cart-v1.3.0.2-full-fileset.zip">Zen Cart 1.3.0.2 full fileset</option>
<option value="" style="font-weight: bold; text-decoration: underline;">FAQ</option>
<option value="http://www.lethalpenguin.net/design/faqmasterflex.php?download=true">FAQMasterFlex</option>
<option value="" style="font-weight: bold; text-decoration: underline;">Guestbooks</option>
<option value="http://www.danskcinders.com/download/ViPER_Guestbook_X1.1.zip">ViPER Guestbook 1.1</option>
<option value="" style="font-weight: bold; text-decoration: underline;">Hosting billing</option>
<option value="http://www.phpcoin.com/coin_addons/dload.php?id=108">phpCOIN 1.2.3</option>
<option value="" style="font-weight: bold; text-decoration: underline;">Image galleries</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/coppermine/cpg1.4.8.zip">Coppermine Photo Gallery 1.4.8</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/gallery/gallery-2.1.1a-typical.tar.gz">Gallery 2.1.1a (typical)</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/gallery/gallery-2.1.1a-full.tar.gz">Gallery 2.1.1a (full)</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/gallery/gallery-2.1.1a-minimal.tar.gz">Gallery 2.1.1a (mininal)</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/gallery/gallery-2.1.1a-developer.tar.gz">Gallery 2.1.1a (developer)</option>
<option value="" style="font-weight: bold; text-decoration: underline;">Mailing lists</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/phplist/phplist-2.10.2.tgz">PHPlist 2.10.2</option>
<option value="" style="font-weight: bold; text-decoration: underline;">Polls and surveys</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/phpesp/phpESP-1.8.2.tar.gz">phpESP 1.8.2</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/phpsurveyor/phpsurveyor-1_00.zip">PHPSurveyor 1.0</option>
<option value="" style="font-weight: bold; text-decoration: underline;">Project management</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/dotproject/dotproject-2.0.4.tar.gz">dotProject 2.0.4</option>
<option value="http://www.phprojekt.com/modules.php?op=modload&name=Downloads&file=index&req=getit&lid=3">PHProjekt 5.1</option>
<option value="http://www.tutos.org/download/TUTOS-php-1.2.20050904.tar.gz">Tutos 1.2.20050904</option>
<option value="" style="font-weight: bold; text-decoration: underline;">Webmail</option>
<option value="ftp://ftp.horde.org/pub/horde/horde-3.1.2.tar.gz">Horde 3.1.2 (required for IMP)</option>
<option value="ftp://ftp.horde.org/pub/imp/imp-h3-4.1.2.tar.gz">IMP H3 4.1.2 (requires Horde)</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/neomail/neomail-1.29.tar.gz">NeoMail 1.29</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/squirrelmail/squirrelmail-1.4.7.tar.gz">Squirrelmail 1.4.7</option>
<option value="" style="font-weight: bold; text-decoration: underline;">Wiki</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/tikiwiki/tikiwiki-1.9.4.tar.gz">TikiWiki 1.9.4</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/phpwiki/phpwiki-1.2.10.tar.gz">PhpWiki 1.2.10 (stable)</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/phpwiki/phpwiki-1.3.12p3.tar.bz2">PhpWiki 1.3.12p3 (current)</option>
<option value="" style="font-weight: bold; text-decoration: underline;">Other scripts</option>
<option value="http://www.cacti.net/downloads/cacti-0.8.6h.tar.gz">Cacti 0.8.6h</option>
<option value="http://classifieds.phpoutsourcing.com/classifieds_1_3.tgz">Noahs Classifieds 1.3</option>
<option value="http://www.open-realty.org/release/open-realty232.zip">Open-Realty 2.3.2</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/phpadsnew/phpAdsNew-2.0.8.tar.gz">phpAdsNew</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/phpformgen/phpFormGen-php-2.09c.tar.gz">phpFormGenerator 2.0.9c</option>
<option value="http://belnet.dl.sourceforge.net/sourceforge/webcalendar/WebCalendar-1.0.4.tar.gz">WebCalendar 1.0.4</option>

View file

@ -1,399 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
// ------------------------------------
// 1. Register the global variables
// ------------------------------------
if ($net2ftp_globals["screen"] == 2) {
// Code for old file jupload applet (jupload version 0.86)
// $file_counter = 0;
// foreach($_FILES as $tagname=>$object) {
// if ($object['name'] != "") {
// $file_counter = $file_counter + 1;
// $uploadedFilesArray["$file_counter"]["name"] = $object['name'];
// $uploadedFilesArray["$file_counter"]["tmp_name"] = $object['tmp_name'];
// $uploadedFilesArray["$file_counter"]["size"] = $object['size'];
// $uploadedFilesArray["$file_counter"]["error"] = $object['error'];
// // Look for special encoded jupload files
// $contentType = $object['type'];
// if (substr($contentType,0,7) == "jupload") {
// $base64_encoded_path = substr($contentType,8);
// $base64_decoded_path = base64_decode($base64_encoded_path);
// $uploadedFilesArray["$file_counter"]["absolute_directory"] = $base64_decoded_path;
// } // end if
// } // end if
// } // end foreach
// Code for new file jupload applet (jupload version 5.0.8)
$file_counter = 0;
foreach($_FILES as $tagname=>$object) {
if ($object['name'] != "") {
$file_counter = $file_counter + 1;
$uploadedFilesArray["$file_counter"]["name"] = $object['name'];
$uploadedFilesArray["$file_counter"]["type"] = $object['type'];
$uploadedFilesArray["$file_counter"]["tmp_name"] = $object['tmp_name'];
$uploadedFilesArray["$file_counter"]["error"] = $object['error'];
$uploadedFilesArray["$file_counter"]["size"] = $object['size'];
$uploadedFilesArray["$file_counter"]["mime"] = validateEntry($_POST["mimetype".$file_counter]);
$uploadedFilesArray["$file_counter"]["relative_directory"] = validateDirectory($_POST["relpathinfo".$file_counter]);
$uploadedFilesArray["$file_counter"]["mtime"] = validateEntry($_POST["filemodificationdate".$file_counter]);
} // end if
} // end foreach
echo "Please wait, the files are being transferred to the FTP server...<br />\n";
flush();
// ------------------------------------
// 2. POST METHOD: Move files from the *webserver's* temporary directory to *net2ftp's*
// temporary directory (move_uploaded_files).
// ------------------------------------
if ($_SERVER["REQUEST_METHOD"] == "POST" && sizeof($uploadedFilesArray) > 0) {
$moved_counter = 0;
for ($j=1; $j<=sizeof($uploadedFilesArray); $j++) {
$file_name = $uploadedFilesArray["$j"]["name"];
$file_tmp_name = $uploadedFilesArray["$j"]["tmp_name"];
$file_size = $uploadedFilesArray["$j"]["size"];
$file_error = $uploadedFilesArray["$j"]["error"];
$file_relative_directory = $uploadedFilesArray["$j"]["relative_directory"];
if (($file_name != "" && $file_tmp_name == "") || $file_size > $net2ftp_settings["max_filesize"]) {
// The case ($file_name != "" && $file_tmp_name == "") occurs when the file is bigger than the directives set in php.ini
// In that case, only $uploadedFilesArray["$j"]["name"] is filled in.
echo "WARNING: File <b>$file_name</b> skipped: this file is too big.<br />\n";
@unlink($file_tmp_name);
continue;
}
elseif (checkAuthorizedName($file_name) == false || checkAuthorizedName($file_relative_directory) == false) {
echo "WARNING: File <b>$file_relative_directory</b> skipped: it contains a banned keyword.<br />\n";
$skipped = $skipped + 1;
@unlink($file_tmp_name);
continue;
}
// Create the temporary filename as follows: (from left to right)
// - Use prefix "upload__", to be able to identify from where this temporary file comes from
// - Create a random filename
// - Add the original filename extension, to be able to identify the filetype
// - Add suffix ".txt" to avoid that the file would be executed on the webserver
$extension = get_filename_extension($file_name);
if (substr($file_name, -6) == "tar.gz") { $extension = "tar.gz"; }
$tempfilename = tempnam2($net2ftp_globals["application_tempdir"], "upload__", "." . $extension . ".txt");
if ($tempfilename == false) {
// If you get this warning message, you've probably forgotten to chmod 777 the /temp directory
echo "WARNING: File <b>$file_name</b> skipped: unable to create a temporary file on the webserver.<br />\n";
@unlink($file_tmp_name);
continue;
}
// Move the uploaded file
$move_uploaded_file_result = move_uploaded_file($uploadedFilesArray["$j"]["tmp_name"], $tempfilename);
if ($move_uploaded_file_result == false) {
echo "WARNING: File <b>$file_name</b> skipped: unable to move the uploaded file to the webserver's temporary directory.<br />\n";
@unlink($file_tmp_name);
@unlink($tempfilename);
continue;
}
else {
$moved_counter = $moved_counter + 1;
$acceptedFilesArray["$moved_counter"] = $uploadedFilesArray["$j"]; // Copy all parameters for this file from the $uploadedFilesArray to the $acceptedFilesArray
$acceptedFilesArray["$moved_counter"]["tmp_name"] = $tempfilename; // Overwrite the old temporary name by the new one
}
} // end for j
flush();
} // end if elseif
// ------------------------------------
// 3. Move the files from net2ftp's temporary directory to the FTP server.
// ------------------------------------
if (sizeof($acceptedFilesArray) == 0 && sizeof($uploadedFilesArray) != 0) { echo "WARNING: No files were accepted (see messages above), so nothing will be transferred to the FTP server.<br />\n"; }
elseif (sizeof($acceptedFilesArray) > 0) {
// ------------------------------
// 3.1 Open connection
// ------------------------------
// Open connection
echo __("Connecting to the FTP server") . "<br />\n";
$conn_id = ftp_openconnection();
if ($net2ftp_result["success"] == false) {
echo "ERROR: " . $net2ftp_result["errormessage"] . "<br />\n";
return false;
}
// ------------------------------
// For loop (loop over all the files)
// ------------------------------
for ($k=1; $k<=sizeof($acceptedFilesArray); $k++) {
$file_name = $acceptedFilesArray["$k"]["name"];
$file_tmp_name = $acceptedFilesArray["$k"]["tmp_name"];
$file_size = $acceptedFilesArray["$k"]["size"];
$file_error = $acceptedFilesArray["$k"]["error"];
$file_relative_directory = $acceptedFilesArray["$k"]["relative_directory"];
$ftpmode = ftpAsciiBinary($file_name);
if ($ftpmode == FTP_ASCII) { $printftpmode = "FTP_ASCII"; }
elseif ($ftpmode == FTP_BINARY) { $printftpmode = "FTP_BINARY"; }
// ------------------------------
// 3.2 Within the for loop: create the subdirectory if needed
// ------------------------------
// Replace Windows-style backslashes \ by Unix-style slashes /
$file_relative_directory = str_replace("\\", "/", trim($file_relative_directory));
// Get the names of the subdirectories by splitting the string using slashes /
$file_subdirectories = explode("/", $file_relative_directory);
// $targetdirectory contains the successive directories to be created
$targetdirectory = $net2ftp_globals["directory"];
// Loop over sizeof()-1 because the last part is the filename itself:
for ($m=0; $m<sizeof($file_subdirectories)-1; $m++) {
// Create the targetdirectory string
$targetdirectory = glueDirectories($targetdirectory, $file_subdirectories[$m]);
// Check if the subdirectories exist
if ($targetdirectory != "") {
$result = @ftp_chdir($conn_id, $targetdirectory);
if ($result == false) {
$ftp_mkdir_result = ftp_mkdir($conn_id, $targetdirectory);
if ($ftp_mkdir_result == false) {
echo "WARNING: Unable to create the directory <b>$targetdirectory</b>. The script will try to continue...<br />\n";
continue;
}
echo "Directory $targetdirectory created.<br />\n";
} // end if
flush();
} // end if
} // end for m
// Store the $targetdirectory in the $acceptedFilesArray
if ($targetdirectory != "" && $targetdirectory != "/") {
$acceptedFilesArray["$k"]["targetdirectory"] = $targetdirectory;
}
// ------------------------------
// 3.3 Within the for loop: put local file to remote file
// ------------------------------
ftp_putfile($conn_id, "", $acceptedFilesArray["$k"]["tmp_name"], $acceptedFilesArray["$k"]["targetdirectory"], $acceptedFilesArray["$k"]["name"], $ftpmode, "move");
if ($net2ftp_result["success"] == false) {
echo "ERROR: File <b>$file_name</b> skipped. Message: " . $net2ftp_result["errormessage"] . "<br />\n";
setErrorVars(true, "", "", "", "");
continue;
} // end if
else { echo "The file <b>$file_name</b> was transferred to the FTP server successfully. <br />\n"; }
flush();
} // End for k
// Note: the java applet is looking for the word "SUCCESS" to determine if the upload result is OK or not (see applet parameter stringUploadSuccess)
// The applet doesn't seem to recognize the words "SUCCESS", "WARNING" or "ERROR" when they are issued by the code above
echo "SUCCESS";
// ------------------------------
// 3.4 Close connection
// ------------------------------
ftp_quit($conn_id);
} // end if
} // end if $screen == 2
} // end net2ftp_module_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/upload/upload.js\"></script>\n";
} // end net2ftp_module_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_module_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_module_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the login screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
// -------------------------------------------------------------------------
// Variables for screen 1
// -------------------------------------------------------------------------
if ($net2ftp_globals["screen"] == 1) {
// Title
$title = __("Upload directories and files using a Java applet");
// Next screen
$nextscreen = 2;
// Form name, back and forward buttons
$formname = "JavaUploadForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
// Action URL
$actionURL = printPHP_SELF("jupload");
// Maxima
$maxFileSize = $net2ftp_settings["max_filesize"];
$maxChunkSize = $net2ftp_settings["max_filesize"];
$maxFilesPerRequest = "100";
$max_filesize_net2ftp = formatFilesize($net2ftp_settings["max_filesize"]);
$max_upload_filesize_php = formatFilesize(@ini_get("upload_max_filesize"));
$max_execution_time = @ini_get("max_execution_time");
// Print the output
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // end if
// -------------------------------------------------------------------------
// Variables for screen 2
// -------------------------------------------------------------------------
// elseif ($net2ftp_globals["screen"] == 2) {
// THE OUTPUT IS GENERATED HIGHER UP, IN net2ftp_module_sendHttpHeaders().
// This is because the Applet only takes text - no HTML.
// } // end if
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
// Is done higher up, as for screen 1 a template is used, but not for screen 2.
} // End net2ftp_module_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,407 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// -------------------------------------------------------------------------
// Send XHTML header
// -------------------------------------------------------------------------
// header("Content-type: application/xhtml+xml; charset=" . __("iso-8859-1"));
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// -------------------------------------------------------------------------
// Include the embed.js file for openlaszlo, and nothing else
// -------------------------------------------------------------------------
if ($net2ftp_globals["skin"] == "openlaszlo") {
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/openlaszlo/lps/includes/embed-compressed.js\"></script>\n";
}
// -------------------------------------------------------------------------
// For the other skins, do print more Javascript functions
// -------------------------------------------------------------------------
else {
// Check if the user did enter an FTP server and username
echo "<script type=\"text/javascript\"><!--\n";
echo "function CheckInput(form) {\n";
echo " var u,p1,p2,e;\n";
echo " s=form.ftpserver.value;\n";
echo " u=form.username.value;\n";
echo " p=form.password.value;\n";
echo " if (s.length==0) {\n";
echo " form.ftpserver.focus();\n";
echo " alert(\"" . __("Please enter an FTP server.") . "\");\n";
echo " return false;\n";
echo " }\n";
echo " if (u.length==0) {\n";
echo " form.username.focus();\n";
echo " alert(\"" . __("Please enter a username.") . "\");\n";
echo " return false;\n";
echo " }\n";
// echo " if (p.length==0) {\n";
// echo " form.password.focus();\n";
// echo " alert(\"" . __("Please enter a password.") . "\");\n";
// echo " return false;\n";
// echo " }\n";
echo " return true;\n";
echo "}\n";
// Anonymous login
echo "function do_anonymous(form) {\n";
echo " var checked = form.anonymous.checked;\n";
echo " if (checked == true) {\n";
echo " vars_defined = 'true';\n";
echo " last_username = form.username.value;\n";
echo " last_password = form.password.value;\n";
echo " form.username.value = \"anonymous\";\n";
echo " form.password.value = \"user@net2ftp.com\";\n";
echo " } else {\n";
echo " form.username.value = last_username;\n";
echo " form.password.value = last_password;\n";
echo " }\n";
echo " return true;\n";
echo "}\n";
// Clear Cookies
echo "function ClearCookies() {\n";
echo " document.forms['LoginForm'].state.value='clearcookies';\n";
echo " document.forms['LoginForm'].state2.value='';\n";
echo " document.forms['LoginForm'].submit();\n";
echo "}\n";
echo "//--></script>\n";
} // end if else
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the login screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// -------------------------------------------------------------------------
// Variables
// -------------------------------------------------------------------------
// ------------------------------------
// Title
// ------------------------------------
$login_title = __("Login!");
// ------------------------------------
// FTP server
// $ftpserver["inputType"] can be "text", "select" or "hidden"
// $ftpserver"][$i]["text"] is "ftp.server.com"
// $ftpserver"][$i]["selected"] is "selected" or ""
// ------------------------------------
// All FTP servers are allowed
// Prefill the textbox with the value that was filled in (when changing the language the page refreshes)
// or else with the value from the cookie
if ($net2ftp_settings["allowed_ftpservers"][1] == "ALL") {
// Input type is textbox
$ftpserver["inputType"] = "text";
// Prefill with the previous input value
if ($net2ftp_globals["ftpserver"] != "") { $ftpserver["list"][1] = htmlEncode2($net2ftp_globals["ftpserver"]); }
// Prefill with the cookie value
else { $ftpserver["list"][1] = htmlEncode2($net2ftp_globals["cookie_ftpserver"]); }
}
// Only a list of FTP servers are allowed
// Preselect the drop-down box with the value that was filled in (when changing the language the page refreshes)
// or else with the value from the cookie
elseif (sizeof($net2ftp_settings["allowed_ftpservers"]) > 1) {
// Input type is drop-down box
$ftpserver["inputType"] = "select";
// List of allowed FTP servers
$ftpserver["list"] = $net2ftp_settings["allowed_ftpservers"];
// Preselect the right FTP server
// ... using the previous input value
$array_search_result1 = array_search($net2ftp_globals["ftpserver"], $ftpserver);
if (is_numeric($array_search_result1) == true) { $ftpserver["list"][$array_search_result1]["selected"] = "selected=\"selected\""; }
// ... using the cookie value
else {
$array_search_result2 = array_search($net2ftp_globals["cookie_ftpserver"], $ftpserver);
if (is_numeric($array_search_result2) == true) { $ftpserver["list"][$array_search_result2]["selected"] = "selected=\"selected\""; }
}
}
// Only 1 FTP server is allowed
elseif (sizeof($net2ftp_settings["allowed_ftpservers"]) == 1) {
$ftpserver["inputType"] = "hidden";
$ftpserver["list"][1] = $net2ftp_settings["allowed_ftpservers"][1];
}
// Else, there is an error!
else {
$errormessage = "There is an error in the net2ftp configuration file <b>settings_authorizations.inc.php</b>: variable <b>\$net2ftp_allowed_ftpservers</b> does not follow the expected format.";
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
// ------------------------------------
// FTP server port
// $ftpserverport["inputType"] can be "text" or "hidden"
// $ftpserverport is "21"
// ------------------------------------
if ($net2ftp_settings["allowed_ftpserverport"] == "ALL") {
// Input type is textbox
$ftpserverport["inputType"] = "text";
// Prefill with the previous input value
if ($net2ftp_globals["ftpserverport"] != "") { $ftpserverport["value"] = htmlEncode2($net2ftp_globals["ftpserverport"]); }
// Prefill with the cookie value - only if it is different from empty
elseif ($net2ftp_globals["cookie_ftpserverport"] != "") {
$ftpserverport["value"] = htmlEncode2($net2ftp_globals["cookie_ftpserverport"]);
}
// Else, fill in 21, which is the default FTP port
else {
$ftpserverport["value"] = 21;
}
}
else {
$ftpserverport["inputType"] = "hidden";
$ftpserverport["value"] = $net2ftp_settings["allowed_ftpserverport"];
}
// ------------------------------------
// Username
// ------------------------------------
// Prefill with the previous input value
if ($net2ftp_globals["username"] != "") { $username = htmlEncode2($net2ftp_globals["username"]); }
// Prefill with the cookie value
else { $username = htmlEncode2($net2ftp_globals["cookie_username"]); }
// ------------------------------------
// Password
// ------------------------------------
// Do not prefill this field
$password = "";
// ------------------------------------
// Passive mode
// ------------------------------------
if ($net2ftp_globals["passivemode"] == "yes") { $passivemode["checked"] = "checked=\"checked\""; }
elseif ($net2ftp_globals["cookie_passivemode"] == "yes") { $passivemode["checked"] = "checked=\"checked\""; }
else { $passivemode["checked"] = ""; }
// ------------------------------------
// Initial directory
// ------------------------------------
if (strlen($net2ftp_globals["directory"]) > 1) { $directory = $net2ftp_globals["directory_html"]; }
elseif (strlen($net2ftp_globals["cookie_directory"]) > 1) { $directory = htmlEncode2($net2ftp_globals["cookie_directory"]); }
else { $directory = ""; }
// ------------------------------------
// Protocol
// ------------------------------------
$protocol["inputType"] = "hidden";
$protocol["list"][1] = "FTP";
if (function_exists("ssh2_connect") == true) { $protocol["list"][2] = "FTP over SSH2"; $protocol["inputType"] = "select"; }
if (function_exists("ftp_ssl_connect") == true) { $protocol["list"][3] = "FTP with SSL"; $protocol["inputType"] = "select"; }
// ------------------------------------
// Language
// ------------------------------------
$language_onchange = "document.forms['LoginForm'].state.value='login'; document.forms['LoginForm'].submit();";
// ------------------------------------
// Skin
// ------------------------------------
$skin_onchange = "";
// ------------------------------------
// FTP mode
// ------------------------------------
// Determine the FTP mode
if ($net2ftp_globals["ftpmode"] != "") { $ftpmode["type"] = htmlEncode2($net2ftp_globals["ftpmode"]); }
elseif ($net2ftp_globals["cookie_ftpmode"] != "") { $ftpmode["type"] = htmlEncode2($net2ftp_globals["cookie_ftpmode"]); }
else {
// Before PHP version 4.3.11, bug 27633 can cause problems in ASCII mode ==> use BINARY mode
if (version_compare(phpversion(), "4.3.11", "<")) { $ftpmode["type"] = "binary"; }
// As from PHP version 4.3.11, bug 27633 is fixed ==> use Automatic mode
else { $ftpmode["type"] = "automatic"; }
}
// Fill the values that will be used in the template
if ($ftpmode["type"] == "automatic") {
$ftpmode["automatic"] = "checked=\"checked\"";
$ftpmode["binary"] = "";
}
elseif ($ftpmode["type"] == "binary") {
$ftpmode["automatic"] = "";
$ftpmode["binary"] = "checked=\"checked\"";
}
// ------------------------------------
// FTP mode
// ------------------------------------
$admin_url = $net2ftp_globals["action_url"] . "?state=login_small&amp;state2=admin&amp;go_to_state=admin";
// ------------------------------------
// Focus
// ------------------------------------
if ($net2ftp_settings["allowed_ftpservers"][1] == "ALL") { $focus = "ftpserver"; }
else { $focus = "username"; }
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/login.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,268 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the login screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
// The 2 go_to_state variables come from the bookmark, or from registerglobals.inc.php
if (isset($_GET["go_to_state"]) == true) { $go_to_state = validateGenericInput($_GET["go_to_state"]); }
else { $go_to_state = $net2ftp_globals["go_to_state"]; }
if (isset($_GET["go_to_state2"]) == true) { $go_to_state2 = validateGenericInput($_GET["go_to_state2"]); }
else { $go_to_state2 = $net2ftp_globals["go_to_state2"]; }
if (isset($_GET["errormessage"]) == true) { $errormessage = validateGenericInput($_GET["errormessage"]); }
// Most actions
if (isset($_POST["list"]) == true) { $list = getSelectedEntries($_POST["list"]); }
else { $list = ""; }
// Bookmark
if (isset($_POST["url"]) == true) { $url = validateGenericInput($_POST["url"]); }
else { $url = ""; }
if (isset($_POST["text"]) == true) { $text = validateGenericInput($_POST["text"]); }
else { $text = ""; }
// Copy, move, delete
if (isset($_POST["ftpserver2"]) == true) { $net2ftp_globals["ftpserver2"] = validateFtpserver($_POST["ftpserver2"]); }
else { $net2ftp_globals["ftpserver2"] = ""; }
if (isset($_POST["ftpserverport2"]) == true) { $net2ftp_globals["ftpserverport2"] = validateFtpserverport($_POST["ftpserverport2"]); }
else { $net2ftp_globals["ftpserverport2"] = ""; }
if (isset($_POST["username2"]) == true) { $net2ftp_globals["username2"] = validateUsername($_POST["username2"]); }
else { $net2ftp_globals["username2"] = ""; }
if (isset($_POST["password2"]) == true) { $net2ftp_globals["password2"] = validatePassword($_POST["password2"]); }
else { $net2ftp_globals["password2"] = ""; }
if (isset($_POST["protocol2"]) == true) { $net2ftp_globals["protocol2"] = validateProtocol($_POST["protocol2"]); }
else { $net2ftp_globals["protocol2"] = ""; }
// Edit
if (isset($_POST["textareaType"]) == true) { $textareaType = validateTextareaType($_POST["textareaType"]); }
else { $textareaType = ""; }
if (isset($_POST["text"]) == true) { $text = $_POST["text"]; }
else { $text = ""; }
if (isset($_POST["text_splitted"]) == true) { $text_splitted = $_POST["text_splitted"]; }
else { $text_splitted = ""; }
// Find string
if (isset($_POST["searchoptions"]) == true) { $searchoptions = $_POST["searchoptions"]; }
// New directory
// Rename
if (isset($_POST["newNames"]) == true) { $newNames = validateEntry($_POST["newNames"]); }
else { $newNames = ""; }
// Raw FTP command
if (isset($_POST["command"]) == true) { $command = $_POST["command"]; }
else { $command = "CWD $directory_html\nPWD\n"; }
// Zip
if (isset($_POST["zipactions"]) == true) { $zipactions = $_POST["zipactions"]; }
else { $zipactions = ""; }
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
$formname = "LoginForm";
$enctype = "";
if ($net2ftp_globals["state2"] == "admin") {
$message = __("Please enter your Administrator username and password.");
$button_text = __("Login");
$username_fieldname = "input_admin_username";
$password_fieldname = "input_admin_password";
$username_value = "";
$password_value = "";
$focus = $username_fieldname;
}
elseif ($net2ftp_globals["state2"] == "bookmark") {
$message = __("Please enter your username and password for FTP server <b>%1\$s</b>.", htmlEncode2($net2ftp_globals["ftpserver"]));
$button_text = __("Login");
$username_fieldname = "username";
$password_fieldname = "password";
if (isset($net2ftp_globals["username"]) == true) {
$username_value = htmlEncode2($net2ftp_globals["username"]);
$focus = $password_fieldname;
}
else {
$username_value = "";
$focus = $username_fieldname;
}
$password_value = "";
}
elseif ($net2ftp_globals["state2"] == "session_expired") {
$message = __("Your session has expired; please enter your password for FTP server <b>%1\$s</b> to continue.", htmlEncode2($net2ftp_globals["ftpserver"]));
$button_text = __("Continue");
$username_fieldname = "username";
$password_fieldname = "password";
if (isset($net2ftp_globals["username"]) == true) {
$username_value = htmlEncode2($net2ftp_globals["username"]);
$focus = $password_fieldname;
}
else {
$username_value = "";
$focus = $username_fieldname;
}
$password_value = "";
}
elseif ($net2ftp_globals["state2"] == "session_ipchange") {
$message = __("Your IP address has changed; please enter your password for FTP server <b>%1\$s</b> to continue.", htmlEncode2($net2ftp_globals["ftpserver"]));
$button_text = __("Continue");
$username_fieldname = "username";
$password_fieldname = "password";
if (isset($net2ftp_globals["username"]) == true) {
$username_value = htmlEncode2($net2ftp_globals["username"]);
$focus = $password_fieldname;
}
else {
$username_value = "";
$focus = $username_fieldname;
}
$password_value = "";
}
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/login_small.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,174 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the login screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// -------------------------------------------------------------------------
// Variables
// -------------------------------------------------------------------------
$url = $net2ftp_globals["action_url"];
// -------------------------------------------------------------------------
// Delete all temporary files in the /temp folder which are older than 10 minutes
// -------------------------------------------------------------------------
$max_age_seconds = 600; // default: 10 minutes
if ($handle = @opendir($net2ftp_globals["application_tempdir"])) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file != ".htaccess" && $file != ".htpasswd" && $file != "chmod_this_dir_to_777.txt" && $file != "index.php") {
$dirfile = glueDirectories($net2ftp_globals["application_tempdir"], $file);
$age_in_seconds = time() - @filemtime($dirfile);
if ($age_in_seconds > $max_age_seconds) { @unlink($dirfile); }
}
}
closedir($handle);
}
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/logout.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,211 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the new directory screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
if (isset($_POST["newNames"]) == true) { $newNames = validateEntry($_POST["newNames"]); }
else { $newNames = ""; }
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
// Title
$title = __("Create new directories");
// Form name, back and forward buttons
$formname = "NewDirForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
$forward_onclick = "document.forms['" . $formname . "'].submit();";
// -------------------------------------------------------------------------
// Variables for screen 1
// -------------------------------------------------------------------------
if ($net2ftp_globals["screen"] == 1) {
// Next screen
$nextscreen = 2;
} // end if
// -------------------------------------------------------------------------
// Variables for screen 2
// -------------------------------------------------------------------------
elseif ($net2ftp_globals["screen"] == 2) {
// Open connection
setStatus(2, 10, __("Connecting to the FTP server"));
$conn_id = ftp_openconnection();
if ($net2ftp_result["success"] == false) { return false; }
// Create new directories
setStatus(4, 10, __("Processing the entries"));
for ($k=1; $k<=sizeof($newNames); $k++) {
if (strlen($newNames[$k]) > 0) {
$newsubdir = glueDirectories($net2ftp_globals["directory"], $newNames[$k]);
ftp_newdirectory($conn_id, $newsubdir);
if ($net2ftp_result["success"] == false) {
setErrorVars(true, "", "", "", ""); // Continue anyway
$net2ftp_output["newdir"][] = __("Directory <b>%1\$s</b> could not be created.", htmlEncode2($newNames[$k]));
}
else {
$net2ftp_output["newdir"][] = __("Directory <b>%1\$s</b> was successfully created.", htmlEncode2($newNames[$k]));
}
} // End if
} // End for
// Close connection
ftp_closeconnection($conn_id);
} // end elseif
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,203 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the raw FTP command screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
if (isset($_POST["command"]) == true) { $command = $_POST["command"]; }
else { $command = "CWD $directory_html\nPWD\n"; }
// -------------------------------------------------------------------------
// Variables
// -------------------------------------------------------------------------
// Title
$title = __("Send arbitrary FTP commands");
// Form name, back and forward buttons
$formname = "RawForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='advanced';document.forms['" . $formname . "'].screen.value='1';document.forms['" . $formname . "'].submit();";
$forward_onclick = "document.forms['" . $formname . "'].submit();";
// Open connection
setStatus(2, 10, __("Connecting to the FTP server"));
$conn_id = ftp_openconnection();
if ($net2ftp_result["success"] == false) { return false; }
// Explode list of commands to an array
$command_exploded = explode("\n", $command);
// Remove the empty lines
$new_command_nr = 0;
for ($command_nr=0; $command_nr<sizeof($command_exploded); $command_nr++) {
if (trim($command_exploded[$command_nr]) != "") {
$command_exploded_trimmed[$new_command_nr] = trim($command_exploded[$command_nr]);
$new_command_nr++;
}
}
// Send arbitrary FTP command
$command_total = sizeof($command_exploded_trimmed);
for ($command_nr=0; $command_nr<$command_total; $command_nr++) {
setStatus($command_nr+1, $command_total, __("Sending FTP command %1\$s of %2\$s", $command_nr+1, $command_total));
$ftp_raw_result[$command_nr] = ftp_raw($conn_id, trim($command_exploded_trimmed[$command_nr]));
}
// Close connection
ftp_closeconnection($conn_id);
// Get the messages
for ($command_nr=0; $command_nr<sizeof($command_exploded_trimmed); $command_nr++) {
for ($line_nr=0; $line_nr<sizeof($ftp_raw_result[$command_nr]); $line_nr++) {
$net2ftp_output["ftp_raw"][] = $ftp_raw_result[$command_nr][$line_nr] . "\n";
}
}
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,219 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the rename screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
if (isset($_POST["list"]) == true) { $list = getSelectedEntries($_POST["list"]); }
else { $list = ""; }
if (isset($_POST["newNames"]) == true) { $newNames = validateEntry($_POST["newNames"]); }
else { $newNames = ""; }
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
// Title
$title = __("Rename directories and files");
// Form name, back and forward buttons
$formname = "RenameForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
$forward_onclick = "document.forms['" . $formname . "'].submit();";
// -------------------------------------------------------------------------
// Variables for screen 1
// -------------------------------------------------------------------------
if ($net2ftp_globals["screen"] == 1) {
// Next screen
$nextscreen = 2;
} // end if
// -------------------------------------------------------------------------
// Variables for screen 2
// -------------------------------------------------------------------------
elseif ($net2ftp_globals["screen"] == 2) {
// Open connection
setStatus(2, 10, __("Connecting to the FTP server"));
$conn_id = ftp_openconnection();
if ($net2ftp_result["success"] == false) { return false; }
// Rename files
setStatus(4, 10, __("Processing the entries"));
for ($i=1; $i<=sizeof($list["all"]); $i++) {
if (strstr($list["all"][$i]["dirfilename"], "..") != false) {
$net2ftp_output["rename"][] = __("The new name may not contain any dots. This entry was not renamed to <b>%1\$s</b>", htmlEncode2($newNames[$i])) . ".<br />";
continue;
}
if (checkAuthorizedName($newNames[$i]) == false) {
$net2ftp_output["rename"][] = __("The new name may not contain any banned keywords. This entry was not renamed to <b>%1\$s</b>", htmlEncode2($newNames[$i])) . "<br />";
continue;
}
ftp_rename2($conn_id, $net2ftp_globals["directory"], $list["all"][$i]["dirfilename"], $newNames[$i]);
if ($net2ftp_result["success"] == false) {
setErrorVars(true, "", "", "", "");
$net2ftp_output["rename"][] = __("<b>%1\$s</b> could not be renamed to <b>%2\$s</b>", htmlEncode2($list["all"][$i]["dirfilename"]), htmlEncode2($newNames[$i]));
continue;
}
else {
$net2ftp_output["rename"][] = __("<b>%1\$s</b> was successfully renamed to <b>%2\$s</b>", htmlEncode2($list["all"][$i]["dirfilename"]), htmlEncode2($newNames[$i]));
}
} // End for
// Close connection
ftp_closeconnection($conn_id);
} // end elseif
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,284 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_result;
// Code
echo "<script type=\"text/javascript\"><!--\n";
echo "function createDirectoryTreeWindow(directory, FormAndFieldName) {\n";
echo " directoryTreeWindow = window.open(\"\",\"directoryTreeWindow\",\"height=450,width=300,resizable=yes,scrollbars=yes\");\n";
echo " var d = directoryTreeWindow.document;\n";
echo " d.writeln('<html>');\n";
echo " d.writeln('<head>');\n";
echo " d.writeln('<title>" . __("Choose a directory") . "<\/title>');\n";
echo " d.writeln('<\/head>');\n";
echo " d.writeln('<bo' + 'dy on' + 'load=\"document.forms[\\'DirectoryTreeForm\\'].submit();\">');\n";
// echo " d.writeln('<body>');\n";
echo " d.writeln('" . __("Please wait...") . "<br /><br />');\n";
echo " d.writeln('<form id=\"DirectoryTreeForm\" action=\"" . printPHP_SELF("createDirectoryTreeWindow") . "\" method=\"post\" />');\n";
printLoginInfo_javascript();
echo " d.writeln('<input type=\"hidden\" name=\"state\" value=\"browse\">');\n";
echo " d.writeln('<input type=\"hidden\" name=\"state2\" value=\"popup\">');\n";
echo " d.writeln('<input type=\"hidden\" name=\"directory\" value=\"' + directory + '\">');\n";
echo " d.writeln('<input type=\"hidden\" name=\"FormAndFieldName\" value=\"' + FormAndFieldName + '\">');\n";
echo " d.writeln('<\/form>');\n";
echo " d.writeln('<\/div>');\n";
echo " d.writeln('<\/body>');\n";
echo " d.writeln('<\/html>');\n";
echo " d.close();\n";
echo "} // end function createDirectoryTreeWindow\n";
echo "\n";
echo "function CopyValueToAll(myform, mysourcefield, mytargetfieldname) {\n";
echo " for (var i = 0; i < myform.elements.length; i++) {\n";
echo " if (myform.elements[i].name.indexOf(mytargetfieldname) >= 0) {\n";
echo " myform.elements[i].value = mysourcefield.value;\n";
echo " }\n";
echo " }\n";
echo "}\n";
echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/unzip/unzip.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the unzip screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
if (isset($_POST["list"]) == true) { $list = getSelectedEntries($_POST["list"]); }
else { $list = ""; }
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
// Title
$title = __("Unzip archives");
// Form name, back and forward buttons
$formname = "UnzipForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
$forward_onclick = "document.forms['" . $formname . "'].submit();";
// -------------------------------------------------------------------------
// Variables for screen 1
// -------------------------------------------------------------------------
if ($net2ftp_globals["screen"] == 1) {
// Next screen
$nextscreen = 2;
} // end if
// -------------------------------------------------------------------------
// Variables for screen 2
// -------------------------------------------------------------------------
elseif ($net2ftp_globals["screen"] == 2) {
$net2ftp_output["unzip"] = array();
$net2ftp_output["ftp_unziptransferfiles"] = array();
// ---------------------------------------
// Initialize variables
// ---------------------------------------
$moved_ok = 0; // Index of the archives that have been treated successfully
$moved_notok = 0; // Index of the archives that have been treated unsuccessfully
// ---------------------------------------
// Open connection to the FTP server
// ---------------------------------------
setStatus(2, 10, __("Connecting to the FTP server"));
$conn_id = ftp_openconnection();
if ($net2ftp_result["success"] == false) { return false; }
// ---------------------------------------
// Get the archives from the FTP server
// ---------------------------------------
for ($i=1; $i<=$list["stats"]["files"]["total_number"]; $i=$i+1) {
// Set the status
$message = __("Getting archive %1\$s of %2\$s from the FTP server", $i, $list["stats"]["files"]["total_number"]);
setStatus($i, $list["stats"]["files"]["total_number"], $message);
// Get the archive from the FTP server
$localtargetdir = $net2ftp_globals["application_tempdir"];
$localtargetfile = $list["files"][$i]["dirfilename"] . ".txt";
$remotesourcedir = $net2ftp_globals["directory"];
$remotesourcefile = $list["files"][$i]["dirfilename"];
$ftpmode = ftpAsciiBinary($list["files"][$i]["dirfilename"]);
$copymove = "copy";
ftp_getfile($conn_id, $localtargetdir, $localtargetfile, $remotesourcedir, $remotesourcefile, $ftpmode, $copymove);
if ($net2ftp_result["success"] == false) {
setErrorVars(true, "", "", "", "");
$net2ftp_output["unzip"][] = __("Unable to get the archive <b>%1\$s</b> from the FTP server", htmlEncode2($list["files"][$i]["dirfilename"]));
$moved_notok = $moved_notok + 1;
continue;
}
// Register the temporary file
registerTempfile("register", glueDirectories($localtargetdir, $localtargetfile));
// Enter the temporary filename and the real filename in the array
$moved_ok = $moved_ok + 1;
$acceptedArchivesArray[$moved_ok]["name"] = $list["files"][$i]["dirfilename"];
$acceptedArchivesArray[$moved_ok]["tmp_name"] = glueDirectories($localtargetdir, $localtargetfile);
$acceptedArchivesArray[$moved_ok]["targetdirectory"] = $list["files"][$i]["targetdirectory"];
$acceptedArchivesArray[$moved_ok]["use_folder_names"] = $list["files"][$i]["use_folder_names"];
} // end for
// ---------------------------------------
// Unzip archives and transfer the files (create subdirectories if needed)
// ---------------------------------------
if (isset($acceptedArchivesArray) == true && sizeof($acceptedArchivesArray) > 0) {
ftp_unziptransferfiles($acceptedArchivesArray);
$net2ftp_output["unzip"] = $net2ftp_output["unzip"] + $net2ftp_output["ftp_unziptransferfiles"];
if ($net2ftp_result["success"] == false) { return false; }
}
// ---------------------------------------
// Close the connection to the FTP server
// ---------------------------------------
ftp_closeconnection($conn_id);
} // end elseif
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,297 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
echo "<script type=\"text/javascript\"><!--\n";
echo "function createDirectoryTreeWindow(directory, FormAndFieldName) {\n";
echo " directoryTreeWindow = window.open(\"\",\"directoryTreeWindow\",\"height=450,width=300,resizable=yes,scrollbars=yes\");\n";
echo " var d = directoryTreeWindow.document;\n";
echo " d.writeln('<html>');\n";
echo " d.writeln('<head>');\n";
echo " d.writeln('<title>" . __("Choose a directory") . "<\/title>');\n";
echo " d.writeln('<\/head>');\n";
echo " d.writeln('<bo' + 'dy on' + 'load=\"document.forms[\\'DirectoryTreeForm\\'].submit();\">');\n";
// echo " d.writeln('<body>');\n";
echo " d.writeln('" . __("Please wait...") . "<br /><br />');\n";
echo " d.writeln('<form id=\"DirectoryTreeForm\" action=\"" . printPHP_SELF("createDirectoryTreeWindow") . "\" method=\"post\" />');\n";
printLoginInfo_javascript();
echo " d.writeln('<input type=\"hidden\" name=\"state\" value=\"browse\">');\n";
echo " d.writeln('<input type=\"hidden\" name=\"state2\" value=\"popup\">');\n";
echo " d.writeln('<input type=\"hidden\" name=\"directory\" value=\"' + directory + '\">');\n";
echo " d.writeln('<input type=\"hidden\" name=\"FormAndFieldName\" value=\"' + FormAndFieldName + '\">');\n";
echo " d.writeln('<\/form>');\n";
echo " d.writeln('<\/div>');\n";
echo " d.writeln('<\/body>');\n";
echo " d.writeln('<\/html>');\n";
echo " d.close();\n";
echo "} // end function createDirectoryTreeWindow\n";
echo "//--></script>\n";
// Include
echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/upload/upload.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the upload screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
$file_counter = 0;
$archive_counter = 0;
// Normal upload
if (isset($_FILES["file"]) == true && is_array($_FILES["file"]) == true) {
foreach ($_FILES["file"]["name"] as $key => $val) {
if ($val != "") {
$file_counter = $file_counter + 1;
$uploadedFilesArray["$file_counter"]["name"] = validateEntry($val);
$uploadedFilesArray["$file_counter"]["tmp_name"] = $_FILES["file"]["tmp_name"][$key];
$uploadedFilesArray["$file_counter"]["size"] = $_FILES["file"]["size"][$key];
} // end if
} // end foreach
}
if (isset($_FILES["archive"]) == true && is_array($_FILES["archive"]) == true) {
foreach ($_FILES["archive"]["name"] as $key => $val) {
if ($val != "") {
$archive_counter = $archive_counter + 1;
$uploadedArchivesArray["$archive_counter"]["name"] = validateEntry($val);
$uploadedArchivesArray["$archive_counter"]["tmp_name"] = $_FILES["archive"]["tmp_name"][$key];
$uploadedArchivesArray["$archive_counter"]["size"] = $_FILES["archive"]["size"][$key];
} // end if
} // end foreach
}
// Upload via the OpenLaszlo skin
if (isset($_FILES["Filedata"]) == true && is_array($_FILES["Filedata"]) == true) {
$file_counter = $file_counter + 1;
$uploadedFilesArray["$file_counter"]["name"] = $_FILES["Filedata"]["name"];
$uploadedFilesArray["$file_counter"]["tmp_name"] = $_FILES["Filedata"]["tmp_name"];
$uploadedFilesArray["$file_counter"]["size"] = $_FILES["Filedata"]["size"];
}
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
// Title
// The title is different for screen 1 and screen 2 - see below
// Form name, back and forward buttons
$formname = "UploadForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
$forward_onclick = "document.forms['" . $formname . "'].submit();";
// Encoding type
$enctype = "enctype=\"multipart/form-data\"";
// Next screen
$nextscreen = 2;
// Maxima
$max_filesize = formatFilesize($net2ftp_settings["max_filesize"]);
$max_upload_filesize_php = formatFilesize(@ini_get("upload_max_filesize"));
$max_execution_time = @ini_get("max_execution_time");
// -------------------------------------------------------------------------
// Variables for screen 1
// -------------------------------------------------------------------------
if ($net2ftp_globals["screen"] == 1) {
// Title
$title = __("Upload files and archives");
} // end if
// -------------------------------------------------------------------------
// Variables for screen 2
// -------------------------------------------------------------------------
elseif ($net2ftp_globals["screen"] == 2) {
// Title
$title = __("Upload more files and archives");
// ---------------------------------------
// Check the files and move them to the net2ftp temp directory
// The .txt extension is added
// ---------------------------------------
if (sizeof($uploadedFilesArray) > 0 || sizeof($uploadedArchivesArray) > 0) {
setStatus(1, 10, __("Checking files"));
if (isset($uploadedFilesArray) == true) {
$acceptedFilesArray = acceptFiles($uploadedFilesArray);
if ($net2ftp_result["success"] == false) { return false; }
}
if (isset($uploadedArchivesArray) == true) {
$acceptedArchivesArray = acceptFiles($uploadedArchivesArray);
if ($net2ftp_result["success"] == false) { return false; }
}
}
// ---------------------------------------
// Transfer files
// ---------------------------------------
if (isset($acceptedFilesArray) == true && $acceptedFilesArray != "all_uploaded_files_are_too_big" && sizeof($acceptedFilesArray) > 0) {
setStatus(0, 10, __("Transferring files to the FTP server"));
ftp_transferfiles($acceptedFilesArray, $net2ftp_globals["directory"]);
if ($net2ftp_result["success"] == false) { return false; }
}
// ---------------------------------------
// Unzip archives and transfer the files (create subdirectories if needed)
// ---------------------------------------
if (isset($acceptedArchivesArray) == true && $acceptedArchivesArray != "all_uploaded_files_are_too_big" && sizeof($acceptedArchivesArray) > 0) {
// Set the status
setStatus(0, 10, __("Decompressing archives and transferring files"));
// Add information to $acceptedArchivesArray
for ($i=1; $i<=sizeof($acceptedArchivesArray); $i=$i+1) {
$acceptedArchivesArray[$i]["targetdirectory"] = $net2ftp_globals["directory"];
}
// Unzip the archive and transfer the files
ftp_unziptransferfiles($acceptedArchivesArray);
if ($net2ftp_result["success"] == false) { return false; }
}
} // end elseif
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,28 +0,0 @@
function add_file(id, i) {
if (document.getElementById(id + '_' + i).innerHTML.search('uploadinputbutton') == -1) {
document.getElementById(id + '_' + i).innerHTML = '<input type="file" class="uploadinputbutton" maxsize="" name="' + id + '[]" onchange="return add_file(\'' + id + '\', ' + (i+1) + ');" /><br /><span id="' + id + '_' + (i+1) + '"><input type="button" value="Add other" onclick="add_file(\'' + id + '\', ' + (i+1) + ');" /><\/span>\n';
}
}
function createUploadWindow() {
uploadWindow = window.open("","uploadWindow","height=170,width=400,resizable=yes,scrollbars=yes");
var d = uploadWindow.document;
d.writeln('<html>');
d.writeln('<head>');
d.writeln('<title>Uploading... please wait...<\/title>');
d.writeln('<\/head>');
d.writeln('<body>');
d.writeln('Uploading... please wait...<br /><br />');
d.writeln('If the upload takes more than the allowed <b>60 seconds<\/b>, you will have to try again with less/smaller files.<br /><br />');
d.writeln('<scr' + 'ipt lan' + 'guage="jav' + 'ascript">');
d.writeln('setTimeout("self.close()",8000);');
d.writeln('<\/scr' + 'ipt>');
d.writeln('<form><span style="font-size: 100%;">');
d.writeln('This window will close automatically in a few seconds.<br />');
d.writeln('<a href="jav' + 'ascript:self.close();">Close window now<\/a>');
d.writeln('<\/span><\/form>');
d.writeln('<\/body>');
d.writeln('<\/html>');
d.close();
}

View file

@ -1,288 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
if ($net2ftp_globals["state2"] != "") {
// Get file
$text = ftp_readfile("", $net2ftp_globals["directory"], $net2ftp_globals["entry"]);
if ($net2ftp_result["success"] == false) { return false; }
// Send headers
header("Content-Type: " . getContentType($net2ftp_globals["entry"]));
header("Content-Disposition: inline; filename=\"" . $net2ftp_globals["entry"] . "\"");
// Send file
echo $text;
flush();
// Close the connection
header("Connection: close");
}
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/view/view.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
// CSS for Luminous syntax highlighter
$filename_extension = get_filename_extension($net2ftp_globals["entry"]);
if (getFileType($net2ftp_globals["entry"]) == "IMAGE") { $filetype = "image"; }
elseif ($filename_extension == "swf") { $filetype = "flash"; }
else { $filetype = "text"; }
if ($filetype == "text") {
luminous::set("cache", FALSE);
luminous::set("format", "html");
luminous::set("line-numbers", FALSE);
luminous::set("relative-root", $net2ftp_globals["application_rootdir_url"] . "/plugins/luminous/");
// luminous::set("theme", "luminous_dark");
echo luminous::head_html();
}
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the login screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// -------------------------------------------------------------------------
// Variables
// -------------------------------------------------------------------------
$filename_extension = get_filename_extension($net2ftp_globals["entry"]);
// ------------------------
// Set the state2 variable depending on the file extension !!!!!
// ------------------------
if (getFileType($net2ftp_globals["entry"]) == "IMAGE") { $filetype = "image"; }
elseif ($filename_extension == "swf") { $filetype = "flash"; }
else { $filetype = "text"; }
// Form name, back and forward buttons
$formname = "ViewForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
// Next screen
$nextscreen = 2;
// -------------------------------------------------------------------------
// Text
// -------------------------------------------------------------------------
if ($filetype == "text") {
// Title
$title = __("View file %1\$s", $net2ftp_globals["entry"]);
// ------------------------
// luminous_text
// ------------------------
setStatus(2, 10, __("Reading the file"));
$luminous_text = ftp_readfile("", $net2ftp_globals["directory"], $net2ftp_globals["entry"]);
if ($net2ftp_result["success"] == false) { return false; }
// ------------------------
// luminous_language
// ------------------------
$luminous_language = "";
$list_language_extensions = array(
// List the most popular languages first for speed reasons
'html' => array('html', 'htm'),
'javascript' => array('js'),
'css' => array('css'),
'php' => array('php', 'php5', 'phtml', 'phps'),
'perl' => array('pl', 'pm', 'cgi'),
'sql' => array('sql'),
'java' => array('java'),
// Other languages in alphabetic order
'ada' => array('a', 'ada', 'adb', 'ads'),
'as' => array('as'),
'asp' => array('asp'),
'cpp' => array('cpp'),
'csharp' => array('csharp'),
'diff' => array('diff'),
'go' => array('go'),
'latex' => array('latex'),
'matlab' => array('matlab'),
'python' => array('py'),
'rails' => array('rails'),
'ruby' => array('ruby'),
'sql' => array('sql'),
'vb' => array('bas'),
'vim' => array('vim'),
'xml' => array('xml')
);
while(list($language, $extensions) = each($list_language_extensions)) {
if (in_array($filename_extension, $extensions)) {
$luminous_language = $language;
break;
}
}
// ------------------------
// Call luminous
// ------------------------
setStatus(4, 10, __("Parsing the file"));
$luminous_text = luminous::highlight($luminous_language, $luminous_text, FALSE);
}
// -------------------------------------------------------------------------
// Image
// -------------------------------------------------------------------------
elseif ($filetype == "image") {
$title = __("View image %1\$s", htmlEncode2($net2ftp_globals["entry"]));
$image_url = printPHP_SELF("view");
$image_alt = __("Image") . $net2ftp_globals["entry"];
}
// -------------------------------------------------------------------------
// Flash movie
// -------------------------------------------------------------------------
elseif ($filetype == "flash") {
$title = __("View Macromedia ShockWave Flash movie %1\$s", htmlEncode2($net2ftp_globals["entry"]));
$flash_url = printPHP_SELF("view");
}
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>

View file

@ -1,220 +0,0 @@
<?php
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2013 by David Gartner |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// -------------------------------------------------------------------------------
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_sendHttpHeaders() {
// --------------
// This function sends HTTP headers
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
} // end net2ftp_sendHttpHeaders
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printJavascript() {
// --------------
// This function prints Javascript code and includes
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// Code
// echo "<script type=\"text/javascript\"><!--\n";
// echo "//--></script>\n";
// Include
// echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n";
} // end net2ftp_printJavascript
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printCss() {
// --------------
// This function prints CSS code and includes
// --------------
global $net2ftp_settings, $net2ftp_globals;
// Include
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
} // end net2ftp_printCssInclude
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBodyOnload() {
// --------------
// This function prints the <body onload="" actions
// --------------
// global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
// echo "";
} // end net2ftp_printBodyOnload
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// **************************************************************************************
// ** **
// ** **
function net2ftp_module_printBody() {
// --------------
// This function prints the zip screen
// --------------
// -------------------------------------------------------------------------
// Global variables
// -------------------------------------------------------------------------
global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
if (isset($_POST["list"]) == true) { $list = getSelectedEntries($_POST["list"]); }
else { $list = ""; }
if (isset($_POST["zipactions"]) == true) { $zipactions = $_POST["zipactions"]; }
else { $zipactions = ""; }
// -------------------------------------------------------------------------
// Variables for all screens
// -------------------------------------------------------------------------
// Title
$title = __("Zip entries");
// Form name, back and forward buttons
$formname = "ZipForm";
$back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
$forward_onclick = "document.forms['" . $formname . "'].submit();";
// -------------------------------------------------------------------------
// Variables for screen 1
// -------------------------------------------------------------------------
if ($net2ftp_globals["screen"] == 1) {
// Next screen
$nextscreen = 2;
// Default filename of the zip file
$zipfilename = get_filename_name($list["files"][1]["dirfilename"]) . ".zip";
} // end if
// -------------------------------------------------------------------------
// Variables for screen 2
// -------------------------------------------------------------------------
elseif ($net2ftp_globals["screen"] == 2) {
// --------------------
// Check the input data
// --------------------
// Filename
if ($zipactions["save"] == "yes" && $zipactions["save_filename"] == "") {
$errormessage = __("You did not enter a filename for the zipfile. Go back and enter a filename.") . "<br />";
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
// Email address
if ($zipactions["email"] == "yes" && checkEmailAddress($zipactions["email_to"]) == false) {
$errormessage = __("The email address you have entered (%1\$s) does not seem to be valid.<br />Please enter an address in the format <b>username@domain.com</b>", $zipactions["email_to"]) . "<br />";
setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
return false;
}
// --------------------
// Execute the function
// --------------------
setStatus(4, 10, __("Processing the entries"));
$zipactions["download"] == "no";
ftp_zip("", $net2ftp_globals["directory"], $list, $zipactions, "", 0);
if ($net2ftp_result["success"] == false) {
return false;
}
} // end elseif
// -------------------------------------------------------------------------
// Print the output
// -------------------------------------------------------------------------
require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
} // End net2ftp_printBody
// ** **
// ** **
// **************************************************************************************
// **************************************************************************************
?>