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 | |
parent | 7a0fcdd836d491c288b94383ebc54de2271bb237 (diff) | |
download | ampache-a3a19ed1ff4c14297a9418c6462bf7e1f373ab56.tar.gz ampache-a3a19ed1ff4c14297a9418c6462bf7e1f373ab56.tar.bz2 ampache-a3a19ed1ff4c14297a9418c6462bf7e1f373ab56.zip |
fixed installer so that it works with new auth
-rw-r--r-- | install.php | 20 | ||||
-rw-r--r-- | lib/debug.php | 5 | ||||
-rw-r--r-- | lib/install.php | 8 |
3 files changed, 18 insertions, 15 deletions
diff --git a/install.php b/install.php index 783f2c18..fab6e5a2 100644 --- a/install.php +++ b/install.php @@ -32,16 +32,14 @@ require_once('lib/debug.php'); require_once('lib/class/user.class.php'); require_once('lib/class/error.class.php'); -// Libglue Requires -require_once('modules/libglue/auth.php'); -require_once('modules/libglue/session.php'); -require_once('modules/libglue/dbh.php'); - +require_once('modules/vauth/dbh.lib.php'); +require_once('modules/vauth/init.php'); if ($_SERVER['HTTPS'] == 'on') { $http_type = "https://"; } else { $http_type = "http://"; } + $prefix = dirname(__FILE__); $configfile = "$prefix/config/ampache.cfg.php"; @@ -100,10 +98,16 @@ switch ($action) { break; } $results = read_config($configfile, 0, 0); + + $results['mysql_hostname'] = $results['local_host']; + $results['mysql_username'] = $results['local_username']; + $results['mysql_password'] = $results['local_pass']; + $results['mysql_db'] = $results['local_db']; + if ($_SERVER['HTTPS'] == 'on') { $http_type = "https://"; } else { $http_type = "http://"; } - - libglue_param($results['libglue']); + + vauth_conf($results); /* Setup Preferences */ $temp_user = new User($username); $temp_user->fix_preferences(); @@ -112,7 +116,7 @@ switch ($action) { $temp_user->fix_preferences(); - $web_path = $http_type . $_SERVER['HTTP_HOST'] . $results['conf']['web_path']; + $web_path = $http_type . $_SERVER['HTTP_HOST'] . $results['web_path']; header ("Location: " . $web_path . "/login.php"); 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); |