<?php

/************************************************************************
	UebiMiau is a GPL'ed software developed by 
	 - Aldoir Ventura - aldoir@users.sourceforge.net
	 - http://uebimiau.sourceforge.net São Paulo - Brasil
   		
	***********************************************************************
	Version 3.2.0 Upgrades and templates developed by
	 - Todd Henderson - Lead Developer - http://tdah.us 
	 - Dave Rodgers - Developer - http://www.manvel.net 
	 - Laurent (AdNovea) - Developer - http://adnovea.free.fr
	 
	***********************************************************************
	 - Special thanks to the developers at 
	codeworxtech.com, tinymce.moxiecode.com
	telaen.org, phptoys.com, winged.info, ngcoders.com
	without help this project wouldn't be possible 
	
	***********************************************************************
	- File:			install2.php
	- Developer: 	Todd Henderson / Mods by Laurent (AdNovea)
	- Date:			November 4, 2008
	- version:		(3.2.0) 1.0
	- Description:  Second stage in the installation

*************************************************************************/
	// Load config files






	
		require_once (RPATH_ROOT.CFG_CONFIG);
			if ($_SESSION['installMode'] == "reset") {
		$url = $_SERVER['SERVER_NAME'];
		$root = $url.$_SERVER['PHP_SELF'];
		$root = str_replace("install/","",$root);
		$root = str_replace("/admin.php","/",$root);
		$root = str_replace("/index.php","/",$root);
		$root = str_replace("/admin/","/",$root);
		$URL_site = "http://$root";
	} else 
		$URL_site = $website;
 ?>

	<form name="form1" method="post" action="index.php?stage=3&lid=<?php echo $lid; ?>">
	<input name="cdb" type="hidden" class="textboxgray"  id="cdb" value="text" size="4">
	<input type="hidden" name="cwebsite" value="<?php echo $_POST['cwebsite']; ?>">
	<input type="hidden" name="cabsolute_path" value="<?php echo $_POST['cabsolute_path']; ?>">
	<input type="hidden" name="cSMARTY_DIR" value="<?php echo $_POST['cSMARTY_DIR']; ?>">
	<input type="hidden" name="ctitle" value="<?php echo $_POST['ctitle']; ?>">
	
<!-- Tabs -->
	<table width='100%' cellpadding='0' cellspacing='0'>
	<tr>
		<td colspan="2"><font color="#999999"><?php echo _STG2_PATH_EXP; ?> </font><hr></td>
	</tr>
	<tr>
		<td><?php 
				$file = $cwd.PATH_CONFIG;
				echo $file;
		?></td>
		<td>
		<?php
				if (!file_exists($file)) touch ($file);
				if (is_writable($file)) {
					echo '<b><font color="green">'._STG0_WRITE.'</font></b>'; 
				} else {
					echo  '<b><font color="red">'._STG0_NWRITE.'</font></b>';
					$error="true";
				}
		?></td>
	</tr> 
 	<tr>
		<td><?php 
				$file = $cwd.PATH_ADMIN;
				echo $file;
		?></td>
		<td>
		<?php
				if (!file_exists($file)) touch ($file);
				if (is_writable($file)) {
					echo '<b><font color="green">'._STG0_WRITE.'</font></b>'; 
				} else {
					echo  '<b><font color="red">'._STG0_NWRITE.'</font></b>';
					$error="true";
				}
		?></td>
	</tr> 
 			<tr>
          <td><?php 
				$file = $cwd.$temporary_directory;
				echo $file;
		?></td>
		<td>
		<?php
				if (is_writable($file)) {
					echo '<b><font color="green">'._STG0_WRITE.'</font></b>'; 
				} else {
					echo  '<b><font color="red">'._STG0_NWRITE.'</font></b>';
					$error="true";
				}
		?></td>
	</tr>
		</td>				
	</tr>
	</table>
<?php
require_once (RPATH_ROOT.CFG_PATHS);
?>
<!-- Tab divisions -->	
	<table width='100%' cellpadding='0' cellspacing='0' class="tab"  height="350">
	<tr>
		
			<tr>
				<td colspan="2"><div align="left" class="f8"><font color="#999999"><?php echo _STG3_PATHS; ?></font></div></td>
			</tr>
			<tr>
				<td><?php echo _STG3_URL;?></td>
				<td><input name="cwebsite" type="text" class="textboxgray" id="cwebsite3" value="<?php echo $URL_site; ?>" size="80"></td>
			</tr>
			<tr>
				<td><?php echo _STG3_ABS;?></td>
				<td><input name="cabsolute_path" type="text" class="textboxgray" id="cabsolute_path2" value="<?php if ($_SESSION['installMode'] == "reset") echo $cwd; else echo $absolute_path;?>" size="80"></td>
			</tr>
			
			
			
			<tr>
				<td colspan="2"><div align="left" class="f8"><font color="#999999"><?php echo _STG3_TEMP2; ?></font></div></td>
			</tr>
			<tr>
				<td><?php echo _STG3_TEMP;?></td>
				<td><input name="ctemporary_directory" type="text" class="textboxgray" id="ctemporary_directory2" value="<?php if ($_SESSION['installMode'] == "reset") echo "./inc/database/"; else echo $temporary_directory; ?>" size="80"></td>
			</tr>
					<tr>
				<td colspan="2"><div align="left" class="f8"><font color="#999999"><?php echo _STG2_SMARTY; ?></font></div></td>
			</tr>
			<tr>
				<td><?php echo _STG2_PATH;?></td>
				<td><input name="cSMARTY_DIR" type="text" class="textboxgray" id="cSMARTY_DIR2" value="<?php if ($_SESSION['installMode'] == "reset") echo "./inc/libs/"; else echo $SMARTY_DIR; ?>" size="80"></td>
			</tr>
		
		
								
			</table>
					<div align="right"><a href="javascript:document.form1.submit();" class="menulink"><?php echo _STG_CONTINUE; ?> </a>&nbsp;&nbsp;&nbsp;&nbsp;</div>
		

	</form>

