<?php
+/**********************************************************************
+ This installer is based on code from the
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2007, Ryan Djurovich.
+ The code is released under GPLv3
+ modified by FrontAcounting, LLC.
+***********************************************************************/
error_reporting(E_ALL);
ini_set("display_errors", "On");
// Start a session
-if(!defined('SESSION_STARTED'))
+if(!defined('SESSION_STARTED'))
{
session_name('ba_session_id');
session_start();
}
// Check if the page has been reloaded
-if(!isset($_GET['sessions_checked']) || $_GET['sessions_checked'] != 'true')
+if(!isset($_GET['sessions_checked']) || $_GET['sessions_checked'] != 'true')
{
// Set session variable
$_SESSION['session_support'] = '<font class="good">Enabled</font>';
// Reload page
header('Location: index.php?sessions_checked=true');
exit(0);
-}
-else
+}
+else
{
// Check if session variable has been saved after reload
- if(isset($_SESSION['session_support']))
+ if(isset($_SESSION['session_support']))
{
$session_support = $_SESSION['session_support'];
- }
- else
- {
+ }
+ else
+ {
$session_support = '<font class="bad">Disabled</font>';
}
}
$path_to_root = "..";
-include_once($path_to_root.'/config.php');
+//include_once($path_to_root.'/config.php');
+$comp_path = $path_to_root."/company";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<table cellpadding="0" cellspacing="0" border="0" width="750" align="center">
<tr>
<td width="100%" align="center" style="font-size: 20px;">
- <font style="color: #FFFFFF;">FrontAccounting</font>
+ <font style="color: #FFFFFF;">FrontAccounting</font>
<font style="color: #DDDDDD;">Installation Wizard</font>
</td>
</tr>
<center>
<img src="<?php echo $path_to_root; ?>/themes/default/images/logo_frontaccounting.png" width="250" height="50" alt="Logo" />
</center>
-
-
+
+
<?php
if(isset($_SESSION['message']) AND $_SESSION['message'] != '') {
?><div style="width: 700px; padding: 10px; margin-bottom: 5px; border: 1px solid #FF0000; background-color: #FFDBDB;"><b>Error:</b> <?php echo $_SESSION['message']; ?></div><?php
?><font class="bad">Enabled</font><?php
} else {
?><font class="good">Disabled</font><?php
- }
+ }
+ ?>
+ </td>
+ </tr>
+ <?php if (substr(php_sapi_name(), 0, 3) == 'cgi') { ?>
+ <tr>
+ <td width="140" style="color: #666666;">Magic Quotes GPC</td>
+ <td width="35">
+ <?php
+ if(ini_get('magic_quotes_gpc')) {
+ echo '<font class="bad">Enabled</font>';
+ } else {
+ echo '<font class="good">Disabled</font>';
+ }
+ ?>
+ </td>
+ <td width="140" style="color: #666666;">Register Globals</td>
+ <td width="35">
+ <?php
+ if (ini_get('register_globals')) {
+ echo '<font class="bad">Enabled</font>';
+ } else {
+ echo '<font class="good">Disabled</font>';
+ }
?>
</td>
</tr>
+ <?php } ?>
</table>
<table cellpadding="3" cellspacing="0" width="100%" align="center">
<tr>
<td style="color: #666666;">lang/</td>
<td><?php if(is_writable($path_to_root.'/lang/')) { echo '<font class="good">Writeable</font>'; } elseif(!file_exists($path_to_root.'/lang/')) { echo '<font class="bad">Directory Not Found</font>'; } else { echo '<font class="bad">Unwriteable</font>'; } ?></td>
<td style="color: #666666;"><?php echo 'Company data dirs ('. $comp_path. '/*)'; ?></td>
- <td><?php if(is_writable($comp_path) && is_writable($comp_path.'/0') && is_writable($comp_path.'/0/images'))
+ <td><?php if(is_writable($comp_path) && is_writable($comp_path.'/0') && is_writable($comp_path.'/0/images'))
{ echo '<font class="good">Writeable</font>'; } elseif(!file_exists($comp_path)) {
echo '<font class="bad">Directory Not Found</font>'; } else { echo '<font class="bad">Unwriteable</font>'; } ?></td>
</tr>
<td colspan="5">Please enter your MySQL database server details below...</td>
</tr>
<tr>
- <td width="120" style="color: #666666;">Host Name:</td>
+ <td width="150" style="color: #666666;">Host Name:</td>
<td width="230">
<input type="text" tabindex="7" name="database_host" style="width: 98%;" value="<?php if(isset($_SESSION['database_host'])) { echo $_SESSION['database_host']; } else { echo 'localhost'; } ?>" />
</td>
</td>
</tr>
<tr>
- <td style="color: #666666;">Table Prefix:</td>
+ <td style="color: #666666;">Table Prefix ( 0_ ):</td>
<td>
- <input type="text" tabindex="11" name="table_prefix" style="width: 250px;" value="<?php if(isset($_SESSION['table_prefix'])) { echo $_SESSION['table_prefix']; } else { echo '0_'; } ?>" />
+ <input type="checkbox" tabindex="11" name="table_prefix" id="table_prefix" value="true"<?php if(!isset($_SESSION['table_prefix'])) { echo ' checked'; } elseif($_SESSION['table_prefix'] == 'true') { echo ' checked'; } ?> />
</td>
<td> </td>
<td colspan="2">
- <input type="checkbox" tabindex="12" name="install_tables" id="install_tables" value="true"<?php if(!isset($_SESSION['install_tables'])) { echo ' checked'; } elseif($_SESSION['install_tables'] == 'true') { echo ' checked'; } ?> />
+ <input type="checkbox" tabindex="12" name="install_tables" id="install_tables" value="true" onclick="document.getElementById('db_options').style.display = this.checked? 'block':'none';"<?php if(!isset($_SESSION['install_tables'])) { echo ' checked'; } elseif($_SESSION['install_tables'] == 'true') { echo ' checked'; } ?> />
<label for="install_tables" style="color: #666666;">Install Tables</label>
<br />
- <span style="font-size: 10px; color: #666666;">(Please note: May remove existing tables and data)</span></td>
+ <span style="font-size: 10px; color: #666666;">(Please note: May remove existing tables and data)</span></td>
</td>
</tr>
+ <tr id="db_options">
+ <td style="color: #666666;">Fill database with demo data:</td>
+ <td>
+ <input type="checkbox" tabindex="6" name="demo_data" id="demo_data" value="true" <?php if(!isset($_SESSION['demo_data']) OR $_SESSION['demo_data'] == true) { echo 'checked'; } ?> />
+ <br />
+ </td>
+ <td colspan="2"> </td>
+ </tr>
<tr>
<td colspan="5"><h1>Step 5</h1>Please enter the training company name below (you can create your own company later)...</td>
</tr>
<input type="password" tabindex="17" name="admin_repassword" style="width: 98%;"<?php if(isset($_SESSION['admin_password'])) { echo ' value = "'.$_SESSION['admin_password'].'"'; } ?> />
</td>
</tr>
-
+
<tr>
<td colspan="5" style="padding: 10px; padding-bottom: 0;"><h1 style="font-size: 0px;"> </h1></td>
</tr>
<tr valign="top">
<td>Please note: </td>
<td>
- FrontAccounting is released under the
- <a href="http://www.gnu.org/licenses/gpl.html" target="_blank" tabindex="19">GNU General Public License</a>
- <br />
- By clicking install, you are accepting the license.
+ FrontAccounting is released under the
+ <a href="http://www.gnu.org/licenses/gpl-3.0.html" target="_blank" tabindex="19">GNU General Public License.</a> By
+ clicking install, you are accepting the license.
</td>
</tr>
</table>
</td>
</tr>
</table>
-
+
</td>
</tr>
</table>
<!-- Please note: the below reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
<a href="http://frontaccounting.com/" style="color: #000000;" target="_blank">FrontAccounting</a>
is released under the
- <a href="http://www.gnu.org/licenses/gpl.html" style="color: #000000;" target="_blank">GNU General Public License</a>
+ <a href="http://www.gnu.org/licenses/gpl-3.0.html" style="color: #000000;" target="_blank">GNU General Public License</a>
<!-- Please note: the above reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
</td>
</tr>