5) { $new_gc_probability = $gc_divisor * .2; ini_set('session.gc_probability',$new_gc_probability); } /* END Set PHP Vars */ /* Overwrite them with the DB preferences */ set_site_preferences(); /* Seed the random number */ srand((double) microtime() * 1000003); // If we don't want a session if (!isset($no_session) AND conf('use_auth')) { if (!check_session()) { logout(); exit(); } get_preferences(); set_theme(); $user = new User($_SESSION['userdata']['username']); $user->update_last_seen(); } if (!conf('use_auth')) { $auth['success'] = 1; $auth['info']['username'] = "Ampache"; $auth['info']['fullname'] = "Ampache User"; $auth['info']['id'] = 0; $auth['info']['access'] = "admin"; $auth['info']['offset_limit'] = 50; if (!check_session()) { make_local_session_only($auth); } $user = new User(0); $user->fullname = $auth['info']['fullname']; $user->id = $auth['info']['id']; $user->offset_limit = $auth['info']['offset_limit']; $user->username = $auth['info']['username']; $user->access = $auth['info']['access']; $_SESSION['userdata']['access'] = $auth['info']['access']; $_SESSION['userdata']['username'] = $auth['info']['username']; $_SESSION['userdata']['offset_limit'] = $auth['info']['offset_limit']; $_SESSION['userdata']['id'] = $auth['info']['id']; $user->set_preferences(); get_preferences(); set_theme(); } // Load gettext mojo load_gettext(); /* Set CHARSET */ header ("Content-Type: text/html; charset=" . conf('site_charset')); /* Clean up a bit */ unset($array); unset($results); /* Setup the flip class */ flip_class(array('odd','even')); /* Setup the Error Class */ $error = new Error(); if (! preg_match('/update\.php/', $_SERVER['PHP_SELF'])) { $update = new Update(); if ($update->need_update()) { header("Location: " . conf('web_path') . "/update.php"); exit(); } } unset($update); ?>