diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-11-04 08:15:40 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-11-04 08:15:40 +0000 |
commit | b315ff2d260209c2d99ee056ed974585caf9f6cf (patch) | |
tree | 4c3e13f84b5b6cce764fb587c7a245c02b50a3b3 /lib | |
parent | 2169a44d52a35ed05ca098235247dde078bd223d (diff) | |
download | ampache-b315ff2d260209c2d99ee056ed974585caf9f6cf.tar.gz ampache-b315ff2d260209c2d99ee056ed974585caf9f6cf.tar.bz2 ampache-b315ff2d260209c2d99ee056ed974585caf9f6cf.zip |
some minror tweaks
Diffstat (limited to 'lib')
-rw-r--r-- | lib/class/stream.class.php | 5 | ||||
-rw-r--r-- | lib/init.php | 28 | ||||
-rw-r--r-- | lib/install.php | 11 |
3 files changed, 29 insertions, 15 deletions
diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index 7d0566bb..d9777879 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -60,6 +60,11 @@ class Stream { */ function start() { + if (!is_array($this->songs)) { + debug_event('stream','Error: No Songs Passed on ' . $this->type . ' stream','2'); + return false; + } + $methods = get_class_methods('Stream'); $create_function = "create_" . $this->type; if (in_array($create_function,$methods)) { diff --git a/lib/init.php b/lib/init.php index 5458ce43..154ad5f7 100644 --- a/lib/init.php +++ b/lib/init.php @@ -5,9 +5,8 @@ All rights reserved. This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License v2 + as published by the Free Software Foundation This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -20,12 +19,9 @@ */ -/*! - @header INIT file - Take care of our init grunt work so we don't scatter paths - all over the place. - -*/ +/*** + * DO NOT EDIT THIS FILE + ***/ // Set the Error level manualy... I'm to lazy to fix notices error_reporting(E_ALL ^ E_NOTICE); @@ -37,8 +33,6 @@ $prefix = realpath($ampache_path . "/../"); $configfile = "$prefix/config/ampache.cfg.php"; require_once($prefix . "/lib/general.lib.php"); -/*********************STOP EDITING*********************************/ - /* Check to see if this is Http or https */ @@ -73,7 +67,7 @@ if (!$results = read_config($configfile,0)) { } /** This is the version.... fluf nothing more... **/ -$results['version'] = '3.3.3-Alpha2 Build (002)'; +$results['version'] = '3.3.3-Alpha2 Build (003)'; $results['raw_web_path'] = $results['web_path']; $results['web_path'] = $http_type . $_SERVER['HTTP_HOST'] . $results['web_path']; @@ -257,8 +251,16 @@ if (in_array("http",$results['auth_methods'])) { // If we don't want a session if (!isset($no_session) AND conf('use_auth')) { - if (!vauth_check_session()) { logout(); exit(); } + /* Verify Their session */ + if (!vauth_check_session()) { logout(); exit; } + + /* Create the new user */ $user = new User($_SESSION['userdata']['username']); + + /* If they user ID doesn't exist deny them */ + if (!$user->uid) { logout(); exit; } + + /* Load preferences and theme */ init_preferences(); set_theme(); $user->set_preferences(); diff --git a/lib/install.php b/lib/install.php index a45d1c98..70b38780 100644 --- a/lib/install.php +++ b/lib/install.php @@ -83,9 +83,10 @@ function install_check_status($configfile) { */ $results = read_config($GLOBALS['configfile'], 0, 0); $dbh = check_database($results['local_host'],$results['local_username'],$results['local_pass']); - + if (is_resource($dbh)) { - mysql_select_db($results['local_db'],$dbh); + $db_select = mysql_select_db($results['local_db'],$dbh); + $sql = "SELECT * FROM user"; $db_results = @mysql_query($sql, $dbh); if (!@mysql_num_rows($db_results)) { @@ -93,6 +94,7 @@ function install_check_status($configfile) { } } + /* Defaut to no */ return false; @@ -110,6 +112,11 @@ function install_insert_db($username,$password,$hostname,$database) { /* Attempt to make DB connection */ $dbh = @mysql_pconnect($hostname,$username,$password); + if (!is_resource($dbh)) { + $GLOBALS['error']->add_error('general',"Error: Unable to make Database Connection " . mysql_error()); + return false; + } + /* Check/Create Database as needed */ $db_selected = @mysql_select_db($database, $dbh); if (!$db_selected) { |