<?php
  /**************************************************************************\
  * phpGroupWare Application (Napster)                                       *
  * http://www.phpgroupware.org                                              *
  * Written by Mark Peters <mpeters@satx.rr.com>                             *
  * Based on WebNap Client copyright 2000                                    *
  * Written by Aakash Kambuj <aakash@idearing.com>                           *
  *            Kalpak Kothari <kalpak@idearing.com>                          *
  * --------------------------------------------                             *
  *  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.                                              *
  * --------------------------------------------                             *
  * Napster is a registered trademark of Napster Inc  http://www.napster.com *
  \**************************************************************************/

  /* $Id: download.php,v 1.5 2000/12/02 09:45:45 skeeter Exp $ */

  $phpgw_info["flags"]["currentapp"] = "napster";
  $phpgw_info["flags"]["disable_message_class"] = True;
  $phpgw_info["flags"]["disable_send_class"] = True;
  include("../header.inc.php");
  include($phpgw_info["server"]["app_inc"]."/browserdetect.inc.php");

  @set_time_limit(0);

  $browser = new BrowserDetector;
  $bd = $browser->isIEorMozilla();
  $bdlynx = $browser->isLynx();
  unset($browser);

  $napster = new napster;

//  if(!isset($napserver))
//    $napster->napserver = $napster->servers["imperialfleet.com"];
//  else
//    $napster->napserver = urldecode($napserver);

//  if(!isset($linespeed))
//    $napster->linespeed = "AT BEST";
//  else
//    $napster->linespeed = urldecode($linespeed);

//  if(!isset($conn_speed))
//    $napster->conn_speed = "0";
//  else
//    $napster->conn_speed = urldecode($conn_speed);

//  if(!isset($linktype))
//    $napster->linktype = 10;
//  else
//    $napster->linktype = urldecode($linktype);

//  if(!isset($nofirewall))
//    $napster->nofirewall = 0;
//  else
//    $napster->nofirewall = $nofirewall;

  if (isset($napserver)){
    $napster->napserver = urldecode($napserver);
    $napster->nick = unserialize($nick);
    $napster->title = unserialize($title);

    if(!$napster->init_conn()) {
      $phpgw->common->phpgw_footer();
      exit;
    }
    $napster->getmp3();
  }

  $phpgw->common->phpgw_footer();
?>
