Пример #1
0
?>
<!DOCTYPE html PUBLIC "XHTML 1.0 Transitional" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="<?php echo __("en"); ?>" dir="<?php echo __("ltr"); ?>">
<head>
<meta http-equiv="Content-type" content="text/html;charset=<?php echo __("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>hby-webfile_manager</title>
<?php net2ftp("printJavascript"); ?>
<?php net2ftp("printCss"); ?>
</head>
<body onload="<?php net2ftp("printBodyOnload"); ?>">

<?php net2ftp("printBody"); ?>

<?php
// ------------------------------------------------------------------------
// 4. Check the result and print out an error message. This can be done using 
//    a template, or by accessing the $net2ftp_result variable directly.
// ------------------------------------------------------------------------
if ($net2ftp_result["success"] == false) {
	require_once($net2ftp_globals["application_rootdir"] . "/skins/" . $net2ftp_globals["skin"] . "/error.template.php");
}
?>

</body>
</html>
Пример #2
0
<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>
<?php 
net2ftp("printJavascript");
net2ftp("printCss");
?>
</head>
<body onload="<?php 
net2ftp("printBodyOnload");
?>
">

<?php 
net2ftp("printBody");
?>

<?php 
// ------------------------------------------------------------------------
// 4. Check the result and print out an error message. This can be done using
//    a template, or by accessing the $net2ftp_result variable directly.
// ------------------------------------------------------------------------
if ($net2ftp_result["success"] == false) {
    require_once $net2ftp_globals["application_rootdir"] . "/skins/" . $net2ftp_globals["skin"] . "/error.template.php";
}
?>

</body>
</html>
 public function actionBrowse($id, $partial = false)
 {
     $server = Server::model()->findByPk((int) $id);
     if (!$server) {
         throw new CHttpException(404, Yii::t('mc', 'The requested page does not exist.'));
     }
     $this->net2FtpDefines();
     global $net2ftp_result, $net2ftp_settings, $net2ftp_globals;
     require_once dirname(__FILE__) . '/../extensions/net2ftp/main.inc.php';
     require_once dirname(__FILE__) . '/../extensions/net2ftp/includes/errorhandling.inc.php';
     $ftpSv = $this->getFtpServer($server);
     $sessKey = 'net2ftp_password_encrypted_' . $ftpSv['ip'] . $this->getUsername($server);
     if (!isset($_SESSION[$sessKey])) {
         if (!isset($_SESSION['net2ftp_password_encrypted'])) {
             Yii::log('No valid FTP session found, redirecting to login form');
             $this->redirect(array('ftpClient/login', 'id' => $id));
         }
         $_SESSION[$sessKey] = $_SESSION['net2ftp_password_encrypted'];
     }
     set_error_handler('net2ftpErrorHandler');
     if (!@$_REQUEST['state']) {
         $net2ftp_globals['state'] = 'browse';
         $net2ftp_globals['state2'] = 'main';
     } else {
         $net2ftp_globals['state'] = $_REQUEST['state'];
         $net2ftp_globals['state2'] = $_REQUEST['state2'];
     }
     $net2ftp_globals['ftpserver'] = $ftpSv['ip'];
     $net2ftp_globals['ftpserverport'] = $ftpSv['port'];
     $net2ftp_globals['language'] = Yii::app()->language;
     $net2ftp_globals['username'] = $this->getUsername($server);
     $net2ftp_globals['action_url'] = CHtml::normalizeUrl(array('browse', 'id' => $id, 'partial' => $partial));
     net2ftp("sendHttpHeaders");
     //print_r($net2ftp_globals);
     if ($net2ftp_result["success"] == false) {
         throw new CHttpException(404, Yii::t('mc', 'Error in the FTP client module.'));
     }
     ob_start();
     net2ftp("printJavascript");
     $js = ob_get_contents();
     ob_clean();
     net2ftp("printCss");
     $css = ob_get_contents();
     ob_clean();
     net2ftp("printBodyOnload");
     $onload = ob_get_contents();
     ob_clean();
     global $controller;
     $controller = $this;
     net2ftp("printBody");
     $body = ob_get_contents();
     ob_clean();
     if ($net2ftp_result["success"] == false) {
         require_once $net2ftp_globals["application_rootdir"] . "/skins/" . $net2ftp_globals["skin"] . "/error.template.php";
         $body = ob_get_contents();
         ob_clean();
     }
     $func = $partial ? 'renderPartial' : 'render';
     $this->{$func}('browse', array('js' => $js, 'css' => $css, 'onload' => $onload, 'body' => $body, 'server' => $server));
 }