Location: PHPKode > scripts > OurWebFTP > ourwebftp/_init.php
<?
/* ADDITIONAL SETTINGS FOR OURWEBFTP	*/

// IF YOU WISH TO CONNECT DIRECTLY TO YOUR FTP SERVER - ONE ACCOUNT FOR EVERYONE
//define( 'DIRECT_CONNECTION_HOST',		'localhost' );
//define( 'DIRECT_CONNECTION_USER',		'my_username' );
//define( 'DIRECT_CONNECTION_PASSWORD',	'my_password' );

// HOME DIRECTORY. IF IT IS LEFT COMMENTED OUT, THE ROOT IS HOME
//define( 'USER_START_DIR',	'www/sites' );

/* END OF ADDITIONAL SETTINGS FOR OURWEBFTP	*/

ini_set( 'include_path', '.' );

/****************************************************/
/*	THESE SETTINGS MAY BE CONFIGURED				*/
/****************************************************/
define( 'SESSION_LIFETIME',	300 );

/****************************************************/
/*	THERE'S NOTHING TO EDIT BELOW THIS LINE			*/
/****************************************************/
define( 'APP_DIR',		realpath( dirname(__FILE__) ) );
define( 'MWF_DIR',		'mwftp5' );
define( 'HCLIB_DIR',	realpath( APP_DIR . '/' . MWF_DIR . '/_hclib' ) );
define( 'SESSION_DIR',	APP_DIR . '/' . MWF_DIR . '/_sessions' );
define( 'FREE_VERSION', 0 );
define( 'FREE_VERSION_NOTICE', '<SPAN STYLE="COLOR: #BB0000; FONT-WEIGHT: bold">This feature is available only in the <A HREF="http://www.mywebftp.com/from_free.php"><B>Pro Version</B></A>.</SPAN><BR>' );
define( 'FREE_VERSION_NOTICE2', '<DIV STYLE="COLOR: #000000; BACKGROUND-COLOR: #FFFFCC; BORDER: #DDDDDD 1px solid; PADDING: 4px; MARGIN: 4px">In the <A HREF="http://www.mywebftp.com/from_free.php"><B>Pro Version</B></A> - save your sites login data, download files, upload zip files and unzip them, edit and update text files.</DIV>' );

// DEFINE APP_WEB_DIR - in web_dir.php file
include_once( APP_DIR . '/' . MWF_DIR . '/web_dir.php' );
define( 'APP_ROOT_PAGE',	APP_WEB_DIR . '/index.php' );

// INCLUDE HCLIB
include_once( HCLIB_DIR . '/_init.php' );
$hcLib = new hcLib();
$hcLib->init();

// DEFINE MODULES PATHS
define( '_MODULE_FTP_DIR',		APP_DIR . '/' . MWF_DIR . '/ftp' );
define( '_MODULE_HOSTER_DIR',	APP_DIR . '/' . MWF_DIR . '/hoster' );
define( '_MODULE_PERSONAL_DIR',	APP_DIR . '/' . MWF_DIR . '/personal' );
define( '_MODULE_FREE_DIR',		APP_DIR . '/' . MWF_DIR . '/free' );
define( 'COMMON_FILES_DIR',		APP_DIR . '/' . MWF_DIR . '/common' );

if( defined('DIRECT_CONNECTION_HOST') && (!isset($_REQUEST['mwh']) || $_REQUEST['mwh'] == 1) ){
	$_REQUEST['op'] = 'login';
	$_REQUEST['ftp_host'] = DIRECT_CONNECTION_HOST;
	$_REQUEST['ftp_user'] = DIRECT_CONNECTION_USER;
	$_REQUEST['ftp_pass'] = DIRECT_CONNECTION_PASSWORD;
	}

// INSTANTIATE REQUEST AND RESPONSE
$req = new hcRequest;

// ADD HANDLERS
$app = 'hoster';
switch( $app ){
	case 'hoster':
		$versionFile = _MODULE_HOSTER_DIR . '/version.txt';
		define( 'APP_PRODUCT_NAME', 'OurWebFTP - Free Online FTP' );
		define( 'APP_PRODUCT_SITE', 'http://www.ourwebftp.com' );
		define( '_MODULE_DIR', _MODULE_HOSTER_DIR );
		break;
	case 'personal':
		define( 'APP_PRODUCT_NAME', 'MyWebFTP Pro' );
		define( 'APP_PRODUCT_SITE', 'http://www.mywebftp.com' );
		$versionFile = _MODULE_PERSONAL_DIR . '/version.txt';
		define( '_MODULE_DIR', _MODULE_PERSONAL_DIR );
		break;
	case 'free':
		define( 'APP_PRODUCT_NAME', 'MyWebFTP' );
		define( 'APP_PRODUCT_SITE', 'http://www.mywebftp.com' );
		$versionFile = _MODULE_FREE_DIR . '/version.txt';
		define( '_MODULE_DIR', _MODULE_FREE_DIR );
		break;
	}
include_once( _MODULE_DIR . '/_init.php' );

if( filesize($versionFile) > 0 ){
	$mwfVersion = fread($fp = fopen($versionFile, 'r'), filesize($versionFile));
	fclose($fp);
	}
define( 'APP_VERSION',	$mwfVersion );

$resp = new hcResponse( $req );
$resp->setTarget( APP_ROOT_PAGE );

// HERE'S THE LONG LIST OF DEFINES
define( 'CHNDL_FTP_HOST',	'ftp_host' );
define( 'CHNDL_FTP_TITLE',	'ftp_title' );
define( 'CHNDL_FTP_USER',	'ftp_user' );
define( 'CHNDL_FTP_PASS',	'ftp_pass' );
define( 'CHNDL_FTP_PORT',	'ftp_port' );
define( 'CHNDL_FTP_STARTDIR',	'dir' );


define( 'CHNDL_SITE_ID',	'site_id' );
define( 'CHNDL_ADMIN_PASS',	'admin_pass' );
define( 'CHNDL_OLD_PASS',	'old_pass' );
define( 'CHNDL_NEW_PASS1',	'new_pass1' );
define( 'CHNDL_NEW_PASS2',	'new_pass2' );
define( 'HTML_PERM_FORM_PREFIX',	'perm_' );

define( 'PARAM_TARGET_CONTROL',			'tc' );

define( 'CHNDL_FILE_NAME',				'file_name' );
define( 'CHNDL_RENAME_NEW_NAME',		'new_name' );
define( 'CHNDL_NEW_DIR_NAME',			'new_dir_name' );
define( 'CHNDL_NEW_FILE_NAME',			'new_file_name' );
define( 'CHNDL_MOVETO_DIR_NAME',		'moveto_dir_name' );
define( 'CHNDL_COPYTO_DIR_NAME',		'copyto_dir_name' );
define( 'CHNDL_COPYTO_NEW_FILE_NAME',	'copyto_new_name' );
define( 'CHNDL_MULTICOPYTO_DIR_NAME',	'multicopyto_dir_name' );
define( 'CHNDL_CHMOD_NEW_MODE',			'new_mode' );
define( 'CHNDL_UPLOAD_FIELD',			'upload_file' );
define( 'CHNDL_UPLOAD_MODE',			'upload_mode' );
define( 'CHNDL_TRANSLOAD_FIELD',		'transload_file' );
define( 'CHNDL_TRANSLOAD_MODE',			'transload_mode' );
define( 'CHNDL_FILE_CONTENT',			'file_content-notranslate' );

define( 'CHNDL_FTPLOAD_FIELD',			'ftpload_file' );
define( 'CHNDL_FTPLOAD_MODE',			'ftpload_mode' );
define( 'CHNDL_FTPLOAD_SRC_HOST',		'ftpload_host' );
define( 'CHNDL_FTPLOAD_SRC_USER',		'ftpload_user' );
define( 'CHNDL_FTPLOAD_SRC_PASSWORD',	'ftpload_pass' );

define( 'CHNDL_EMAIL_ADDRESS',			'email_address' );

define( 'CHNDL_FILTER_VALUE_NAME',		'filter' );
define( 'CHNDL_DIR_NAME',				'dir' );

define( 'CHNDL_SAVEIN_DIR_NAME',		'savein_dir_name' );

define( 'UNZIP_MODE_TREE', 1 );
define( 'UNZIP_MODE_FLAT', 2 );

define( 'HTML_MAX_FILE_FIELDS',			10 );

/*
* CONSTANTS REQUIRED BY JAVASCRIPT
*/
define( 'HTML_DIV_ACTION_WRAPPER',			'wrp' );
define( 'HTML_DIV_ACTION_CALL_BUTTON',		'CallButton' );

// INCLUDE SOME FILES
include_once( APP_DIR . '/' . MWF_DIR . '/common/classes/mwfCommonView.php' );

// INSTANTIATE LANGUAGE MANAGER
$messageFilesDir = _MODULE_DIR . '/lang';
$mm = new hcMessageManager( $messageFilesDir );
$mm->_cookieName = 'mywebftp_language';
$mm->init();
$resp->setMessageManager( $mm );


// MISC INIT FUNCTION
function myInit( $fullFileName ){
	global $resp;
	$thisHandle = str_replace( '_init', '', basename($fullFileName, '.php') );
	$filesRelativeDir = $thisHandle . '_files';

	define( 'MODULE_ROOT_DIR', dirname($fullFileName) );
	$filesDir = realpath( MODULE_ROOT_DIR . '/' . $filesRelativeDir );
	define( 'FILES_DIR',	$filesDir );

	$filesWebDir = APP_WEB_DIR . '/' . MWF_DIR . '/' . basename( dirname($fullFileName) ) . '/' . $filesRelativeDir;
	define( 'FILES_WEB_DIR', $filesWebDir );

	// THIS FILE CODE INCLUDES
	include_once( FILES_DIR . '/include.php' );
	}
?>
Return current item: OurWebFTP