1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-04 02:09:23 +02:00

updated sql file, and the install process now works

This commit is contained in:
Karl 'vollmerk' Vollmer 2007-05-13 21:37:49 +00:00
parent 1a6ae62569
commit 779f4bf4e5
12 changed files with 325 additions and 402 deletions

View file

@ -20,9 +20,9 @@
*/ */
require('../lib/init.php'); require '../lib/init.php';
require_once(conf('prefix') . '/lib/debug.lib.php'); require_once Config::get('prefix') . '/lib/debug.lib.php';
require_once(conf('prefix') . '/modules/horde/Browser.php'); require_once Config::get('prefix') . '/modules/horde/Browser.php';
if (!$GLOBALS['user']->has_access(100)) { if (!$GLOBALS['user']->has_access(100)) {
access_denied(); access_denied();
@ -30,83 +30,17 @@ if (!$GLOBALS['user']->has_access(100)) {
} }
$action = scrub_in($_REQUEST['action']);
/* Switch on action boys */ /* Switch on action boys */
switch ($action) { switch ($_REQUEST['action']) {
/* This re-generates the config file comparing /* This re-generates the config file comparing
* /config/ampache.cfg to .cfg.dist * /config/ampache.cfg to .cfg.dist
*/ */
case 'generate_config': case 'generate_config':
$current = parse_ini_file(Config::get('prefix') . '/config/ampache.cfg.php');
$configfile = conf('prefix') . '/config/ampache.cfg.php'; $final = generate_config($current);
$distfile = conf('prefix') . '/config/ampache.cfg.php.dist'; $browser = new Browser();
$browser->downloadHeaders('ampache.cfg.php','text/plain',false,filesize('config/ampache.cfg.php.dist'));
/* Load the current config file */ echo $final;
$current = read_config($configfile, 0, 0);
/* Start building the new config file */
$handle = fopen($distfile,'r');
$dist = fread($handle,filesize($distfile));
fclose($handle);
$data = explode("\n",$dist);
/* Run throught the lines and set our settings */
foreach ($data as $line) {
/* Attempt to pull out Key */
if (preg_match("/^#?([\w\d]+)\s+=\s+[\"]{1}(.*?)[\"]{1}$/",$line,$matches)
|| preg_match("/^#?([\w\d]+)\s+=\s+[\']{1}(.*?)[\']{1}$/", $line, $matches)
|| preg_match("/^#?([\w\d]+)\s+=\s+[\'\"]{0}(.*)[\'\"]{0}$/",$line,$matches)) {
$key = $matches[1];
$value = $matches[2];
/* Check to see if Key on source side is an array */
if (is_array($current[$key])) {
/* We need to add all values of this key to the new config file */
$line = $key . ' = "';
$array_value[$key] = true;
foreach ($current[$key] as $sub_value) {
$line .= "$sub_value,";
}
$line = rtrim($line,',');
$line .= '"';
unset($current[$key]);
} // is array
/* Put in the current value */
elseif (isset($current[$key]) AND $key != 'config_version') {
$line = $key . ' = "' . $current[$key] . '"';
unset($current[$key]);
} // if set
elseif (isset($array_value[$key])) {
$line = '';
}
if (substr($line,0,1) == "#") {
$line = ltrim($line,"#");
$line = ";" . $line;
}
} // if key
else {
// Replace # with ;
$line = str_replace("#",";",$line);
}
$final .= $line . "\n";
} // end foreach dist file contents
/* Set Correct Headers */
$browser = new Browser();
$browser->downloadHeaders("ampache.cfg.php","text/plain",false,filesize("config/ampache.cfg.php.dist"));
echo $final;
break; break;
/* Check this version against ampache.org's record */ /* Check this version against ampache.org's record */

View file

@ -4,14 +4,15 @@
-------------------------------------------------------------------------- --------------------------------------------------------------------------
v.3.4-Alpha1 v.3.4-Alpha1
- Updated SQL to latest version
- Moved Album art out of the album table into album_data
- Changed Browsing Method and default playlist method
- Added Play links for Favorite Artists/Albums/Songs - Added Play links for Favorite Artists/Albums/Songs
- Fixed an issue with the random album selection that was causing - Fixed an issue with the random album selection that was causing
a full table scan, which could lead to poor performance a full table scan, which could lead to poor performance
with large databases with large databases
- Start of Complete rewrite, config file format changed, requires - Start of Complete rewrite, config file format changed, requires
manual re-creation of /config/ampache.cfg.php manual re-creation of /config/ampache.cfg.php
- Added some minor sorting to the browse by song
- Added ability to search year range (Thx Tom Kiehne)
- Updated French and German translations - Updated French and German translations
- Added min song count to Browse Artist, refercing min object count - Added min song count to Browse Artist, refercing min object count
preference preference

View file

@ -41,6 +41,8 @@ $prefix = dirname(__FILE__);
Config::set('prefix',$prefix,'1'); Config::set('prefix',$prefix,'1');
$configfile = "$prefix/config/ampache.cfg.php"; $configfile = "$prefix/config/ampache.cfg.php";
set_error_handler('ampache_error_handler');
/* First things first we must be sure that they actually still need to /* First things first we must be sure that they actually still need to
install ampache install ampache
*/ */
@ -51,6 +53,7 @@ if (!install_check_status($configfile)) {
// Define that we are doing an install so the includes will work // Define that we are doing an install so the includes will work
define('INSTALL','1'); define('INSTALL','1');
define('INIT_LOADED','1');
/* Clean up incomming variables */ /* Clean up incomming variables */
$web_path = scrub_in($_REQUEST['web_path']); $web_path = scrub_in($_REQUEST['web_path']);
@ -66,7 +69,7 @@ $php_self = $http_type . $_SERVER['HTTP_HOST'] . "/" . preg_replace("/^\/(.+\.ph
switch ($_REQUEST['action']) { switch ($_REQUEST['action']) {
case 'create_db': case 'create_db':
if (!install_insert_db($username,$password,$hostname,$database)) { if (!install_insert_db($username,$password,$hostname,$database)) {
require_once('templates/show_install.inc'); require_once 'templates/show_install.inc';
break; break;
} }
@ -76,12 +79,12 @@ switch ($_REQUEST['action']) {
header ("Location: " . $php_self . "?action=show_create_config&local_db=$database&local_host=$hostname&htmllang=$htmllang&charset=$charset"); header ("Location: " . $php_self . "?action=show_create_config&local_db=$database&local_host=$hostname&htmllang=$htmllang&charset=$charset");
break; break;
case 'create_config': case 'create_config':
$created_config = install_create_config($web_path,$username,$password,$hostname,$database); $created_config = install_create_config($web_path,$username,$password,$hostname,$database);
require_once('templates/show_install_config.inc'); require_once 'templates/show_install_config.inc';
break; break;
case 'show_create_config': case 'show_create_config':
/* Attempt to Guess the Web_path */ /* Attempt to Guess the Web_path */
@ -93,7 +96,7 @@ switch ($_REQUEST['action']) {
$charset = $_REQUEST['charset']; $charset = $_REQUEST['charset'];
// Set the lang in the conf array // Set the lang in the conf array
conf(array('lang'=>$htmllang)); Config::set('lang',$htmllang,'1');
// We need the charset for the different languages // We need the charset for the different languages
$charsets = array('de_DE' => 'ISO-8859-15', $charsets = array('de_DE' => 'ISO-8859-15',
@ -108,60 +111,47 @@ switch ($_REQUEST['action']) {
$charset = $charsets[$_REQUEST['htmllang']]; $charset = $charsets[$_REQUEST['htmllang']];
// Set the site_charset in the conf array // Set the site_charset in the conf array
conf(array('site_charset'=>$charsets[$_REQUEST['htmllang']])); Config::set('site_charset',$charsets[$_REQUEST['htmllang']],'1');
/* load_gettext mojo */ /* load_gettext mojo */
load_gettext(); load_gettext();
header ("Content-Type: text/html; charset=" . conf('site_charset')); header ("Content-Type: text/html; charset=" . Config::get('site_charset'));
require_once('templates/show_install_config.inc'); require_once 'templates/show_install_config.inc';
break; break;
case 'create_account': case 'create_account':
$results = parse_ini_file($configfile);
Config::set_by_array($results,'1');
if (!install_create_account($username,$password)) { if (!install_create_account($username,$password)) {
require_once('templates/show_install_account.inc.php'); require_once Config::get('prefix') . '/templates/show_install_account.inc.php';
break; 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://"; } if ($_SERVER['HTTPS'] == 'on') { $http_type = "https://"; }
else { $http_type = "http://"; } else { $http_type = "http://"; }
vauth_conf($results);
/* Setup Preferences */
$temp_user = new User($username);
$temp_user->fix_preferences();
$temp_user = new User(-1);
$temp_user->username = '-1';
$temp_user->fix_preferences();
$web_path = $http_type . $_SERVER['HTTP_HOST'] . $results['web_path']; $web_path = $http_type . $_SERVER['HTTP_HOST'] . $results['web_path'];
header ("Location: " . $web_path . "/login.php"); header ("Location: " . $web_path . "/login.php");
break;
case 'show_create_account': case 'show_create_account':
$results = read_config($configfile, 0, 0); $results = parse_ini_file($configfile);
/* Make sure we've got a valid config file */ /* Make sure we've got a valid config file */
if (!read_config_file($configfile) OR !check_config_values($results)) { if (!check_config_values($results)) {
require_once('templates/show_install_config.inc'); require_once Config::get('prefix') . '/templates/show_install_config.inc';
break; break;
} }
/* Get the variables for the language */ /* Get the variables for the language */
$htmllang = $_REQUEST['htmllang']; $htmllang = $_REQUEST['htmllang'];
$charset = $_REQUEST['charset']; $charset = $_REQUEST['charset'];
// Set the lang in the conf array // Set the lang in the conf array
conf(array('lang'=>$htmllang)); Config::set('lang',$htmllang,'1');
// We need the charset for the different languages // We need the charset for the different languages
$charsets = array('de_DE' => 'ISO-8859-15', $charsets = array('de_DE' => 'ISO-8859-15',
@ -176,13 +166,13 @@ switch ($_REQUEST['action']) {
$charset = $charsets[$_REQUEST['htmllang']]; $charset = $charsets[$_REQUEST['htmllang']];
// Set the site_charset in the conf array // Set the site_charset in the conf array
conf(array('site_charset'=>$charsets[$_REQUEST['htmllang']])); Config::set('site_charset',$charsets[$_REQUEST['htmllang']],'1');
/* load_gettext mojo */ /* load_gettext mojo */
load_gettext(); load_gettext();
header ("Content-Type: text/html; charset=" . conf('site_charset')); header ("Content-Type: text/html; charset=" . Config::get('site_charset'));
require_once('templates/show_install_account.inc.php'); require_once Config::get('prefix') . '/templates/show_install_account.inc.php';
break; break;
case 'init': case 'init':
/* First step of installation */ /* First step of installation */
@ -224,8 +214,6 @@ switch ($_REQUEST['action']) {
/* Show the language options first */ /* Show the language options first */
require_once 'templates/show_install_lang.inc.php'; require_once 'templates/show_install_lang.inc.php';
break; break;
} // end action switch } // end action switch
?> ?>

View file

@ -177,17 +177,15 @@ class Update {
/* Define the array */ /* Define the array */
$version = array(); $version = array();
$version[] = array('version' => '333004','description' => $update_string);
$update_string = '- Moved back to ID for user tracking internally.<br />' . $update_string = '- Moved back to ID for user tracking internally.<br />' .
'- Added date to user_vote to allow sorting by vote time.<br />' . '- Added date to user_vote to allow sorting by vote time.<br />' .
'- Added Random Method and Object Count Preferences.<br />' . '- Added Random Method and Object Count Preferences.<br />' .
'- Removed some unused tables/fields.<br />' . '- Removed some unused tables/fields.<br />' .
'- Added Label, Catalog # and Language to Extended Song Data Table<br />'; '- Added Label, Catalog # and Language to Extended Song Data Table.';
$version[] = array('version' => '340001','description' => $update_string); $version[] = array('version' => '340001','description' => $update_string);
$update_string = '- Added Offset Limit to Preferences and removed from user table'; $update_string = '- Added Offset Limit to Preferences and removed from user table.';
$version[] = array('version' => '340002','description' => $update_string); $version[] = array('version' => '340002','description' => $update_string);

View file

@ -585,26 +585,26 @@ class User {
* create * create
* inserts a new user into ampache * inserts a new user into ampache
*/ */
function create($username, $fullname, $email, $password, $access) { public static function create($username, $fullname, $email, $password, $access) {
/* Lets clean up the fields... */ /* Lets clean up the fields... */
$username = sql_escape($username); $username = Dba::escape($username);
$fullname = sql_escape($fullname); $fullname = Dba::escape($fullname);
$email = sql_escape($email); $email = Dba::escape($email);
$access = sql_escape($access); $access = Dba::escape($access);
/* Now Insert this new user */ /* Now Insert this new user */
$sql = "INSERT INTO user (username, fullname, email, password, access, create_date) VALUES" . $sql = "INSERT INTO `user` (`username`, `fullname`, `email`, `password`, `access`, `create_date`) VALUES" .
" ('$username','$fullname','$email',PASSWORD('$password'),'$access','" . time() ."')"; " ('$username','$fullname','$email',PASSWORD('$password'),'$access','" . time() ."')";
$db_results = mysql_query($sql, dbh()); $db_results = Dba::query($sql);
if (!$db_results) { return false; } if (!$db_results) { return false; }
// Get the insert_id // Get the insert_id
$insert_id = mysql_insert_id(dbh()); $insert_id = Dba::insert_id();
/* Populates any missing preferences, in this case all of them */ /* Populates any missing preferences, in this case all of them */
$this->fix_preferences($insert_id); self::fix_preferences($insert_id);
return $insert_id; return $insert_id;

View file

@ -143,11 +143,10 @@ function check_php_pcre() {
} // check_php_pcre } // check_php_pcre
/*! /**
@function check_config_values() * check_config_values
@discussion checks to make sure that they have at * checks to make sure that they have at least set the needed variables
least set the needed variables */
*/
function check_config_values($conf) { function check_config_values($conf) {
if (!$conf['database_hostname']) { if (!$conf['database_hostname']) {
@ -211,4 +210,50 @@ function check_putenv() {
} // check_putenv } // check_putenv
/**
* generate_config
* This takes an array of results and re-generates the config file
* this is used by the installer and by the admin/system page
*/
function generate_config($current) {
/* Start building the new config file */
$distfile = Config::get('prefix') . '/config/ampache.cfg.php.dist';
$handle = fopen($distfile,'r');
$dist = fread($handle,filesize($distfile));
fclose($handle);
$data = explode("\n",$dist);
/* Run throught the lines and set our settings */
foreach ($data as $line) {
/* Attempt to pull out Key */
if (preg_match("/^;?([\w\d]+)\s+=\s+[\"]{1}(.*?)[\"]{1}$/",$line,$matches)
|| preg_match("/^;?([\w\d]+)\s+=\s+[\']{1}(.*?)[\']{1}$/", $line, $matches)
|| preg_match("/^;?([\w\d]+)\s+=\s+[\'\"]{0}(.*)[\'\"]{0}$/",$line,$matches)) {
$key = $matches[1];
$value = $matches[2];
/* Put in the current value */
if (isset($current[$key]) AND $key != 'config_version') {
$line = $key . ' = "' . $current[$key] . '"';
unset($current[$key]);
} // if set
elseif (isset($array_value[$key])) {
$line = '';
}
} // if key
$final .= $line . "\n";
} // end foreach line
return $final;
} // generate_config
?> ?>

View file

@ -92,41 +92,55 @@ function install_check_status($configfile) {
} // install_check_status } // install_check_status
/*! /**
@function install_insert_db() * install_insert_db
@discussion this function inserts the database * this function inserts the database using the username/pass/host provided
using the username/pass/host provided * and reading the .sql file
and reading the .sql file */
*/
function install_insert_db($username,$password,$hostname,$database) { function install_insert_db($username,$password,$hostname,$database) {
$data['database_username'] = $username;
$data['database_password'] = $password;
$data['database_hostname'] = $hostname;
$data['database_name'] = $database;
Config::set_by_array($data,'1');
unset($data);
/* Attempt to make DB connection */ /* Attempt to make DB connection */
$dbh = @mysql_pconnect($hostname,$username,$password); $dbh = Dba::dbh();
if (!is_resource($dbh)) { if (!is_resource($dbh)) {
$GLOBALS['error']->add_error('general',"Error: Unable to make Database Connection " . mysql_error()); Error::add('general','Error: Unable to make Database Connection ' . mysql_error());
return false; return false;
} }
/* Check/Create Database as needed */ /* Check/Create Database as needed */
$db_selected = @mysql_select_db($database, $dbh); $db_selected = @mysql_select_db($database, $dbh);
if ($db_selected && !$_POST['overwrite_db']) {
Error::add('general','Error: Database Already exists and Overwrite no checked');
return false;
}
if (!$db_selected) { if (!$db_selected) {
$sql = "CREATE DATABASE `" . $database . "`"; $sql = "CREATE DATABASE `" . $database . "`";
if (!$db_results = @mysql_query($sql, $dbh)) { if (!$db_results = @mysql_query($sql, $dbh)) {
$GLOBALS['error']->add_error('general',"Error: Unable to Create Database " . mysql_error()); Error::add('general',"Error: Unable to Create Database " . mysql_error());
return false; return false;
} }
@mysql_select_db($database, $dbh); @mysql_select_db($database, $dbh);
} // if db can't be selected } // if db can't be selected
/* Check and see if we should create a user here */ /* Check and see if we should create a user here */
if ($_REQUEST['db_user'] == 'create_db_user') { if ($_REQUEST['db_user'] == 'create_db_user') {
$db_user = scrub_in($_REQUEST['db_username']); $db_user = scrub_in($_REQUEST['db_username']);
$db_pass = scrub_in($_REQUEST['db_password']); $db_pass = scrub_in($_REQUEST['db_password']);
$sql = "GRANT ALL PRIVILEGES ON " . sql_escape($database,$dbh) . ".* TO " . $sql = "GRANT ALL PRIVILEGES ON " . sql_escape($database,$dbh) . ".* TO " .
"'" . sql_escape($db_user,$dbh) . "'@'" . sql_escape($hostname,$dbh) . "' IDENTIFIED BY '" . sql_escape($db_pass,$dbh) . "' WITH GRANT OPTION"; "'" . Dba::escape($db_user) . "'@'" . Dba::escape($hostname) . "' IDENTIFIED BY '" . Dba::escape($db_pass) . "' WITH GRANT OPTION";
if (!$db_results = @mysql_query($sql, $dbh)) { if (!$db_results = @mysql_query($sql, $dbh)) {
$GLOBALS['error']->add_error('general',"Error: Unable to Insert $db_user with permissions to $database on $hostname " . mysql_error()); Error::add('general',"Error: Unable to Insert $db_user with permissions to $database on $hostname " . mysql_error());
return false; return false;
} }
} // end if we are creating a user } // end if we are creating a user
@ -139,7 +153,7 @@ function install_insert_db($username,$password,$hostname,$database) {
if(!empty($pieces[$i]) && $pieces[$i] != "#") { if(!empty($pieces[$i]) && $pieces[$i] != "#") {
//FIXME: This is for a DB prefix when we get around to it //FIXME: This is for a DB prefix when we get around to it
// $pieces[$i] = str_replace( "#__", $DBPrefix, $pieces[$i]); // $pieces[$i] = str_replace( "#__", $DBPrefix, $pieces[$i]);
if (!$result = mysql_query ($pieces[$i])) { if (!$result = Dba::query ($pieces[$i])) {
$errors[] = array ( mysql_error(), $pieces[$i] ); $errors[] = array ( mysql_error(), $pieces[$i] );
} // end if } // end if
} // end if } // end if
@ -149,119 +163,87 @@ function install_insert_db($username,$password,$hostname,$database) {
} // install_insert_db } // install_insert_db
/*! /**
@function install_create_config() * install_create_config
@discussion attempts to write out the config file * attempts to write out the config file
if it can't write it out it will prompt the * if it can't write it out it will prompt the
user to download the config file. * user to download the config file.
*/ */
function install_create_config($web_path,$username,$password,$hostname,$database) { function install_create_config($web_path,$username,$password,$hostname,$database) {
$data['database_username'] = $username;
$data['database_password'] = $password;
$data['database_hostname'] = $hostname;
$data['database_name'] = $database;
$data['web_path'] = $web_path;
Config::set_by_array($data,'1');
/* Attempt to make DB connection */
$dbh = Dba::dbh();
/* /*
First Test The Variables they've given us to make First Test The Variables they've given us to make
sure that they actually work! sure that they actually work!
*/ */
// Connect to the DB // Connect to the DB
if(!$dbh = @mysql_pconnect($hostname,$username,$password)) { if(!is_resource($dbh)) {
$GLOBALS['error']->add_error('general',"Database Connection Failed Check Hostname, Username and Password"); Error::add('general',"Database Connection Failed Check Hostname, Username and Password");
return false; return false;
} }
if (!$db_selected = @mysql_select_db($database, $dbh)) { if (!$db_selected = @mysql_select_db($database, $dbh)) {
$GLOBALS['error']->add_error('general',"Database Selection Failure Check Existance of $database"); Error::add('general',"Database Selection Failure Check Existance of $database");
return false; return false;
} }
$final = generate_config($data);
/* Read in the .dist file and spit out the .cfg */ $browser = new Browser();
$dist_handle = @fopen("config/ampache.cfg.php.dist",'r'); $browser->downloadHeaders('ampache.cfg.php','text/plain',false,filesize('config/ampache.cfg.php.dist'));
$dist_data = @fread($dist_handle,filesize("config/ampache.cfg.php.dist")); echo $final;
fclose($dist_handle); exit();
$dist_array = explode("\n",$dist_data);
// Rather then write it out right away, let's build the string
// incase we can't write to the FS and have to make it a download
foreach ($dist_array as $row) {
if (preg_match("/^#?web_path\s*=/",$row)) {
$row = "web_path = \"$web_path\"";
}
elseif (preg_match("/^#?local_db\s*=/",$row)) {
$row = "local_db = \"$database\"";
}
elseif (preg_match("/^#?local_host\s*=/",$row)) {
$row = "local_host = \"$hostname\"";
}
elseif (preg_match("/^#?local_username\s*=/",$row)) {
$row = "local_username = \"$username\"";
}
elseif (preg_match("/^#?local_pass\s*=/",$row)) {
$row = "local_pass = \"$password\"";
}
$config_data .= $row . "\n";
} // foreach row in config file
/* Attempt to Write out File */
if (!$config_handle = @fopen("config/ampache.cfg.php",'w')) {
$browser = new Browser();
$browser->downloadHeaders("ampache.cfg.php","text/plain",false,filesize("config/ampache.cfg.php.dist"));
echo $config_data;
exit();
}
if (!@fwrite($config_handle,$config_data)) {
$GLOBALS['error']->add_error('general',"Error: Unable to write Config File but file writeable?");
return false;
}
return true; return true;
} // install_create_config } // install_create_config
/*! /**
@function install_create_account * install_create_account
@discussion this creates your initial account * this creates your initial account and sets up the preferences for the -1 user and you
*/ */
function install_create_account($username,$password) { function install_create_account($username,$password) {
if (!strlen($username) OR !strlen($password)) { if (!strlen($username) OR !strlen($password)) {
$GLOBALS['error']->add_error('general',"No Username/Password specified"); Error::add('general',"No Username/Password specified");
return false; return false;
} }
$results = read_config($GLOBALS['configfile'], 0, 0); $dbh = Dba::dbh();
$dbh = check_database($results['local_host'],$results['local_username'],$results['local_pass']);
if (!is_resource($dbh)) { if (!is_resource($dbh)) {
$GLOBALS['error']->add_error('general','Database Connection Failed:' . mysql_error()); Error::add('general','Database Connection Failed:' . mysql_error());
return false; return false;
} }
$db_select = @mysql_select_db($results['local_db'],$dbh); $db_select = @mysql_select_db(Config::get('database_name'),$dbh);
if (!$db_select) { if (!$db_select) {
$GLOBALS['error']->add_error('general','Database Select Failed:' . mysql_error()); Error::add('general','Database Select Failed:' . mysql_error());
return false; return false;
} }
if (is_numeric($username)) { $username = Dba::escape($username);
$GLOBALS['error']->add_error('general',"Error: Due to the incompotence of the programmer of this application usernames with all numbers will cause the world to come to an end, please add a letter"); $password = Dba::escape($password);
$insert_id = User::create($username,'Administrator','',$password,'100');
if (!$insert_id) {
Error::add('general',"Insert of Base User Failed " . mysql_error());
return false; return false;
} }
$username = sql_escape($username,$dbh); // Fix the system users preferences
$password = sql_escape($password,$dbh); User::fix_preferences('-1');
$sql = "INSERT INTO user (`username`,`password`,`offset_limit`,`access`) VALUES ('$username',PASSWORD('$password'),'50','100')";
$db_results = mysql_query($sql, $dbh);
if (!$db_results) {
$GLOBALS['error']->add_error('general',"Insert of Base User Failed " . mysql_error());
return false;
}
return true; return true;

View file

@ -1,8 +1,8 @@
-- MySQL dump 10.10 -- MySQL dump 10.11
-- --
-- Host: localhost Database: ampache -- Host: localhost Database: ampache
-- ------------------------------------------------------ -- ------------------------------------------------------
-- Server version 5.0.24a-Debian_9-log -- Server version 5.0.36-Debian_1-log
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */; /*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
@ -22,7 +22,7 @@ CREATE TABLE `access_list` (
`end` int(11) unsigned NOT NULL default '0', `end` int(11) unsigned NOT NULL default '0',
`level` smallint(3) unsigned NOT NULL default '5', `level` smallint(3) unsigned NOT NULL default '5',
`type` varchar(64) NOT NULL default 'interface', `type` varchar(64) NOT NULL default 'interface',
`user` varchar(128) default NULL, `user` int(11) NOT NULL,
`key` varchar(255) default NULL, `key` varchar(255) default NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `start` (`start`), KEY `start` (`start`),
@ -34,11 +34,10 @@ CREATE TABLE `access_list` (
-- Dumping data for table `access_list` -- Dumping data for table `access_list`
-- --
/*!40000 ALTER TABLE `access_list` DISABLE KEYS */;
LOCK TABLES `access_list` WRITE; LOCK TABLES `access_list` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `access_list` DISABLE KEYS */;
/*!40000 ALTER TABLE `access_list` ENABLE KEYS */; /*!40000 ALTER TABLE `access_list` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `album` -- Table structure for table `album`
@ -50,8 +49,6 @@ CREATE TABLE `album` (
`name` varchar(255) NOT NULL default '', `name` varchar(255) NOT NULL default '',
`prefix` enum('The','An','A','Der','Die','Das','Ein','Eine') default NULL, `prefix` enum('The','An','A','Der','Die','Das','Ein','Eine') default NULL,
`year` int(4) unsigned NOT NULL default '1984', `year` int(4) unsigned NOT NULL default '1984',
`art` mediumblob,
`art_mime` varchar(128) default NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `name` (`name`), KEY `name` (`name`),
KEY `year` (`year`) KEY `year` (`year`)
@ -61,11 +58,33 @@ CREATE TABLE `album` (
-- Dumping data for table `album` -- Dumping data for table `album`
-- --
/*!40000 ALTER TABLE `album` DISABLE KEYS */;
LOCK TABLES `album` WRITE; LOCK TABLES `album` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `album` DISABLE KEYS */;
/*!40000 ALTER TABLE `album` ENABLE KEYS */; /*!40000 ALTER TABLE `album` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `album_data`
--
DROP TABLE IF EXISTS `album_data`;
CREATE TABLE `album_data` (
`album_id` int(11) unsigned NOT NULL,
`art` blob,
`art_mime` varchar(64) default NULL,
`thumb` blob,
`thumb_mime` varchar(64) default NULL,
UNIQUE KEY `album_id` (`album_id`)
) TYPE=MyISAM;
--
-- Dumping data for table `album_data`
--
LOCK TABLES `album_data` WRITE;
/*!40000 ALTER TABLE `album_data` DISABLE KEYS */;
/*!40000 ALTER TABLE `album_data` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `artist` -- Table structure for table `artist`
@ -84,11 +103,10 @@ CREATE TABLE `artist` (
-- Dumping data for table `artist` -- Dumping data for table `artist`
-- --
/*!40000 ALTER TABLE `artist` DISABLE KEYS */;
LOCK TABLES `artist` WRITE; LOCK TABLES `artist` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `artist` DISABLE KEYS */;
/*!40000 ALTER TABLE `artist` ENABLE KEYS */; /*!40000 ALTER TABLE `artist` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `catalog` -- Table structure for table `catalog`
@ -115,11 +133,10 @@ CREATE TABLE `catalog` (
-- Dumping data for table `catalog` -- Dumping data for table `catalog`
-- --
/*!40000 ALTER TABLE `catalog` DISABLE KEYS */;
LOCK TABLES `catalog` WRITE; LOCK TABLES `catalog` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `catalog` DISABLE KEYS */;
/*!40000 ALTER TABLE `catalog` ENABLE KEYS */; /*!40000 ALTER TABLE `catalog` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `flagged` -- Table structure for table `flagged`
@ -130,7 +147,7 @@ CREATE TABLE `flagged` (
`id` int(11) unsigned NOT NULL auto_increment, `id` int(11) unsigned NOT NULL auto_increment,
`object_id` int(11) unsigned NOT NULL default '0', `object_id` int(11) unsigned NOT NULL default '0',
`object_type` enum('artist','album','song') NOT NULL default 'song', `object_type` enum('artist','album','song') NOT NULL default 'song',
`user` varchar(128) NOT NULL default '', `user` int(11) NOT NULL,
`flag` enum('delete','retag','reencode','other') NOT NULL default 'other', `flag` enum('delete','retag','reencode','other') NOT NULL default 'other',
`date` int(11) unsigned NOT NULL default '0', `date` int(11) unsigned NOT NULL default '0',
`approved` tinyint(1) unsigned NOT NULL default '0', `approved` tinyint(1) unsigned NOT NULL default '0',
@ -146,11 +163,10 @@ CREATE TABLE `flagged` (
-- Dumping data for table `flagged` -- Dumping data for table `flagged`
-- --
/*!40000 ALTER TABLE `flagged` DISABLE KEYS */;
LOCK TABLES `flagged` WRITE; LOCK TABLES `flagged` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `flagged` DISABLE KEYS */;
/*!40000 ALTER TABLE `flagged` ENABLE KEYS */; /*!40000 ALTER TABLE `flagged` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `genre` -- Table structure for table `genre`
@ -168,11 +184,10 @@ CREATE TABLE `genre` (
-- Dumping data for table `genre` -- Dumping data for table `genre`
-- --
/*!40000 ALTER TABLE `genre` DISABLE KEYS */;
LOCK TABLES `genre` WRITE; LOCK TABLES `genre` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `genre` DISABLE KEYS */;
/*!40000 ALTER TABLE `genre` ENABLE KEYS */; /*!40000 ALTER TABLE `genre` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `ip_history` -- Table structure for table `ip_history`
@ -181,7 +196,7 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `ip_history`; DROP TABLE IF EXISTS `ip_history`;
CREATE TABLE `ip_history` ( CREATE TABLE `ip_history` (
`id` int(11) unsigned NOT NULL auto_increment, `id` int(11) unsigned NOT NULL auto_increment,
`user` varchar(128) default NULL, `user` int(11) NOT NULL,
`ip` int(11) unsigned NOT NULL default '0', `ip` int(11) unsigned NOT NULL default '0',
`date` int(11) unsigned NOT NULL default '0', `date` int(11) unsigned NOT NULL default '0',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
@ -194,11 +209,10 @@ CREATE TABLE `ip_history` (
-- Dumping data for table `ip_history` -- Dumping data for table `ip_history`
-- --
/*!40000 ALTER TABLE `ip_history` DISABLE KEYS */;
LOCK TABLES `ip_history` WRITE; LOCK TABLES `ip_history` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `ip_history` DISABLE KEYS */;
/*!40000 ALTER TABLE `ip_history` ENABLE KEYS */; /*!40000 ALTER TABLE `ip_history` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `live_stream` -- Table structure for table `live_stream`
@ -224,11 +238,10 @@ CREATE TABLE `live_stream` (
-- Dumping data for table `live_stream` -- Dumping data for table `live_stream`
-- --
/*!40000 ALTER TABLE `live_stream` DISABLE KEYS */;
LOCK TABLES `live_stream` WRITE; LOCK TABLES `live_stream` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `live_stream` DISABLE KEYS */;
/*!40000 ALTER TABLE `live_stream` ENABLE KEYS */; /*!40000 ALTER TABLE `live_stream` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `now_playing` -- Table structure for table `now_playing`
@ -238,7 +251,7 @@ DROP TABLE IF EXISTS `now_playing`;
CREATE TABLE `now_playing` ( CREATE TABLE `now_playing` (
`id` int(11) unsigned NOT NULL auto_increment, `id` int(11) unsigned NOT NULL auto_increment,
`song_id` int(11) unsigned NOT NULL default '0', `song_id` int(11) unsigned NOT NULL default '0',
`user` varchar(128) default NULL, `user` int(11) NOT NULL,
`start_time` int(11) unsigned NOT NULL default '0', `start_time` int(11) unsigned NOT NULL default '0',
`session` varchar(64) default NULL, `session` varchar(64) default NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
@ -248,11 +261,10 @@ CREATE TABLE `now_playing` (
-- Dumping data for table `now_playing` -- Dumping data for table `now_playing`
-- --
/*!40000 ALTER TABLE `now_playing` DISABLE KEYS */;
LOCK TABLES `now_playing` WRITE; LOCK TABLES `now_playing` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `now_playing` DISABLE KEYS */;
/*!40000 ALTER TABLE `now_playing` ENABLE KEYS */; /*!40000 ALTER TABLE `now_playing` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `object_count` -- Table structure for table `object_count`
@ -276,11 +288,10 @@ CREATE TABLE `object_count` (
-- Dumping data for table `object_count` -- Dumping data for table `object_count`
-- --
/*!40000 ALTER TABLE `object_count` DISABLE KEYS */;
LOCK TABLES `object_count` WRITE; LOCK TABLES `object_count` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `object_count` DISABLE KEYS */;
/*!40000 ALTER TABLE `object_count` ENABLE KEYS */; /*!40000 ALTER TABLE `object_count` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `playlist` -- Table structure for table `playlist`
@ -290,7 +301,7 @@ DROP TABLE IF EXISTS `playlist`;
CREATE TABLE `playlist` ( CREATE TABLE `playlist` (
`id` int(11) unsigned NOT NULL auto_increment, `id` int(11) unsigned NOT NULL auto_increment,
`name` varchar(128) NOT NULL default '', `name` varchar(128) NOT NULL default '',
`user` varchar(128) NOT NULL default '', `user` int(11) NOT NULL,
`type` enum('private','public') NOT NULL default 'private', `type` enum('private','public') NOT NULL default 'private',
`date` timestamp NOT NULL, `date` timestamp NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
@ -302,11 +313,10 @@ CREATE TABLE `playlist` (
-- Dumping data for table `playlist` -- Dumping data for table `playlist`
-- --
/*!40000 ALTER TABLE `playlist` DISABLE KEYS */;
LOCK TABLES `playlist` WRITE; LOCK TABLES `playlist` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `playlist` DISABLE KEYS */;
/*!40000 ALTER TABLE `playlist` ENABLE KEYS */; /*!40000 ALTER TABLE `playlist` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `playlist_data` -- Table structure for table `playlist_data`
@ -327,43 +337,17 @@ CREATE TABLE `playlist_data` (
-- Dumping data for table `playlist_data` -- Dumping data for table `playlist_data`
-- --
/*!40000 ALTER TABLE `playlist_data` DISABLE KEYS */;
LOCK TABLES `playlist_data` WRITE; LOCK TABLES `playlist_data` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `playlist_data` DISABLE KEYS */;
/*!40000 ALTER TABLE `playlist_data` ENABLE KEYS */; /*!40000 ALTER TABLE `playlist_data` ENABLE KEYS */;
--
-- Table structure for table `playlist_permission`
--
DROP TABLE IF EXISTS `playlist_permission`;
CREATE TABLE `playlist_permission` (
`id` int(11) unsigned NOT NULL auto_increment,
`userid` varchar(128) NOT NULL default '',
`playlist` int(11) unsigned NOT NULL default '0',
`level` smallint(3) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `userid` (`userid`),
KEY `playlist` (`playlist`)
) TYPE=MyISAM;
--
-- Dumping data for table `playlist_permission`
--
/*!40000 ALTER TABLE `playlist_permission` DISABLE KEYS */;
LOCK TABLES `playlist_permission` WRITE;
UNLOCK TABLES; UNLOCK TABLES;
/*!40000 ALTER TABLE `playlist_permission` ENABLE KEYS */;
-- --
-- Table structure for table `preferences` -- Table structure for table `preference`
-- --
DROP TABLE IF EXISTS `preferences`; DROP TABLE IF EXISTS `preference`;
CREATE TABLE `preferences` ( CREATE TABLE `preference` (
`id` int(11) unsigned NOT NULL auto_increment, `id` int(11) unsigned NOT NULL auto_increment,
`name` varchar(128) NOT NULL default '', `name` varchar(128) NOT NULL default '',
`value` varchar(255) NOT NULL default '', `value` varchar(255) NOT NULL default '',
@ -374,27 +358,26 @@ CREATE TABLE `preferences` (
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `catagory` (`catagory`), KEY `catagory` (`catagory`),
KEY `name` (`name`) KEY `name` (`name`)
) TYPE=MyISAM AUTO_INCREMENT=49; ) TYPE=MyISAM AUTO_INCREMENT=52;
-- --
-- Dumping data for table `preferences` -- Dumping data for table `preference`
-- --
LOCK TABLES `preference` WRITE;
/*!40000 ALTER TABLE `preferences` DISABLE KEYS */; /*!40000 ALTER TABLE `preference` DISABLE KEYS */;
LOCK TABLES `preferences` WRITE; INSERT INTO `preference` VALUES (1,'download','0','Allow Downloads',100,'boolean','options'),(4,'popular_threshold','10','Popular Threshold',25,'integer','interface'),(19,'sample_rate','32','Downsample Bitrate',25,'string','streaming'),(22,'site_title','Ampache :: Pour l\'Amour de la Musique','Website Title',100,'string','system'),(23,'lock_songs','0','Lock Songs',100,'boolean','system'),(24,'force_http_play','1','Forces Http play regardless of port',100,'boolean','system'),(25,'http_port','80','Non-Standard Http Port',100,'integer','system'),(26,'catalog_echo_count','100','Catalog Echo Interval',100,'integer','system'),(41,'localplay_controller','0','Localplay Type',100,'special','streaming'),(29,'play_type','stream','Type of Playback',25,'special','streaming'),(30,'direct_link','1','Allow Direct Links',100,'boolean','options'),(31,'lang','en_US','Language',100,'special','interface'),(32,'playlist_type','m3u','Playlist Type',100,'special','streaming'),(33,'theme_name','classic','Theme',0,'special','interface'),(34,'ellipse_threshold_album','27','Album Ellipse Threshold',0,'integer','interface'),(35,'ellipse_threshold_artist','27','Artist Ellipse Threshold',0,'integer','interface'),(36,'ellipse_threshold_title','27','Title Ellipse Threshold',0,'integer','interface'),(51,'offset_limit','50','Offset Limit',5,'integer','interface'),(40,'localplay_level','0','Localplay Access Level',100,'special','streaming'),(43,'allow_downsample_playback','0','Allow Downsampling',100,'boolean','system'),(44,'allow_stream_playback','1','Allow Streaming',100,'boolean','system'),(45,'allow_democratic_playback','0','Allow Democratic Play',100,'boolean','system'),(46,'allow_localplay_playback','0','Allow Localplay Play',100,'boolean','system'),(47,'stats_threshold','7','Statistics Day Threshold',25,'integer','interface'),(49,'min_object_count','1','Min Element Count',5,'integer','interface'),(50,'random_method','default','Random Method',5,'string','interface');
INSERT INTO `preferences` VALUES (1,'download','0','Allow Downloads',100,'boolean','options'),(4,'popular_threshold','10','Popular Threshold',25,'integer','interface'),(19,'sample_rate','32','Downsample Bitrate',25,'string','streaming'),(22,'site_title','Ampache :: Pour l\'Amour de la Musique','Website Title',100,'string','system'),(23,'lock_songs','0','Lock Songs',100,'boolean','system'),(24,'force_http_play','1','Forces Http play regardless of port',100,'boolean','system'),(25,'http_port','80','Non-Standard Http Port',100,'integer','system'),(26,'catalog_echo_count','100','Catalog Echo Interval',100,'integer','system'),(41,'localplay_controller','0','Localplay Type',100,'special','streaming'),(29,'play_type','stream','Type of Playback',25,'special','streaming'),(30,'direct_link','1','Allow Direct Links',100,'boolean','options'),(31,'lang','en_US','Language',100,'special','interface'),(32,'playlist_type','m3u','Playlist Type',100,'special','streaming'),(33,'theme_name','classic','Theme',0,'special','interface'),(34,'ellipse_threshold_album','27','Album Ellipse Threshold',0,'integer','interface'),(35,'ellipse_threshold_artist','27','Artist Ellipse Threshold',0,'integer','interface'),(36,'ellipse_threshold_title','27','Title Ellipse Threshold',0,'integer','interface'),(42,'min_album_size','0','Min Album Size',0,'integer','interface'),(40,'localplay_level','0','Localplay Access Level',100,'special','streaming'),(43,'allow_downsample_playback','0','Allow Downsampling',100,'boolean','system'),(44,'allow_stream_playback','1','Allow Streaming',100,'boolean','system'),(45,'allow_democratic_playback','0','Allow Democratic Play',100,'boolean','system'),(46,'allow_localplay_playback','0','Allow Localplay Play',100,'boolean','system'),(47,'stats_threshold','7','Statistics Day Threshold',25,'integer','interface'); /*!40000 ALTER TABLE `preference` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;
/*!40000 ALTER TABLE `preferences` ENABLE KEYS */;
-- --
-- Table structure for table `ratings` -- Table structure for table `rating`
-- --
DROP TABLE IF EXISTS `ratings`; DROP TABLE IF EXISTS `rating`;
CREATE TABLE `ratings` ( CREATE TABLE `rating` (
`id` int(11) unsigned NOT NULL auto_increment, `id` int(11) unsigned NOT NULL auto_increment,
`user` varchar(128) NOT NULL default '', `user` int(11) NOT NULL,
`object_type` enum('artist','album','song','steam','video') NOT NULL default 'artist', `object_type` enum('artist','album','song','steam','video') NOT NULL default 'artist',
`object_id` int(11) unsigned NOT NULL default '0', `object_id` int(11) unsigned NOT NULL default '0',
`user_rating` enum('00','0','1','2','3','4','5') NOT NULL default '0', `user_rating` enum('00','0','1','2','3','4','5') NOT NULL default '0',
@ -403,14 +386,13 @@ CREATE TABLE `ratings` (
) TYPE=MyISAM; ) TYPE=MyISAM;
-- --
-- Dumping data for table `ratings` -- Dumping data for table `rating`
-- --
LOCK TABLES `rating` WRITE;
/*!40000 ALTER TABLE `ratings` DISABLE KEYS */; /*!40000 ALTER TABLE `rating` DISABLE KEYS */;
LOCK TABLES `ratings` WRITE; /*!40000 ALTER TABLE `rating` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;
/*!40000 ALTER TABLE `ratings` ENABLE KEYS */;
-- --
-- Table structure for table `session` -- Table structure for table `session`
@ -432,11 +414,10 @@ CREATE TABLE `session` (
-- Dumping data for table `session` -- Dumping data for table `session`
-- --
/*!40000 ALTER TABLE `session` DISABLE KEYS */;
LOCK TABLES `session` WRITE; LOCK TABLES `session` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `session` DISABLE KEYS */;
/*!40000 ALTER TABLE `session` ENABLE KEYS */; /*!40000 ALTER TABLE `session` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `song` -- Table structure for table `song`
@ -451,18 +432,18 @@ CREATE TABLE `song` (
`year` mediumint(4) unsigned NOT NULL default '0', `year` mediumint(4) unsigned NOT NULL default '0',
`artist` int(11) unsigned NOT NULL default '0', `artist` int(11) unsigned NOT NULL default '0',
`title` varchar(255) NOT NULL default '', `title` varchar(255) NOT NULL default '',
`bitrate` mediumint(2) NOT NULL default '0', `bitrate` mediumint(8) unsigned NOT NULL default '0',
`rate` mediumint(2) NOT NULL default '0', `rate` mediumint(8) unsigned NOT NULL default '0',
`mode` varchar(25) default NULL, `mode` enum('abr','vbr','cbr') default 'cbr',
`size` int(11) unsigned NOT NULL default '0', `size` int(11) unsigned NOT NULL default '0',
`time` mediumint(5) NOT NULL default '0', `time` smallint(5) unsigned NOT NULL default '0',
`track` int(11) unsigned default NULL, `track` smallint(5) unsigned default NULL,
`genre` int(11) unsigned default NULL, `genre` int(11) unsigned default NULL,
`played` tinyint(1) unsigned NOT NULL default '0', `played` tinyint(1) unsigned NOT NULL default '0',
`enabled` tinyint(1) unsigned NOT NULL default '1', `enabled` tinyint(1) unsigned NOT NULL default '1',
`update_time` int(11) unsigned default '0', `update_time` int(11) unsigned default '0',
`addition_time` int(11) unsigned default '0', `addition_time` int(11) unsigned default '0',
`hash` varchar(255) default NULL, `hash` varchar(64) default NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `genre` (`genre`), KEY `genre` (`genre`),
KEY `album` (`album`), KEY `album` (`album`),
@ -479,33 +460,34 @@ CREATE TABLE `song` (
-- Dumping data for table `song` -- Dumping data for table `song`
-- --
/*!40000 ALTER TABLE `song` DISABLE KEYS */;
LOCK TABLES `song` WRITE; LOCK TABLES `song` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `song` DISABLE KEYS */;
/*!40000 ALTER TABLE `song` ENABLE KEYS */; /*!40000 ALTER TABLE `song` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `song_ext_data` -- Table structure for table `song_data`
-- --
DROP TABLE IF EXISTS `song_ext_data`; DROP TABLE IF EXISTS `song_data`;
CREATE TABLE `song_ext_data` ( CREATE TABLE `song_data` (
`song_id` int(11) unsigned NOT NULL, `song_id` int(11) unsigned NOT NULL,
`comment` text, `comment` text,
`lyrics` text, `lyrics` text,
`label` varchar(128) default NULL,
`catalog_number` varchar(128) default NULL,
`language` varchar(128) default NULL,
UNIQUE KEY `song_id` (`song_id`) UNIQUE KEY `song_id` (`song_id`)
) TYPE=MyISAM; ) TYPE=MyISAM;
-- --
-- Dumping data for table `song_ext_data` -- Dumping data for table `song_data`
-- --
LOCK TABLES `song_data` WRITE;
/*!40000 ALTER TABLE `song_ext_data` DISABLE KEYS */; /*!40000 ALTER TABLE `song_data` DISABLE KEYS */;
LOCK TABLES `song_ext_data` WRITE; /*!40000 ALTER TABLE `song_data` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;
/*!40000 ALTER TABLE `song_ext_data` ENABLE KEYS */;
-- --
-- Table structure for table `tag_map` -- Table structure for table `tag_map`
@ -516,22 +498,21 @@ CREATE TABLE `tag_map` (
`id` int(11) unsigned NOT NULL auto_increment, `id` int(11) unsigned NOT NULL auto_increment,
`object_id` int(11) unsigned NOT NULL, `object_id` int(11) unsigned NOT NULL,
`object_type` varchar(16) NOT NULL, `object_type` varchar(16) NOT NULL,
`user_id` int(11) unsigned NOT NULL, `user` int(11) NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `object_id` (`object_id`), KEY `object_id` (`object_id`),
KEY `object_type` (`object_type`), KEY `object_type` (`object_type`),
KEY `user_id` (`user_id`) KEY `user_id` (`user`)
) TYPE=MyISAM; ) TYPE=MyISAM;
-- --
-- Dumping data for table `tag_map` -- Dumping data for table `tag_map`
-- --
/*!40000 ALTER TABLE `tag_map` DISABLE KEYS */;
LOCK TABLES `tag_map` WRITE; LOCK TABLES `tag_map` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `tag_map` DISABLE KEYS */;
/*!40000 ALTER TABLE `tag_map` ENABLE KEYS */; /*!40000 ALTER TABLE `tag_map` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `tags` -- Table structure for table `tags`
@ -550,11 +531,10 @@ CREATE TABLE `tags` (
-- Dumping data for table `tags` -- Dumping data for table `tags`
-- --
/*!40000 ALTER TABLE `tags` DISABLE KEYS */;
LOCK TABLES `tags` WRITE; LOCK TABLES `tags` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `tags` DISABLE KEYS */;
/*!40000 ALTER TABLE `tags` ENABLE KEYS */; /*!40000 ALTER TABLE `tags` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `tmp_playlist` -- Table structure for table `tmp_playlist`
@ -570,17 +550,16 @@ CREATE TABLE `tmp_playlist` (
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `session` (`session`), KEY `session` (`session`),
KEY `type` (`type`) KEY `type` (`type`)
) TYPE=MyISAM; ) TYPE=MyISAM AUTO_INCREMENT=4;
-- --
-- Dumping data for table `tmp_playlist` -- Dumping data for table `tmp_playlist`
-- --
/*!40000 ALTER TABLE `tmp_playlist` DISABLE KEYS */;
LOCK TABLES `tmp_playlist` WRITE; LOCK TABLES `tmp_playlist` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `tmp_playlist` DISABLE KEYS */;
/*!40000 ALTER TABLE `tmp_playlist` ENABLE KEYS */; /*!40000 ALTER TABLE `tmp_playlist` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `tmp_playlist_data` -- Table structure for table `tmp_playlist_data`
@ -599,11 +578,10 @@ CREATE TABLE `tmp_playlist_data` (
-- Dumping data for table `tmp_playlist_data` -- Dumping data for table `tmp_playlist_data`
-- --
/*!40000 ALTER TABLE `tmp_playlist_data` DISABLE KEYS */;
LOCK TABLES `tmp_playlist_data` WRITE; LOCK TABLES `tmp_playlist_data` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `tmp_playlist_data` DISABLE KEYS */;
/*!40000 ALTER TABLE `tmp_playlist_data` ENABLE KEYS */; /*!40000 ALTER TABLE `tmp_playlist_data` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `update_info` -- Table structure for table `update_info`
@ -620,12 +598,11 @@ CREATE TABLE `update_info` (
-- Dumping data for table `update_info` -- Dumping data for table `update_info`
-- --
/*!40000 ALTER TABLE `update_info` DISABLE KEYS */;
LOCK TABLES `update_info` WRITE; LOCK TABLES `update_info` WRITE;
INSERT INTO `update_info` VALUES ('db_version','333004'); /*!40000 ALTER TABLE `update_info` DISABLE KEYS */;
UNLOCK TABLES; INSERT INTO `update_info` VALUES ('db_version','340003');
/*!40000 ALTER TABLE `update_info` ENABLE KEYS */; /*!40000 ALTER TABLE `update_info` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `user` -- Table structure for table `user`
@ -633,14 +610,13 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `user`; DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` ( CREATE TABLE `user` (
`id` int(11) unsigned NOT NULL auto_increment, `id` int(11) NOT NULL auto_increment,
`username` varchar(128) NOT NULL default '', `username` varchar(128) NOT NULL default '',
`fullname` varchar(128) NOT NULL default '', `fullname` varchar(128) NOT NULL default '',
`email` varchar(128) default NULL, `email` varchar(128) default NULL,
`password` varchar(64) NOT NULL default '', `password` varchar(64) NOT NULL default '',
`access` varchar(64) NOT NULL default '', `access` tinyint(4) unsigned NOT NULL,
`disabled` tinyint(1) NOT NULL default '0', `disabled` tinyint(1) unsigned NOT NULL default '0',
`offset_limit` int(5) unsigned NOT NULL default '50',
`last_seen` int(11) unsigned NOT NULL default '0', `last_seen` int(11) unsigned NOT NULL default '0',
`create_date` int(11) unsigned default NULL, `create_date` int(11) unsigned default NULL,
`validation` varchar(128) default NULL, `validation` varchar(128) default NULL,
@ -652,11 +628,10 @@ CREATE TABLE `user` (
-- Dumping data for table `user` -- Dumping data for table `user`
-- --
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
LOCK TABLES `user` WRITE; LOCK TABLES `user` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `user` DISABLE KEYS */;
/*!40000 ALTER TABLE `user` ENABLE KEYS */; /*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `user_preference` -- Table structure for table `user_preference`
@ -664,7 +639,7 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `user_preference`; DROP TABLE IF EXISTS `user_preference`;
CREATE TABLE `user_preference` ( CREATE TABLE `user_preference` (
`user` varchar(128) NOT NULL default '', `user` int(11) NOT NULL,
`preference` int(11) unsigned NOT NULL default '0', `preference` int(11) unsigned NOT NULL default '0',
`value` varchar(255) NOT NULL default '', `value` varchar(255) NOT NULL default '',
KEY `user` (`user`), KEY `user` (`user`),
@ -675,12 +650,11 @@ CREATE TABLE `user_preference` (
-- Dumping data for table `user_preference` -- Dumping data for table `user_preference`
-- --
/*!40000 ALTER TABLE `user_preference` DISABLE KEYS */;
LOCK TABLES `user_preference` WRITE; LOCK TABLES `user_preference` WRITE;
INSERT INTO `user_preference` VALUES ('-1',1,'0'),('-1',4,'10'),('-1',19,'32'),('-1',22,'Ampache :: Pour l\'Amour de la Musique'),('-1',23,'0'),('-1',24,'1'),('-1',25,'80'),('-1',26,'100'),('-1',41,'0'),('-1',29,'stream'),('-1',30,'1'),('-1',31,'en_US'),('-1',32,'m3u'),('-1',33,'classic'),('-1',34,'27'),('-1',35,'27'),('-1',36,'27'),('-1',40,'0'),('-1',42,'0'),('-1',43,'0'),('-1',44,'1'),('-1',45,'0'),('-1',46,'0'),('-1',47,'7'); /*!40000 ALTER TABLE `user_preference` DISABLE KEYS */;
UNLOCK TABLES; INSERT INTO `user_preference` VALUES (-1,43,'0'),(-1,40,'0'),(-1,51,'50'),(-1,36,'27'),(-1,35,'27'),(-1,34,'27'),(-1,33,'classic'),(-1,32,'m3u'),(-1,31,'en_US'),(-1,30,'1'),(-1,29,'stream'),(-1,41,'0'),(-1,26,'100'),(-1,25,'80'),(-1,24,'1'),(-1,23,'0'),(-1,22,'Ampache :: Pour l\'Amour de la Musique'),(-1,19,'32'),(-1,4,'10'),(-1,1,'0'),(-1,44,'1'),(-1,45,'0'),(-1,46,'0'),(-1,47,'7'),(-1,49,'1'),(-1,50,'default');
/*!40000 ALTER TABLE `user_preference` ENABLE KEYS */; /*!40000 ALTER TABLE `user_preference` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `user_vote` -- Table structure for table `user_vote`
@ -688,21 +662,22 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `user_vote`; DROP TABLE IF EXISTS `user_vote`;
CREATE TABLE `user_vote` ( CREATE TABLE `user_vote` (
`user` varchar(64) NOT NULL, `user` int(11) unsigned NOT NULL,
`object_id` int(11) unsigned NOT NULL, `object_id` int(11) unsigned NOT NULL,
`date` int(11) unsigned NOT NULL,
KEY `user` (`user`), KEY `user` (`user`),
KEY `object_id` (`object_id`) KEY `object_id` (`object_id`),
KEY `date` (`date`)
) TYPE=MyISAM; ) TYPE=MyISAM;
-- --
-- Dumping data for table `user_vote` -- Dumping data for table `user_vote`
-- --
/*!40000 ALTER TABLE `user_vote` DISABLE KEYS */;
LOCK TABLES `user_vote` WRITE; LOCK TABLES `user_vote` WRITE;
UNLOCK TABLES; /*!40000 ALTER TABLE `user_vote` DISABLE KEYS */;
/*!40000 ALTER TABLE `user_vote` ENABLE KEYS */; /*!40000 ALTER TABLE `user_vote` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@ -710,3 +685,4 @@ UNLOCK TABLES;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2007-05-13 21:34:12

View file

@ -44,7 +44,10 @@ body {
text-align: left; text-align: left;
font-size: smaller; font-size: smaller;
} }
.error {
color: #ff0033;
font-weight: bold;
}
.notify { .notify {
border: 1px solid #cccccc; border: 1px solid #cccccc;
background-color: #f4f4f4; background-color: #f4f4f4;

View file

@ -18,8 +18,8 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
if (INSTALL != '1') { exit; }
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $htmllang; ?>" lang="<?php echo $htmllang; ?>"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $htmllang; ?>" lang="<?php echo $htmllang; ?>">
<head> <head>
@ -55,9 +55,10 @@
</dl> </dl>
<?php echo _("Step 2 - Creating the Ampache.cfg.php file"); ?><br /> <?php echo _("Step 2 - Creating the Ampache.cfg.php file"); ?><br />
<?php echo _("Step 3 - Setup Initial Account"); ?><br /> <?php echo _("Step 3 - Setup Initial Account"); ?><br />
<br /><br /> <br />
<span class="header2">Insert Ampache Database</span>
<?php Error::display('general'); ?> <?php Error::display('general'); ?>
<br />
<span class="header2">Insert Ampache Database</span>
<form method="post" action="<?php echo $http_type . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?action=create_db&amp;htmllang=$htmllang&amp;charset=$charset"; ?>" enctype="multipart/form-data" > <form method="post" action="<?php echo $http_type . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?action=create_db&amp;htmllang=$htmllang&amp;charset=$charset"; ?>" enctype="multipart/form-data" >
<table> <table>
<tr> <tr>
@ -88,6 +89,10 @@
<td class="align"><?php echo _("Ampache Database User Password"); ?></td> <td class="align"><?php echo _("Ampache Database User Password"); ?></td>
<td><input type="password" id="db_password" name="db_password" value="" disabled="disabled" /></td> <td><input type="password" id="db_password" name="db_password" value="" disabled="disabled" /></td>
</tr> </tr>
<tr>
<td class="align"><?php echo _('Overwrite Existing'); ?></td>
<td><input type="checkbox" name="overwrite_db" value="1" /></td>
</tr>
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
<td><input type="submit" value="<?php echo _("Insert Database"); ?>" /></td> <td><input type="submit" value="<?php echo _("Insert Database"); ?>" /></td>

View file

@ -1,7 +1,7 @@
<?php <?php
/* /*
Copyright (c) 2001 - 2006 Ampache.org Copyright (c) 2001 - 2007 Ampache.org
All rights reserved. All rights reserved.
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
@ -19,17 +19,13 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
/*! if (INSTALL != '1') { exit; }
@header Show Install Config File
*/
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $htmllang; ?>" lang="<?php echo $htmllang; ?>"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $htmllang; ?>" lang="<?php echo $htmllang; ?>">
<head> <head>
<title>Ampache :: For The Love Of Music - Install</title> <title>Ampache :: For The Love Of Music - Install</title>
<?php require_once(conf('prefix') . "/templates/install.css"); ?> <link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" />
</head> </head>
<body> <body>
<div id="header"> <div id="header">
@ -48,7 +44,6 @@
</ul> </ul>
<?php echo _("Once you have ensured that you have the above requirements please fill out the information below. You will only be asked for the required config values. If you would like to make changes to your ampache install at a later date simply edit /config/ampache.cfg.php"); ?> <?php echo _("Once you have ensured that you have the above requirements please fill out the information below. You will only be asked for the required config values. If you would like to make changes to your ampache install at a later date simply edit /config/ampache.cfg.php"); ?>
</div> </div>
<div class="content"> <div class="content">
<?php echo _("Step 1 - Creating and Inserting the Ampache Database"); ?><br /> <?php echo _("Step 1 - Creating and Inserting the Ampache Database"); ?><br />
<?php echo _("Step 2 - Creating the ampache.cfg.php file"); ?><br /> <?php echo _("Step 2 - Creating the ampache.cfg.php file"); ?><br />
@ -56,22 +51,22 @@
<dl> <dl>
<dd><?php echo _("This step creates your initial Ampache admin account. Once your admin account has been created you will be directed to the login page"); ?></dd> <dd><?php echo _("This step creates your initial Ampache admin account. Once your admin account has been created you will be directed to the login page"); ?></dd>
</dl> </dl>
<br /><br /> <?php Error::display('general'); ?>
<br />
<span class="header2"><?php echo _('Create Admin Account'); ?></span> <span class="header2"><?php echo _('Create Admin Account'); ?></span>
<?php echo $GLOBALS['error']->print_error('general'); ?>
<form method="post" action="<?php echo $GLOBALS['php_self'] . "?action=create_account"; ?>" enctype="multipart/form-data" > <form method="post" action="<?php echo $GLOBALS['php_self'] . "?action=create_account"; ?>" enctype="multipart/form-data" >
<table> <table>
<tr> <tr>
<td class="align"><?php echo _("Username"); ?></td> <td class="align"><?php echo _('Username'); ?></td>
<td><input type="text" name="local_username" value="admin" /></td> <td><input type="text" name="local_username" value="admin" /></td>
</tr> </tr>
<tr> <tr>
<td class="align"><?php echo _("Password"); ?></td> <td class="align"><?php echo _('Password'); ?></td>
<td><input type="password" name="local_pass" value="" /></td> <td><input type="password" name="local_pass" value="" /></td>
</tr> </tr>
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
<td><input type="submit" value="<?php echo _("Create Account"); ?>" /></td> <td><input type="submit" value="<?php echo _('Create Account'); ?>" /></td>
</tr> </tr>
</table> </table>
</form> </form>

View file

@ -1,7 +1,7 @@
<?php <?php
/* /*
Copyright (c) 2001 - 2005 Ampache.org Copyright (c) 2001 - 2007 Ampache.org
All rights reserved. All rights reserved.
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
@ -19,21 +19,17 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
/*! if (INSTALL != '1') { exit; }
@header Show Install Config File
*/
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $htmllang; ?>" lang="<?php echo $htmllang; ?>"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $htmllang; ?>" lang="<?php echo $htmllang; ?>">
<head> <head>
<title>Ampache :: For The Love Of Music - Install</title> <title>Ampache :: For The Love Of Music - Install</title>
<?php require_once(conf('prefix') . "/templates/install.css"); ?> <link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" />
</head> </head>
<body> <body>
<div id="header"> <div id="header">
<h1><?php echo _("Ampache Installation"); ?></h1> <h1><?php echo _('Ampache Installation'); ?></h1>
<p>For the love of Music</p> <p>For the love of Music</p>
</div> </div>
<div id="text-box"> <div id="text-box">
@ -55,44 +51,44 @@
<dd><?php echo _("This steps takes the basic config values, and first attempts to write them out directly to your webserver. If access is denied it will prompt you to download the config file. Please put the downloaded config file in /config"); ?></dd> <dd><?php echo _("This steps takes the basic config values, and first attempts to write them out directly to your webserver. If access is denied it will prompt you to download the config file. Please put the downloaded config file in /config"); ?></dd>
</dl> </dl>
<?php echo _("Step 3 - Setup Initial Account"); ?><br /> <?php echo _("Step 3 - Setup Initial Account"); ?><br />
<br /><br /> <?php Error::display('general'); ?>
<span class="header2">Generate Config File</span> <br />
<?php echo $GLOBALS['error']->print_error('general'); ?> <span class="header2"><?php echo _('Generate Config File'); ?></span>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] . "?action=create_config"; ?>" enctype="multipart/form-data" > <form method="post" action="<?php echo $_SERVER['PHP_SELF'] . "?action=create_config"; ?>" enctype="multipart/form-data" >
<table> <table>
<tr> <tr>
<td class="align"><?php echo _("Web Path"); ?></td> <td class="align"><?php echo _('Web Path'); ?></td>
<td class="align"><input type="text" name="web_path" value="<?php echo $web_path; ?>" /></td> <td class="align"><input type="text" name="web_path" value="<?php echo $web_path; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="align"><?php echo _("Desired Database Name"); ?></td> <td class="align"><?php echo _('Desired Database Name'); ?></td>
<td class="align"><input type="text" name="local_db" value="<?php echo scrub_out($_REQUEST['local_db']); ?>" /></td> <td class="align"><input type="text" name="local_db" value="<?php echo scrub_out($_REQUEST['local_db']); ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="align"><?php echo _("MySQL Hostname"); ?></td> <td class="align"><?php echo _('MySQL Hostname'); ?></td>
<td class="align"><input type="text" name="local_host" value="<?php echo scrub_out($_REQUEST['local_host']); ?>" /></td> <td class="align"><input type="text" name="local_host" value="<?php echo scrub_out($_REQUEST['local_host']); ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="align"><?php echo _("MySQL Username"); ?></td> <td class="align"><?php echo _('MySQL Username'); ?></td>
<td class="align"><input type="text" name="local_username" value="<?php echo scrub_out($_REQUEST['local_username']); ?>" /></td> <td class="align"><input type="text" name="local_username" value="<?php echo scrub_out($_REQUEST['local_username']); ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="align"><?php echo _("MySQL Password"); ?></td> <td class="align"><?php echo _('MySQL Password'); ?></td>
<td class="align"><input type="password" name="local_pass" value="" /></td> <td class="align"><input type="password" name="local_pass" value="" /></td>
</tr> </tr>
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
<td><input type="submit" value="<?php echo _("Write Config"); ?>" /></td> <td><input type="submit" value="<?php echo _('Write Config'); ?>" /></td>
</tr> </tr>
</table> </table>
</form> </form>
<br /> <br />
<table> <table>
<tr> <tr>
<td class="align"><?php echo _("Ampache.cfg.php Exists"); ?></td> <td class="align"><?php echo _('Ampache.cfg.php Exists'); ?></td>
<td>[ <td>[
<?php <?php
if (!read_config_file($configfile)) { if (!is_readable($configfile)) {
$status['read_config'] = 'false'; $status['read_config'] = 'false';
echo " <span class=\"notok\">ERROR</span> "; echo " <span class=\"notok\">ERROR</span> ";
} }
@ -106,11 +102,11 @@
</tr> </tr>
<tr> <tr>
<td class="align"> <td class="align">
<?php echo _("Ampache.cfg.php Configured?"); ?> <?php echo _('Ampache.cfg.php Configured?'); ?>
</td> </td>
<td>[ <td>[
<?php <?php
$results = read_config($configfile, 0, 0); $results = @parse_ini_file($configfile);
if (!check_config_values($results)) { if (!check_config_values($results)) {
$status['parse_config'] = 'false'; $status['parse_config'] = 'false';
echo " <span class=\"notok\">ERROR</span> "; echo " <span class=\"notok\">ERROR</span> ";
@ -133,7 +129,7 @@
</table> </table>
<br /> <br />
<form method="post" action="<?php echo $GLOBALS['php_self'] . "?action=show_create_account&amp;htmllang=$htmllang&amp;charset=$charset"; ?>" enctype="multipart/form-data"> <form method="post" action="<?php echo $GLOBALS['php_self'] . "?action=show_create_account&amp;htmllang=$htmllang&amp;charset=$charset"; ?>" enctype="multipart/form-data">
<input type="submit" value="Continue to Step 3" /> <input type="submit" value="<?php echo _('Continue to Step 3'); ?>" />
</form> </form>
</div> </div>
<div id="bottom"> <div id="bottom">