diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-02-28 06:36:25 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-02-28 06:36:25 +0000 |
commit | c1f2b35e2a18b0752746f5db5794cf18714bc71d (patch) | |
tree | 279b008abb9c5585f957396c8da85bb429e033f9 /lib/init.php | |
parent | 7bdf3a77b706c01c1642a02f21823b74f8f930db (diff) | |
download | ampache-c1f2b35e2a18b0752746f5db5794cf18714bc71d.tar.gz ampache-c1f2b35e2a18b0752746f5db5794cf18714bc71d.tar.bz2 ampache-c1f2b35e2a18b0752746f5db5794cf18714bc71d.zip |
corrected a few queries, removed a few other useless ones that were already broken
Diffstat (limited to 'lib/init.php')
-rw-r--r-- | lib/init.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/init.php b/lib/init.php index f02da5be..b86c3108 100644 --- a/lib/init.php +++ b/lib/init.php @@ -223,15 +223,20 @@ else { session_name(Config::get('session_name')); session_id(scrub_in($_REQUEST['sessid'])); session_start(); + $GLOBALS['user'] = User::get_from_username($sess_results['username']); } - $GLOBALS['user'] = User::get_from_username($sess_results['username']); -} + else { + $GLOBALS['user'] = new User(); + } +} // If NO_SESSION passed // Load the Preferences from the database Preference::init(); -// We need to create the tmp playlist for our user -$GLOBALS['user']->load_playlist(); +// We need to create the tmp playlist for our user only if we have a session +if (session_id()) { + $GLOBALS['user']->load_playlist(); +} /* Add in some variables for ajax done here because we need the user */ Config::set('ajax_url',Config::get('web_path') . '/server/ajax.server.php',1); |