本文整理汇总了PHP中validateGenericInput函数的典型用法代码示例。如果您正苦于以下问题:PHP validateGenericInput函数的具体用法?PHP validateGenericInput怎么用?PHP validateGenericInput使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了validateGenericInput函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: net2ftp_module_printBody
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"] = "";
}
// 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 = "";
}
//.........这里部分代码省略.........
示例2: getSelectedEntries
function getSelectedEntries($list)
{
// --------------
// Input = array where dirfilename is set if the entry was selected, not set if not selected:
// [1] => Array ( [dirfilename] => dir1 [dirorfile] => d [size] => 0 [selectable] => ok [permissions] => ---rw-rw- ) <-- selected
// [2] => Array ( [dirfilename] => dir2 [dirorfile] => d [size] => 0 [selectable] => ok [permissions] => ---rw-rw- ) <-- selected
// [3] => Array ( [dirfilename] => dir3 [dirorfile] => d [size] => 0 [selectable] => too_big [permissions] => ---rw-rw- ) <-- selected
// [4] => Array ( [dirorfile] => d [size] => 0 [selectable] => ok [permissions] => ---rw-rw- ) <-- not selected
//
// Output = array with only the selected entries, which are not TOO BIG or which do not contain a forbidden keyword
// [1] => Array ( [dirfilename] => dir1 [dirorfile] => d [size] => 0 [permissions] => ---rw-rw- )
// [2] => Array ( [dirfilename] => dir2 [dirorfile] => d [size] => 0 [permissions] => ---rw-rw- )
// --------------
// Global variables
global $net2ftp_globals;
$newlist = array();
$newlist["directories"] = array();
$newlist["files"] = array();
$newlist["symlinks"] = array();
$newlist["unrecognized"] = array();
$directory_index = 1;
$file_index = 1;
$symlink_index = 1;
$unrecognized_index = 1;
$all_index = 1;
for ($i = 1; $i <= sizeof($list); $i = $i + 1) {
if (isset($list[$i]["dirorfile"]) == true && isset($list[$i]["dirfilename"]) == true) {
if (isset($list[$i]["selectable"]) == false || $list[$i]["selectable"] != "ok" && ($net2ftp_globals["state"] == "downloadfile" || $net2ftp_globals["state"] == "downloadzip" || $net2ftp_globals["state"] == "edit" || $net2ftp_globals["state"] == "findstring" || $net2ftp_globals["state"] == "unzip" || $net2ftp_globals["state"] == "view" || $net2ftp_globals["state"] == "zip" || $net2ftp_globals["state2"] == "copy" || $net2ftp_globals["state2"] == "move")) {
continue;
}
$list[$i]["dirfilename"] = validateGenericInput($list[$i]["dirfilename"]);
$list[$i]["dirfilename_html"] = htmlEncode2($list[$i]["dirfilename"]);
$list[$i]["dirfilename_js"] = javascriptEncode2($list[$i]["dirfilename"]);
if ($list[$i]["dirorfile"] == "d") {
$newlist["directories"][$directory_index] = $list[$i];
$directory_index++;
$newlist["all"][$all_index] = $list[$i];
$all_index++;
} elseif ($list[$i]["dirorfile"] == "-") {
$newlist["files"][$file_index] = $list[$i];
$file_index++;
$newlist["all"][$all_index] = $list[$i];
$all_index++;
} elseif ($list[$i]["dirorfile"] == "l") {
$newlist["symlinks"][$symlink_index] = $list[$i];
$symlink_index++;
$newlist["all"][$all_index] = $list[$i];
$all_index++;
} elseif ($list[$i]["dirorfile"] == "u") {
$newlist["unrecognized"][$unrecognized_index] = $list[$i];
$unrecognized_index++;
$newlist["all"][$all_index] = $list[$i];
$all_index++;
}
}
}
// end for
// Store the statistics
$newlist["stats"]["directories"]["total_number"] = $directory_index - 1;
$newlist["stats"]["files"]["total_number"] = $file_index - 1;
$newlist["stats"]["symlinks"]["total_number"] = $symlink_index - 1;
$newlist["stats"]["unrecognized"]["total_number"] = $unrecognized_index - 1;
return $newlist;
}
示例3: net2ftp_module_printBody
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["url"]) == true) {
// Do not urlEncode2() this variable, it's already encoded in printPHP_SELF()
$url = $_POST["url"];
} else {
$url = "";
}
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";
}
示例4: net2ftp_module_printBody
//.........这里部分代码省略.........
// ------------------------------------
$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");
} 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");
}
} 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";
}
}
示例5: htmlEncode2
$net2ftp_globals["screen_html"] = htmlEncode2($net2ftp_globals["screen"]);
$net2ftp_globals["screen_url"] = urlEncode2($net2ftp_globals["screen"]);
$net2ftp_globals["screen_js"] = javascriptEncode2($net2ftp_globals["screen"]);
// ----------------------------------------------
// MAMBO variables
// ----------------------------------------------
if (defined("_VALID_MOS") == true) {
$option = validateGenericInput($_GET["option"]);
$Itemid = validateGenericInput($_GET["Itemid"]);
$net2ftp_globals["action_url"] .= "?option={$option}&Itemid={$Itemid}";
}
// ----------------------------------------------
// DRUPAL variables
// ----------------------------------------------
if (defined("CACHE_PERMANENT") == true) {
$q = validateGenericInput($_GET["q"]);
$net2ftp_globals["action_url"] .= "?q={$q}";
}
// -------------------------------------------------------------------------
// 5.1 Delete the session data when logging out
// -------------------------------------------------------------------------
if ($net2ftp_globals["state"] == "logout") {
$_SESSION["net2ftp_password_encrypted_" . $net2ftp_globals["ftpserver"] . $net2ftp_globals["username"]] = "";
}
// -------------------------------------------------------------------------
// 5.2 Redirect to login_small
// if session has expired (not for OpenLaszlo skin as it does not make a connection on the Login screen)
// if the IP address has changed (disabled as this may cause problems for some people)
// if the password is blank
// -------------------------------------------------------------------------
if ($net2ftp_globals["state"] != "login" && $net2ftp_globals["state"] != "login_small" && $_SESSION["net2ftp_session_id_old"] != $_SESSION["net2ftp_session_id_new"]) {
示例6: net2ftp_module_printBody
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";
}
示例7: getBrowser
function getBrowser($what)
{
// --------------
// This function returns the browser name, version and platform using the http_user_agent string
// --------------
// Original code comes from http://www.phpbuilder.com/columns/tim20000821.php3?print_mode=1
// Written by Tim Perdue, and released under the GPL license
//
// SourceForge: Breaking Down the Barriers to Open Source Development
// Copyright 1999-2000 (c) The SourceForge Crew
// http://sourceforge.net
//
// $Id: tim20000821.php3,v 1.2 2001/05/22 19:22:47 tim Exp $
// -------------------------------------------------------------------------
// If no information is available, return ""
// -------------------------------------------------------------------------
if (isset($_SERVER["HTTP_USER_AGENT"]) == false) {
return "";
}
// -------------------------------------------------------------------------
// Remove XSS code
// -------------------------------------------------------------------------
$http_user_agent = validateGenericInput($_SERVER["HTTP_USER_AGENT"]);
// -------------------------------------------------------------------------
// Determine browser and version
// -------------------------------------------------------------------------
if ($what == "version" || $what == "agent") {
// !!! If a new browser is added, add is also in the plugin properties
// Else, functionality will be broken when loading the plugin in printTextareaSelect().
if (ereg('MSIE ([0-9].[0-9]{1,2})', $http_user_agent, $regs)) {
$BROWSER_VERSION = $regs[1];
$BROWSER_AGENT = 'IE';
} elseif (ereg('Safari/([0-9].[0-9]{1,2})', $http_user_agent, $regs)) {
$BROWSER_VERSION = $regs[1];
$BROWSER_AGENT = 'Safari';
} elseif (ereg('Chrome/([0-9].[0-9]{1,2})', $http_user_agent, $regs)) {
$BROWSER_VERSION = $regs[1];
$BROWSER_AGENT = 'Chrome';
} elseif (ereg('Opera ([0-9].[0-9]{1,2})', $http_user_agent, $regs)) {
$BROWSER_VERSION = $regs[1];
$BROWSER_AGENT = 'Opera';
} elseif (ereg('Mozilla/([0-9].[0-9]{1,2})', $http_user_agent, $regs)) {
$BROWSER_VERSION = $regs[1];
$BROWSER_AGENT = 'Mozilla';
} else {
$BROWSER_VERSION = 0;
$BROWSER_AGENT = 'Other';
}
if ($what == "version") {
return $BROWSER_VERSION;
} elseif ($what == "agent") {
return $BROWSER_AGENT;
}
} elseif ($what == "platform") {
if (strstr($http_user_agent, 'BlackBerry') || strstr($http_user_agent, 'DoCoMo') || strstr($http_user_agent, 'Nokia') || strstr($http_user_agent, 'Palm') || strstr($http_user_agent, 'SonyEricsson') || strstr($http_user_agent, 'SymbianOS') || strstr($http_user_agent, 'Windows CE')) {
$BROWSER_PLATFORM = 'Mobile';
} elseif (strstr($http_user_agent, 'iPhone') || strstr($http_user_agent, 'iPod')) {
$BROWSER_PLATFORM = 'iPhone';
} elseif (strstr($http_user_agent, 'Win')) {
$BROWSER_PLATFORM = 'Win';
} else {
if (strstr($http_user_agent, 'Mac')) {
$BROWSER_PLATFORM = 'Mac';
} else {
if (strstr($http_user_agent, 'Linux')) {
$BROWSER_PLATFORM = 'Linux';
} else {
if (strstr($http_user_agent, 'Unix')) {
$BROWSER_PLATFORM = 'Unix';
} else {
$BROWSER_PLATFORM = 'Other';
}
}
}
}
return $BROWSER_PLATFORM;
}
// end if elseif
}
示例8: net2ftp_module_printBody
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 = glueDirectories($net2ftp_globals["application_rootdir"], "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();";
} 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) {
//.........这里部分代码省略.........
示例9: validateGenericInput
$ftpserverport = validateGenericInput($_POST["ftpserverport"]);
}
if (isset($_POST["username"]) == true) {
$username = validateGenericInput($_POST["username"]);
}
if (isset($_POST["password"]) == true) {
$password = validateGenericInput($_POST["password"]);
}
if (isset($_POST["passivemode"]) == true) {
$passivemode = validateGenericInput($_POST["passivemode"]);
}
if (isset($_POST["targetdirectory"]) == true) {
$targetdirectory = validateDirectory($_POST["targetdirectory"]);
}
if (isset($_POST["screen"]) == true) {
$screen = validateGenericInput($_POST["screen"]);
}
if (isset($_SERVER["SCRIPT_NAME"]) == true) {
$php_self = $_SERVER["SCRIPT_NAME"];
} elseif (isset($_SERVER["PHP_SELF"]) == true) {
$php_self = $_SERVER["PHP_SELF"];
}
$tempdir = dirname(__FILE__) . "/net2ftp_temp_06er8";
// --------------------------------------------------------------------------------
// HTML start
// --------------------------------------------------------------------------------
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en" dir="LTR">
<head>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1">
示例10: net2ftp_module_printBody
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";
}
示例11: net2ftp_module_printBody
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";
}