transferScrape.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /* $Id: transferScrape.php 2893 2007-04-14 13:20:30Z b4rt $ */
  3. /*******************************************************************************
  4. LICENSE
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License (GPL)
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. To read the license please visit http://www.gnu.org/copyleft/gpl.html
  14. *******************************************************************************/
  15. // prevent direct invocation
  16. if ((!isset($cfg['user'])) || (isset($_REQUEST['cfg']))) {
  17. @ob_end_clean();
  18. @header("location: ../../index.php");
  19. exit();
  20. }
  21. /******************************************************************************/
  22. // common functions
  23. require_once('inc/functions/functions.common.php');
  24. // transfer functions
  25. require_once('inc/functions/functions.transfer.php');
  26. // init template-instance
  27. tmplInitializeInstance($cfg["theme"], "page.transferScrape.tmpl");
  28. // init transfer
  29. transfer_init();
  30. // client-switch
  31. if (substr($transfer, -8) == ".torrent") {
  32. // this is a t-client
  33. $tmpl->setvar('hasScrape', 1);
  34. $tmpl->setvar('scrapeInfo', getTorrentScrapeInfo($transfer));
  35. } else if (substr($transfer, -5) == ".wget") {
  36. // this is wget.
  37. $tmpl->setvar('hasScrape', 0);
  38. $tmpl->setvar('scrapeInfo', "Scrape not supported by wget");
  39. } else if (substr($transfer, -4) == ".nzb") {
  40. // this is nzbperl.
  41. $tmpl->setvar('hasScrape', 0);
  42. $tmpl->setvar('scrapeInfo', "Scrape not supported by nzbperl");
  43. } else {
  44. AuditAction($cfg["constants"]["error"], "INVALID TRANSFER: ".$transfer);
  45. @error("Invalid Transfer", "", "", array($transfer));
  46. }
  47. // title + foot
  48. tmplSetFoot(false);
  49. tmplSetTitleBar($transferLabel." - Scrape", false);
  50. // iid
  51. tmplSetIidVars();
  52. // parse template
  53. $tmpl->pparse();
  54. ?>