projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Install error handling bug fixed.
[fa-stable.git]
/
install
/
save.php
diff --git
a/install/save.php
b/install/save.php
index 659e9ca68bf7150fe1c92716c3877a6a2b719032..1396d806fb169bdd5b09a9e7847755d6adef9c4d 100644
(file)
--- a/
install/save.php
+++ b/
install/save.php
@@
-21,8
+21,9
@@
if(!defined('SESSION_STARTED'))
define('SESSION_STARTED', true);
}
define('SESSION_STARTED', true);
}
-// Function to set error
-function set_error($message)
+// Installer version of display_error function.
+//
+function display_error($message)
{
global $_POST;
if(isset($message) AND $message != '')
{
global $_POST;
if(isset($message) AND $message != '')
@@
-145,7
+146,7
@@
else
// Set error if no post vars found
if (!isset($_POST['company_name']))
{
// Set error if no post vars found
if (!isset($_POST['company_name']))
{
-
set
_error('Please fill-in the form below');
+
display
_error('Please fill-in the form below');
}
// End check to see if form was even submitted
}
// End check to see if form was even submitted
@@
-154,7
+155,7
@@
if (!isset($_POST['company_name']))
// Check if user has entered the installation url
if (!isset($_POST['ba_url']) || $_POST['ba_url'] == '')
{
// Check if user has entered the installation url
if (!isset($_POST['ba_url']) || $_POST['ba_url'] == '')
{
-
set
_error('Please enter an absolute URL');
+
display
_error('Please enter an absolute URL');
}
else
{
}
else
{
@@
-184,7
+185,7
@@
if(substr($ba_url, strlen($ba_url) - 1, 1) == "\\")
// Get operating system
if (!isset($_POST['operating_system']) || $_POST['operating_system'] != 'linux' && $_POST['operating_system'] != 'windows')
{
// Get operating system
if (!isset($_POST['operating_system']) || $_POST['operating_system'] != 'linux' && $_POST['operating_system'] != 'windows')
{
-
set
_error('Please select a valid operating system');
+
display
_error('Please select a valid operating system');
}
else
{
}
else
{
@@
-212,7
+213,7
@@
else
// Check if user has entered a database host
if (!isset($_POST['database_host']) || $_POST['database_host'] == '')
{
// Check if user has entered a database host
if (!isset($_POST['database_host']) || $_POST['database_host'] == '')
{
-
set
_error('Please enter a database host name');
+
display
_error('Please enter a database host name');
}
else
{
}
else
{
@@
-221,7
+222,7
@@
else
// Check if user has entered a database username
if (!isset($_POST['database_username']) || $_POST['database_username'] == '')
{
// Check if user has entered a database username
if (!isset($_POST['database_username']) || $_POST['database_username'] == '')
{
-
set
_error('Please enter a database username');
+
display
_error('Please enter a database username');
}
else
{
}
else
{
@@
-230,7
+231,7
@@
else
// Check if user has entered a database password
if (!isset($_POST['database_password']))
{
// Check if user has entered a database password
if (!isset($_POST['database_password']))
{
-
set
_error('Please enter a database password');
+
display
_error('Please enter a database password');
}
else
{
}
else
{
@@
-239,7
+240,7
@@
else
// Check if user has entered a database name
if (!isset($_POST['database_name']) || $_POST['database_name'] == '')
{
// Check if user has entered a database name
if (!isset($_POST['database_name']) || $_POST['database_name'] == '')
{
-
set
_error('Please enter a database name');
+
display
_error('Please enter a database name');
}
else
{
}
else
{
@@
-266,7
+267,7
@@
else
// Get company name
if (!isset($_POST['company_name']) || $_POST['company_name'] == '')
{
// Get company name
if (!isset($_POST['company_name']) || $_POST['company_name'] == '')
{
-
set
_error('Please enter a company name');
+
display
_error('Please enter a company name');
}
else
{
}
else
{
@@
-277,13
+278,13
@@
else
// Check if the user has entered a correct path
if (!file_exists($path_to_root.'/sql/en_US-demo.sql'))
{
// Check if the user has entered a correct path
if (!file_exists($path_to_root.'/sql/en_US-demo.sql'))
{
-
set
_error('It appears the Absolute path that you entered is incorrect');
+
display
_error('It appears the Absolute path that you entered is incorrect');
}
// Get admin email and validate it
if (!isset($_POST['admin_email']) || $_POST['admin_email'] == '')
{
}
// Get admin email and validate it
if (!isset($_POST['admin_email']) || $_POST['admin_email'] == '')
{
-
set
_error('Please enter an email for the Administrator account');
+
display
_error('Please enter an email for the Administrator account');
}
else
{
}
else
{
@@
-293,13
+294,13
@@
else
}
else
{
}
else
{
-
set
_error('Please enter a valid email address for the Administrator account');
+
display
_error('Please enter a valid email address for the Administrator account');
}
}
// Get the two admin passwords entered, and check that they match
if (!isset($_POST['admin_password']) || $_POST['admin_password'] == '')
{
}
}
// Get the two admin passwords entered, and check that they match
if (!isset($_POST['admin_password']) || $_POST['admin_password'] == '')
{
-
set
_error('Please enter a password for the Administrator account');
+
display
_error('Please enter a password for the Administrator account');
}
else
{
}
else
{
@@
-307,7
+308,7
@@
else
}
if (!isset($_POST['admin_repassword']) || $_POST['admin_repassword'] == '')
{
}
if (!isset($_POST['admin_repassword']) || $_POST['admin_repassword'] == '')
{
-
set
_error('Please make sure you re-enter the password for the Administrator account');
+
display
_error('Please make sure you re-enter the password for the Administrator account');
}
else
{
}
else
{
@@
-315,7
+316,7
@@
else
}
if ($admin_password != $admin_repassword)
{
}
if ($admin_password != $admin_repassword)
{
-
set
_error('Sorry, the two Administrator account passwords you entered do not match');
+
display
_error('Sorry, the two Administrator account passwords you entered do not match');
}
// End admin user details code
}
// End admin user details code
@@
-339,18
+340,18
@@
$config_filename = $path_to_root . '/config_db.php';
$err = write_config_db($table_prefix != "");
if ($err == -1)
$err = write_config_db($table_prefix != "");
if ($err == -1)
-
set
_error("Cannot open the configuration file ($config_filename)");
+
display
_error("Cannot open the configuration file ($config_filename)");
else if ($err == -2)
else if ($err == -2)
-
set
_error("Cannot write to the configuration file ($config_filename)");
+
display
_error("Cannot write to the configuration file ($config_filename)");
else if ($err == -3)
else if ($err == -3)
-
set
_error("The configuration file $config_filename is not writable. Change its permissions so it is, then re-run step 4.");
+
display
_error("The configuration file $config_filename is not writable. Change its permissions so it is, then re-run step 4.");
// Try connecting to database
$db = mysql_connect($database_host, $database_username, $database_password);
if (!$db)
{
// Try connecting to database
$db = mysql_connect($database_host, $database_username, $database_password);
if (!$db)
{
-
set
_error('Database host name, username and/or password incorrect. MySQL Error:<br />'.mysql_error());
+
display
_error('Database host name, username and/or password incorrect. MySQL Error:<br />'.mysql_error());
}
if($install_tables == true)
}
if($install_tables == true)
@@
-363,8
+364,7
@@
if($install_tables == true)
mysql_select_db($database_name, $db);
}
$import_filename = $path_to_root."/sql/en_US-demo.sql";
mysql_select_db($database_name, $db);
}
$import_filename = $path_to_root."/sql/en_US-demo.sql";
- if (!db_import($import_filename, $db_connections[$id]))
- set_error("Import error, try to import $import_filename manually via phpMyAdmin");
+ db_import($import_filename, $db_connections[$id]);
}
else
{
}
else
{