Location: PHPKode > projects > Netautor Professional > netautor/napro4/admin/install/setup_2.php
<?php
/* +----------------------------------------------------------------------+
   | Netautor Professional Application Server                             |
   +----------------------------------------------------------------------+
   | Copyright (C) 1998-2005 digiconcept GmbH. <www.digiconcept.net>      |
   +----------------------------------------------------------------------+
   | This file is subject to license, that is bundled with this package   |
   | in the file LICENSE.TXT, and is available at through the             |
   | world-wide-web at http://www.netautor.com/license/                   |
   |                                                                      |
   | If you did not receive a copy of the license and are unable to       |
   | obtain it through the world-wide-web, please send a note to          |
   | hide@address.com so we can mail you a copy.                      |
   +----------------------------------------------------------------------+
   | Authors: Stefan Rottensteiner <hide@address.com>    |
   |          Marek  Kadziela      <hide@address.com>	      |
   |          Gregor Wollner                                              |
   |          Helli  Kleinhans											  |
   +----------------------------------------------------------------------+ */

/**
* Show required paths
*
* @author Stefan Rottensteiner
* @package setup
* @version $Revision: 1.34 $
*/

require_once ('./setup.inc'); 
if (empty($_POST['SETUP_CHECK']))
{
	Header('Location: setup.php');
	exit();
}
	error_reporting(1);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<title><?php echo SOFTWARE_NAME_FULL;?> <?php echo SOFTWARE_VERSION_FULL;?> Setup Step 2</title>
	<meta name="Description" content="<?php SOFTWARE_NAME_FULL;?> <?php echo SOFTWARE_VERSION_FULL;?> Setup Step 2">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="Expires" content="0">
	<meta name="robots" content="noindex,nofollow">
	<link href="../../include/netautor.css" rel="stylesheet" type="text/css" src="../../include/netautor.css">
</head>
<script language="JavaScript" type="text/javascript">
function goOn(SiteName,ConfirmText)
{
	if ((ConfirmText && ConfirmText!="") && (!confirm(ConfirmText))) return;
	if (testWindow && !testWindow.closed) testWindow.close();
	document.forms[0].action=SiteName;
	document.forms[0].submit();
}

function checkCookieName(field){
	var current_name = field.value;
	var new_name 	 = '';
	for (i=0;i<current_name.length;i++){
		z = current_name.charAt(i);
		if (z==' ') z='';
		if (z=='.') z='_';
		new_name+=''+z;
	}
	
	if (new_name == '') new_name='powered_by_<?php echo SOFTWARE_NAME_SHORT?>';
	field.value=new_name;
}

function changeIndexRoot(){
	var userIndexRoot = document.forms[0].elements['PATH_INDEX'].value;

	document.forms[0].elements['PATH_INDEX'].value = normalizePath(userIndexRoot);
	document.forms[0].elements['ERROR_PATH'].value='1';
	document.forms[0].submit();
	
}

function normalizePath(userGivenPath){ return userGivenPath; }
parent.frames['SETUP_HEAD'].document.setTitle('<?php echo (strtr($SETUP_LANGUAGE_TEXT['setup_step'],array('%1'=>'2','%2'=>'7')));?>');
</script>

<script language="JavaScript1.2">
/**
* Eliminate leading and trailing spaces, changes \\ into /, avoid multiple //
*/
function normalizePath(userGivenPath){
	if (!userGivenPath || userGivenPath=="") userGivenPath='/';
	var newPath = '';
	var lastChar= '';
	
	/*leftTrim*/
	i=0; while (userGivenPath.charAt(i)==" ") {i++;} if (i>0) userGivenPath=userGivenPath.substring(i);
	/*rightTrim*/
	i=userGivenPath.length; while (userGivenPath.charAt(i-1)==" ") {i--;}  if (i < userGivenPath.length) userGivenPath=userGivenPath.substr(0,i);

	for (i=0;i<userGivenPath.length;i++){
		/* Get character*/
		c = userGivenPath.charAt(i);
		/* Flip windows chars */
		if (c=='\\') c='/';
		/* Skip // */
		if (lastChar=='/' && c=='/') continue;
		/* Allowed char for name */
		newPath = newPath + c;
		lastChar = c;
	}
	/* Ensure leading / */
	if (newPath.charAt(1) != ':' && newPath.charAt(0)!= '/' ) 				newPath = '/'+newPath;
	/* Ensure ending / */
	if (newPath.charAt(newPath.length-1)!='/') 	newPath = newPath+'/';	
	return newPath;
}
	
</script>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="1" topmargin="1">
<form method="post" action="setup_2.php">
<?php 
	echo(setup_getMyVars($_POST,'PATH_'));
	if (!isset($_POST['ERROR_PATH'])) echo('<input type="hidden" name="ERROR_PATH" value="1">');
?>
<br>
<br>
<table border="0" cellspacing="0" cellpadding="0" align="center" valign="top">
	<tr>
		<td align="center" valign="top" colspan="3">
		<?php 
		if (!isset($PHP_SELF))			$PHP_SELF 			= getenv('PHP_SELF');
		if (empty($PHP_SELF))			$PHP_SELF 			= $_SERVER['PHP_SELF'];

		if (!isset($SERVER_SOFTWARE))	$SERVER_SOFTWARE 	= getenv('SERVER_SOFTWARE');
		if (empty($SERVER_SOFTWARE)) 	$SERVER_SOFTWARE	= $GLOBALS['HTTP_SERVER_VARS']['SERVER_SOFTWARE'];
		if (empty($SERVER_SOFTWARE)) 	@$SERVER_SOFTWARE	= $_SERVER['SERVER_SOFTWARE'];

		if (!isset($PATH_TRANSLATED))	$PATH_TRANSLATED 	= getenv('PATH_TRANSLATED');
		if (empty($PATH_TRANSLATED)) 	$PATH_TRANSLATED	= $GLOBALS['HTTP_SERVER_VARS']['PATH_TRANSLATED'];
		if (empty($PATH_TRANSLATED)) 	$PATH_TRANSLATED	= getenv('SCRIPT_FILENAME');
		if (empty($PATH_TRANSLATED)) 	@$PATH_TRANSLATED	= __FILE__;

		if (!isset($DOCUMENT_ROOT))		$DOCUMENT_ROOT 		= getenv('DOCUMENT_ROOT');
		if (empty($DOCUMENT_ROOT)) 		$DOCUMENT_ROOT		= $GLOBALS['HTTP_SERVER_VARS']['DOCUMENT_ROOT'];
		if (empty($DOCUMENT_ROOT)) 		@$DOCUMENT_ROOT		= $_SERVER['DOCUMENT_ROOT'];

		if( strpos( $PHP_SELF, 'php.exe') )	// Wenn php.exe im Pfad
		{
			$PHP_SELF = substr( strstr( $PHP_SELF, '.exe' ), 4 );
		}

		if (empty($PATH_INSTALL)){
			if( strpos(strtolower($SERVER_SOFTWARE),'microsoft')!==false || strpos(strtolower($SERVER_SOFTWARE),'win32')!==false || strpos(PHP_OS,'WIN') === 0 ) // Wenn NT-Server
			{
				$base_path 		= str_replace('//','/',str_replace ('\\','/',str_replace("\\",'/',$PATH_TRANSLATED)));
				$PATH_INSTALL	= substr( $base_path, 0, -strlen('admin/install/setup_2.php') );
				$PATH_OS				= 'WINDOWS';
			}
			else	// Wenn kein NT-Server
			{
				$PATH_INSTALL 	= substr($PATH_TRANSLATED,0,-strlen('admin/install/setup_2.php'));
				$PATH_OS				= 'UNIX';
			}
		}

		if (empty($PATH_CONFIG)) $PATH_CONFIG	= dirname( $PATH_INSTALL ).'/config/';
		if (empty($PATH_INDEX)){
			if (empty($REQUEST_URI)) $REQUEST_URI 	= getenv('REQUEST_URI');
			if (empty($REQUEST_URI)) $REQUEST_URI 	= $GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI'];
			if (empty($REQUEST_URI)) @$REQUEST_URI 	= $_SERVER['REQUEST_URI'];
			if (empty($REQUEST_URI)) $REQUEST_URI = $GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME'];
			$PATH_INDEX		= substr($REQUEST_URI,0,-strlen('admin/install/setup_2.php'));
		}
		$PATH_INDEX		= (substr($PATH_INDEX,0,1)=='/'?$PATH_INDEX:'/'.$PATH_INDEX);
	
		// Cache there ..
		if (empty($PATH_CACHE)) 			$PATH_CACHE			= dirname( $PATH_INSTALL ).'/cache/';
		// Save compiled layouts
		if (empty($PATH_LAYOUTS)) 			$PATH_LAYOUTS		= dirname( $PATH_INSTALL ).'/layouts/';
		// Save log-fiels here ...
		if (empty($PATH_LOGS)) 				$PATH_LOGS			= dirname( $PATH_INSTALL ).'/logs/';
		// Search for external user defined functions
		if (empty($PATH_EXTERNAL_FUNC)) 	$PATH_EXTERNAL_FUNC	= dirname( $PATH_INSTALL ).'/external/npf_lib/';	
		// Search for grafix
		if (empty($PATH_GRAFIX))			$PATH_GRAFIX		= $PATH_INDEX.'grafik/';
		// Name of the identifier cookie
		if (empty($PATH_COOKIE_NAME))		$PATH_COOKIE_NAME	= 'netautor';
		// Document-root of installation (mayby different to reported document root)
		if (empty($PATH_APPLICATION_ROOT))  $PATH_APPLICATION_ROOT = substr($PATH_INSTALL,0,-(strlen($PATH_INDEX))).'/';
		// APPLICATION_ROOT extended by possible subdirs
		if (empty($PATH_APPLICATION_ROOT_SUB))  $PATH_APPLICATION_ROOT_SUB = substr($PATH_INSTALL	,0,-(strlen('netautor/'.SOFTWARE_NAME_SHORT.'/')));
		?>
		<table class="bgwindow700" width="700" border=0 align="center" >
		<input type="hidden" name="PATH_OS" 					value="<?php echo $PATH_OS ;?>">
		<input type="hidden" name="PATH_APPLICATION_ROOT_SUB" 	value="<?php echo $PATH_APPLICATION_ROOT_SUB;?>">		
			<tr>
				<td width="694" colspan="2" align="left" valign="top" class="head">
					<img src="../../grafik/pixel.gif" width="1" height="7"><br>
					<?php echo ($SETUP_LANGUAGE_TEXT['setup_step_2']['title']); ?><br>
					<img src="../../grafik/spacer_700.gif" width="694" height="13"><br>
				</td>
			</tr>
			<tr>
				<td class="text"><font class="text"><?php echo($SETUP_LANGUAGE_TEXT['setup_step_2']['os']);?></font><br></td>
				<td  valign="top" class="text"><?php echo ucfirst($PATH_OS); ?><br></td>
			</tr>
			<tr>
				<td class="text"><?php echo($SETUP_LANGUAGE_TEXT['setup_step_2']['dir_appl']);?><br></td>
				<td  valign="top" class="text"><?php echo($PATH_APPLICATION_ROOT);?><input class="input319" onChange="this.form.elements['ERROR_PATH'].value='1';this.value=normalizePath(this.value);" class="setuptextfix" type="hidden" maxlength="250" size="40" value="<?php echo(htmlspecialchars($PATH_APPLICATION_ROOT));?>" name="PATH_APPLICATION_ROOT"></td>
			</tr>
	
			<tr>
				<td class="text"><?php echo($SETUP_LANGUAGE_TEXT['setup_step_2']['dir_base']);?><br></td>
				<td  valign="top" class="text"><?php echo($PATH_INSTALL);?><input class="input319" onChange="this.form.elements['ERROR_PATH'].value='1';this.value=normalizePath(this.value);" class="setuptextfix" type="hidden" maxlength="250" size="40" value="<?php echo(htmlspecialchars($PATH_INSTALL));?>" name="PATH_INSTALL">
				</td>
			</tr>
			<tr>
				<td class="text"><?php echo($SETUP_LANGUAGE_TEXT['setup_step_2']['dir_config']);?><br></td>
				<td  valign="top" class="text"><?php echo($PATH_CONFIG);?><input class="input319" onChange="this.form.elements['ERROR_PATH'].value='1';this.value=normalizePath(this.value);" class="setuptextfix" type="hidden" maxlength="250" size="40" value="<?php echo(htmlspecialchars($PATH_CONFIG));?>" name="PATH_CONFIG"></td>
			</tr>
			<tr>
				<td class="text"><?php echo($SETUP_LANGUAGE_TEXT['setup_step_2']['dir_index']);?><br></td>
				<td  valign="top" class="text"><?php echo($PATH_INDEX);?><input class="input319" onChange="this.value=normalizePath(this.value);changeIndexRoot();" class="setuptextfix" type="hidden" size="40" value="<?php echo(htmlspecialchars($PATH_INDEX));?>" name="PATH_INDEX"></td>
			</tr>					
			<tr>
				<td class="text"><?php echo($SETUP_LANGUAGE_TEXT['setup_step_2']['dir_gfx']);?><br></td>
				<td  valign="top" class="text"><?php echo($PATH_GRAFIX);?><input class="input319" onChange="this.form.elements['ERROR_PATH'].value='1';this.value=normalizePath(this.value);" class="setuptextfix" type="hidden" size="40" value="<?php echo(htmlspecialchars($PATH_GRAFIX));?>" name="PATH_GRAFIX"></td>
			</tr>
			<tr>
				<td colspan="2">
					<img src="../../grafik/pixel.gif" width="1" height="8" border="0" ><br>				
				</td>
			</tr>			
			<tr>
				<td class="text"><?php echo($SETUP_LANGUAGE_TEXT['setup_step_2']['dir_cache']);?><br></td>
				<td  valign="top"><input class="input319" onChange="this.form.elements['ERROR_PATH'].value='1';this.value=normalizePath(this.value);" class="setuptextfix" type="text" size="40" value="<?php echo(htmlspecialchars($PATH_CACHE));?>" name="PATH_CACHE"></td>
			</tr>			
			<tr>
				<td class="text"><?php echo($SETUP_LANGUAGE_TEXT['setup_step_2']['dir_layouts']);?><br></td>
				<td  valign="top"><input class="input319" onChange="this.form.elements['ERROR_PATH'].value='1';this.value=normalizePath(this.value);" class="setuptextfix" type="text" size="40" value="<?php echo(htmlspecialchars($PATH_LAYOUTS));?>" name="PATH_LAYOUTS"></td>
			</tr>
			
			<tr>
				<td class="text"><?php echo($SETUP_LANGUAGE_TEXT['setup_step_2']['dir_logs']);?><br></td>
				<td  valign="top"><input class="input319" onChange="this.form.elements['ERROR_PATH'].value='1';this.value=normalizePath(this.value);" class="setuptextfix" type="text" size="40" value="<?php echo(htmlspecialchars($PATH_LOGS));?>" name="PATH_LOGS"></td>
			</tr>
			
			<tr>
				<td class="text"><?php echo($SETUP_LANGUAGE_TEXT['setup_step_2']['dir_ext_func']);?><br></td>
				<td  valign="top"><input class="input319" onChange="this.form.elements['ERROR_PATH'].value='1';this.value=normalizePath(this.value);" class="setuptextfix" type="text" size="40" value="<?php echo(htmlspecialchars($PATH_EXTERNAL_FUNC));?>" name="PATH_EXTERNAL_FUNC"></td>
			</tr>
			<tr>
				<td class="text"><?php echo($SETUP_LANGUAGE_TEXT['setup_step_2']['cookie_name']);?><br></td>
				<td  valign="top"><input class="input319" onChange="this.form.elements['ERROR_PATH'].value='1';checkCookieName(this);" class="setuptextfix" type="text" maxlength="32" size="17" value="<?php echo(htmlspecialchars($PATH_COOKIE_NAME));?>" name="PATH_COOKIE_NAME"></td>
			</tr>
			<tr>
				<td colspan="2" class="text">
					<img src="../../grafik/pixel.gif" width="1" height="8"><br>			
					<b><?php echo($SETUP_LANGUAGE_TEXT['note']);?></b><br>
					<img src="../../grafik/pixel.gif" width="1" height="4"><br>
					<?php
						if ($PATH_OS=='WINDOWS')
						{
							$DRIVE	= substr($PATH_APPLICATION_ROOT,0,2);
							echo str_replace('%0%',$DRIVE,$SETUP_LANGUAGE_TEXT['setup_step_2']['nota_bene_'.$PATH_OS]).'<br>';
						}
					?>
					<?php echo($SETUP_LANGUAGE_TEXT['setup_step_2']['nota_bene']);?><br>					
				</td>
			</tr>
		</table>
		<img src="../../grafik/bgwindow_482_stop.gif" width="700" height="14"><br>	
		<table class="bgwindow700" width="700" border=0 align="center" >
			<tr>
				<td class="head" width="33%" align="center" >
					<input type="button" class="create" value="<?php echo ($SETUP_LANGUAGE_TEXT['back']);?>" 		onClick="goOn('setup_1.php');" >
				</td>
				<td class="head" width="34%" align="center" >
					<input type="button" class="preview" value="<?php echo ($SETUP_LANGUAGE_TEXT['cancel']);?>" 	onClick="goOn('setup.php');" >				
				</td>				
				<td class="head" width="33%" align="center" >
							<input type="button" class="create" value="<?php echo ($SETUP_LANGUAGE_TEXT['next']);?>" onClick="goOn('setup_3.php');" >
				</td>
			</tr>
		</table>
		<img src="../../grafik/bgwindow_482_stop.gif" width="700" height="14"><br>
	</td>
</table>

</form>
<script language="JavaScript" type="text/javascript">
var testWindow;
function doTheTest()
{
	if (testWindow && !testWindow.closed) testWindow.close();

	testWindow= window.open('','SetupTestOuputWindow','scrollbars=yes,menubars=no,locationbars=no,dependent=yes,width=640,height=600');
	document.forms[0].action="setup_2_test.php";
	document.forms[0].target="SetupTestOuputWindow";
	if (testWindow)	testWindow.focus();	
	
	window.setTimeout("window.document.forms[0].target='_self';window.document.forms[0].action='setup_2.php';",'300');
	document.forms[0].submit();
}
</script>
</body>
</html>
Return current item: Netautor Professional