summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-11-29 16:37:54 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-11-29 16:37:54 +0000
commit56fa0e31ad67ea337fd8c575ddf6e80094454eb8 (patch)
tree68b54029f1893d2bdb37b2add3f225f9ce518643
parent6a62135d6779832a64d7952ba1163838caf2e856 (diff)
downloadampache-56fa0e31ad67ea337fd8c575ddf6e80094454eb8.tar.gz
ampache-56fa0e31ad67ea337fd8c575ddf6e80094454eb8.tar.bz2
ampache-56fa0e31ad67ea337fd8c575ddf6e80094454eb8.zip
verify that they at least typed in the right db information, before creating the config file for them
-rw-r--r--install.php10
-rw-r--r--lib/install.php2
-rw-r--r--templates/show_install_config.inc.php8
3 files changed, 15 insertions, 5 deletions
diff --git a/install.php b/install.php
index 9741df62..a544b2ce 100644
--- a/install.php
+++ b/install.php
@@ -87,7 +87,15 @@ switch ($_REQUEST['action']) {
break;
case 'create_config':
- $created_config = install_create_config($web_path,$username,$password,$hostname,$database);
+
+ // Test and make sure that the values they give us actually work
+ if (!check_database($hostname,$username,$password)) {
+ Error::add('config',_('Error: Unable to make Database Connection') . mysql_error());
+ }
+
+ if (!Error::occurred()) {
+ $created_config = install_create_config($web_path,$username,$password,$hostname,$database);
+ }
require_once 'templates/show_install_config.inc.php';
break;
diff --git a/lib/install.php b/lib/install.php
index 965186f7..5602b348 100644
--- a/lib/install.php
+++ b/lib/install.php
@@ -132,7 +132,7 @@ function install_insert_db($username,$password,$hostname,$database) {
$dbh = Dba::dbh();
if (!is_resource($dbh)) {
- Error::add('general','Error: Unable to make Database Connection ' . mysql_error());
+ Error::add('general',_('Error: Unable to make Database Connection') . mysql_error());
return false;
}
diff --git a/templates/show_install_config.inc.php b/templates/show_install_config.inc.php
index ef8d861f..7586cf9b 100644
--- a/templates/show_install_config.inc.php
+++ b/templates/show_install_config.inc.php
@@ -54,9 +54,11 @@ if (INSTALL != '1') { exit; }
<?php echo _("Step 3 - Setup Initial Account"); ?><br />
<?php Error::display('general'); ?>
<br />
- <span class="header2"><?php echo _('Generate Config File'); ?></span>
- <form method="post" action="<?php echo WEB_PATH . "?action=create_config"; ?>" enctype="multipart/form-data" >
- <table>
+
+<span class="header2"><?php echo _('Generate Config File'); ?></span>
+<?php Error::display('config'); ?>
+<form method="post" action="<?php echo WEB_PATH . "?action=create_config"; ?>" enctype="multipart/form-data" >
+<table>
<tr>
<td class="align"><?php echo _('Web Path'); ?></td>
<td class="align"><input type="text" name="web_path" value="<?php echo $web_path; ?>" /></td>