downloadHeaders('ampache.cfg.php','text/plain',false,filesize('config/ampache.cfg.php.dist')); echo $final; exit(); return true; } // install_create_config /** * install_create_account * this creates your initial account and sets up the preferences for the -1 user and you */ function install_create_account($username,$password,$password2) { if (!strlen($username) OR !strlen($password)) { Error::add('general',_('No Username/Password specified')); return false; } if ($password !== $password2) { Error::add('general',_('Passwords do not match')) return false; } $dbh = Dba::dbh(); if (!is_resource($dbh)) { Error::add('general','Database Connection Failed:' . mysql_error()); return false; } $db_select = @mysql_select_db(Config::get('database_name'),$dbh); if (!$db_select) { Error::add('general','Database Select Failed:' . mysql_error()); return false; } $username = Dba::escape($username); $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; } // Fix the system users preferences User::fix_preferences('-1'); return true; } // install_create_account ?>