diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-01-20 07:28:52 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-01-20 07:28:52 +0000 |
commit | a3a19ed1ff4c14297a9418c6462bf7e1f373ab56 (patch) | |
tree | 190b4489a3c21272f74e04b5975c7eeb1423233b /lib | |
parent | 7a0fcdd836d491c288b94383ebc54de2271bb237 (diff) | |
download | ampache-a3a19ed1ff4c14297a9418c6462bf7e1f373ab56.tar.gz ampache-a3a19ed1ff4c14297a9418c6462bf7e1f373ab56.tar.bz2 ampache-a3a19ed1ff4c14297a9418c6462bf7e1f373ab56.zip |
fixed installer so that it works with new auth
Diffstat (limited to 'lib')
-rw-r--r-- | lib/debug.php | 5 | ||||
-rw-r--r-- | lib/install.php | 8 |
2 files changed, 6 insertions, 7 deletions
diff --git a/lib/debug.php b/lib/debug.php index 45531457..db8f08ea 100644 --- a/lib/debug.php +++ b/lib/debug.php @@ -50,7 +50,7 @@ function read_config_file($file,$level=0) { @discussion checks the local mysql db and make sure life is good */ -function check_database($host,$username,$pass,$db,$level=0) { +function check_database($host,$username,$pass,$level=0) { $dbh = @mysql_connect($host, $username, $pass); @@ -62,10 +62,9 @@ function check_database($host,$username,$pass,$db,$level=0) { $error['error_state'] = true; $error['mysql_error'] .= "<br />HOST:$host<br />User:$username<br />Pass:$pass<br />"; } -print_r($error); + if ($error['error_state']) { return false; } - return $dbh; } // check_database diff --git a/lib/install.php b/lib/install.php index 3ca0fb79..a45d1c98 100644 --- a/lib/install.php +++ b/lib/install.php @@ -82,10 +82,10 @@ function install_check_status($configfile) { if they don't then they're cool */ $results = read_config($GLOBALS['configfile'], 0, 0); - $dbh = check_database($results['libglue']['local_host'],$results['libglue']['local_username'],$results['libglue']['local_pass'],$results['libglue']['local_db']); + $dbh = check_database($results['local_host'],$results['local_username'],$results['local_pass']); if (is_resource($dbh)) { - mysql_select_db($results['libglue']['local_db'],$dbh); + mysql_select_db($results['local_db'],$dbh); $sql = "SELECT * FROM user"; $db_results = @mysql_query($sql, $dbh); if (!@mysql_num_rows($db_results)) { @@ -230,9 +230,9 @@ function install_create_config($web_path,$username,$password,$hostname,$database function install_create_account($username,$password) { $results = read_config($GLOBALS['configfile'], 0, 0); - $dbh = check_database($results['libglue']['local_host'],$results['libglue']['local_username'],$results['libglue']['local_pass'],$results['libglue']['local_db']); + $dbh = check_database($results['local_host'],$results['local_username'],$results['local_pass']); - @mysql_select_db($results['libglue']['local_db'],$dbh); + @mysql_select_db($results['local_db'],$dbh); $username = sql_escape($username,$dbh); $password = sql_escape($password,$dbh); |