<?PHP // setup.php

require_once("functions.php");

session_start();
if ( isset($_SESSION["USERNAME"]))
    $USERNAME = $_SESSION["USERNAME"];
else
    $USERNAME = "";

if ( isset($_SESSION["PASSWORD"]))
    $PASSWORD = $_SESSION["PASSWORD"];
else
    $PASSWORD = "";

if ( isset($_REQUEST["username"]) and isset($_REQUEST["password"]) ) {
    $USERNAME = $_REQUEST["username"];
    $PASSWORD = $_REQUEST["password"];
}

$_SESSION["USERNAME"] = $USERNAME;
$_SESSION["PASSWORD"] = $PASSWORD;

if (! ($USERNAME and $PASSWORD)) {
    require("login.html");
    exit;
}

if ( isset($_REQUEST["command"]))
    $command = $_REQUEST["command"];
else
    $command = "";

if ( isset($_REQUEST["track"]))
    $track = $_REQUEST["track"];

if ( isset($_REQUEST["volume"]))
    $volume = $_REQUEST["volume"];

if ( isset($_REQUEST["rate"]))
    $rate = $_REQUEST["rate"];
else
    $rate = "";

if ( isset($_REQUEST["mode"]))
    $mode = $_REQUEST["mode"];

if ( isset($_REQUEST["album"]))
    $album = $_REQUEST["album"];
else if ( isset($_SESSION["album"]))
    $album = $_SESSION["album"];
else
    $album = "";

// Setup the mserv command for the current user.
$MSERVCMD = $mservcmd." -u ".escapeshellarg($USERNAME)." -p ".escapeshellarg($PASSWORD)." ";


header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); 
header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" ); 
header( "Cache-Control: no-cache, must-revalidate" ); 
header( "Pragma: no-cache" );

?>

