Location: PHPKode > projects > O - OpenSource GroupWare > osgw/config/index.php
<?php
/**************************************************************************
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   @Authors:	Ryan Thompson(hide@address.com)
***************************************************************************/
include('../osgw/classes/class.config.php');
include('../osgw/global.inc.php');

//Go elsewhere if config exists for easier security
if(file_exists('../config.inc.php'))
{
	header("Location: upgrade_config.php");
}
$setup = new setup();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>OpenSource GroupWare Setup</title>
<link rel="stylesheet" type="text/css" href="config.css">
<script type="text/javascript">
	function openhelp(popurl){
		winpops=window.open(popurl,"","width=400,height=338,resizable,")
	}
</script>
</head>
<body>
<form action="./create_config.php" method="post">
<?php
	//Make sure O can be run on the current server.
	if(!$setup->get_support('system'))
	{
		echo '<div style="background: #FF0000; color: #FFFFFF;font-weight:bold">';
		echo $setup->warning;
		echo '</div>';
	}
?>
<table width="700" cellpadding="1" cellspacing="0" style="border: 1px solid #FFFFFF; background: #336699;" align="center">
<tr>
<td>
<table width="700" align="center" style="border: 1px solid #FFFFFF; background: #336699;">

<tr>
<td class="header" style="text-align:right;padding:0px" valign="top" colspan="3">
	<?php echo OSGW_NAME?> Setup&nbsp;&nbsp;&nbsp;<a href="<?php echo HOME?>">
	<img src="../osgw/graphics/o.png" border="0" align="top"></a>
</td>
</tr>
<tr>
	<td class="caption">
		Site Name:
	</td>
	<td class="input">
		<input type="text" name="sitename" value="<?php echo OSGW_NAME?>" size="50">
	</td>

</tr>
<tr>
	<td class="caption">
		Site Logo:
	</td>
	<td class="input">
		<input type="text" name="sitelogo" value="o.png" size="25">
	</td>

</tr>
<tr>
	<td class="caption">
		Config Access Password:
	</td>
	<td class="input">
		<input type="text" value="" name="config_access">
	</td>
</tr>
<tr>
	<td class="caption">
		Root Directory:
	</td>
	<td class="input">
		<input type="text" size="50"
			value="<?php echo $setup->guess_root_dir(getcwd(), PHP_OS);?>" name="root_dir">
		<a href="javascript:openhelp('./help?q=root_dir')" title="Get Help!">(?)</a>
	</td>
</tr>
<tr>
	<td class="caption">
		Root URL:
	</td>
	<td class="input">
		<input type="text" size="50" value="<?php echo $setup->guess_root_url();?>" name="root_url">
		<a href="javascript:openhelp('./help?q=root_url')" title="Get Help!">(?)</a>
	</td>
</tr>
<tr>
	<td class="caption">
		Temporary Directory:
	</td>
	<td class="input">
		<input type="text" name="temp_dir" value="<?php
			if(PHP_OS == "WinNT")
			{
				echo "C:\\Temp";
			} elseif(PHP_OS == "Linux")
			{
				echo "/tmp";
			}
		
		?>">
	
	</td>
</tr>
<tr>
	<td class="caption">
		Database Type:
	</td>
	<td class="input">
		<?php echo $setup->get_supported_dbs();?>
	</td>
</tr>
<tr>
	<td class="caption">
		Database Host:
	</td>
	<td class="input">
		<input type="text" value="localhost" name="db_host">
	</td>
</tr>
<tr>
	<td class="caption">
		Database Name:
	</td>
	<td class="input">
		<input type="text" value="osgw" name="db_name">
	</td>
</tr>
<tr>
	<td class="caption">
		Database User:
	</td>
	<td class="input">
		<input type="text" value="osgw" name="db_user">
	</td>
</tr>
<tr>
	<td class="caption">
		Database Password:
	</td>
	<td class="input">
		<input type="password" value="" name="db_pass">
	</td>
</tr>
<tr>
	<td class="caption">
		Confirm Password:
	</td>
	<td class="input">
		<input type="password" value="" name="db_pass_confirm">
	</td>
</tr>
<tr>
	<td class="caption">
		Debugging:
	</td>
	<td class="input">
	<?php
		if($setup->get_support('debug'))
		{
			echo $setup->debug_select;
		} else {
			echo $setup->warning;
		}
	?>
	</td>
</tr>
<tr>
	<td colspan="2" class="footer">
		<input type="hidden" name="cfg_password" value="<?php echo $_POST['cfg_password']?>">
		<?php
		
			if(is_writeable('../'))
			{
		?>
			<input type="submit" name="write_config" value="Write Config" style="border:1px solid black">
		<?php
			} else {
				echo "Due to changes in the configure script O requires write access to its root directory ";
				echo "If you can't give O write access you can manually configure it instead";
				echo "<br />This is only temporary.";
			}
			
			
		?>
</tr>
</table>
</td>
</tr>
</table>
</form>

</body>
</html>
Return current item: O - OpenSource GroupWare