Changed license type to GPLv3 in top of files
[fa-stable.git] / install / save.php
index 3044d935575f7d6fe32d3480be00c77ea0436397..659e9ca68bf7150fe1c92716c3877a6a2b719032 100644 (file)
@@ -1,7 +1,17 @@
 <?php
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
 error_reporting(E_ALL);
 ini_set("display_errors", "On");
-ini_set("max_execution_time", "60");
+ini_set("max_execution_time", "180");
 
 // Start a session
 if(!defined('SESSION_STARTED'))
@@ -41,7 +51,14 @@ function set_error($message)
                        $_SESSION['database_username'] = $_POST['database_username'];
                        $_SESSION['database_password'] = $_POST['database_password'];
                        $_SESSION['database_name'] = $_POST['database_name'];
-                       $_SESSION['table_prefix'] = $_POST['table_prefix'];
+                       if(!isset($_POST['table_prefix']))
+                       {
+                               $_SESSION['table_prefix'] = false;
+                       }
+                       else
+                       {
+                               $_SESSION['table_prefix'] = true;
+                       }
                        if(!isset($_POST['install_tables']))
                        {
                                $_SESSION['install_tables'] = false;
@@ -229,7 +246,11 @@ else
        $database_name = $_POST['database_name'];
 }
 // Get table prefix
-$table_prefix = $_POST['table_prefix'];
+if (isset($_POST['table_prefix']) && $_POST['table_prefix'] == 'true')
+       $table_prefix = "0_";
+else
+       $table_prefix = "";
+
 // Find out if the user wants to install tables and data
 if (isset($_POST['install_tables']) && $_POST['install_tables'] == 'true')
 {