@@ -1,87 +1,87 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | if (!$page->users->isLoggedIn()) |
| 4 | - $page->show403(); |
|
| 4 | + $page->show403(); |
|
| 5 | 5 | use nntmux\NZBVortex; |
| 6 | 6 | |
| 7 | 7 | try |
| 8 | 8 | { |
| 9 | - if (isset($_GET['isAjax'])) |
|
| 10 | - { |
|
| 11 | - $vortex = new NZBVortex; |
|
| 9 | + if (isset($_GET['isAjax'])) |
|
| 10 | + { |
|
| 11 | + $vortex = new NZBVortex; |
|
| 12 | 12 | |
| 13 | - // I guess we Ajax this way. |
|
| 14 | - if (isset($_GET['getOverview'])) |
|
| 15 | - { |
|
| 16 | - $overview = $vortex->getOverview(); |
|
| 17 | - $page->smarty->assign('overview', $overview); |
|
| 18 | - $content = $page->smarty->fetch('nzbvortex-ajax.tpl'); |
|
| 19 | - echo $content; |
|
| 20 | - exit; |
|
| 21 | - } |
|
| 13 | + // I guess we Ajax this way. |
|
| 14 | + if (isset($_GET['getOverview'])) |
|
| 15 | + { |
|
| 16 | + $overview = $vortex->getOverview(); |
|
| 17 | + $page->smarty->assign('overview', $overview); |
|
| 18 | + $content = $page->smarty->fetch('nzbvortex-ajax.tpl'); |
|
| 19 | + echo $content; |
|
| 20 | + exit; |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - if (isset($_GET['addQueue'])) |
|
| 24 | - { |
|
| 25 | - $nzb = $_GET['addQueue']; |
|
| 26 | - $vortex->addQueue($nzb); |
|
| 27 | - exit; |
|
| 28 | - } |
|
| 23 | + if (isset($_GET['addQueue'])) |
|
| 24 | + { |
|
| 25 | + $nzb = $_GET['addQueue']; |
|
| 26 | + $vortex->addQueue($nzb); |
|
| 27 | + exit; |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - if (isset($_GET['resume'])) |
|
| 31 | - { |
|
| 32 | - $vortex->resume((int)$_GET['resume']); |
|
| 33 | - exit; |
|
| 34 | - } |
|
| 30 | + if (isset($_GET['resume'])) |
|
| 31 | + { |
|
| 32 | + $vortex->resume((int)$_GET['resume']); |
|
| 33 | + exit; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - if (isset($_GET['pause'])) |
|
| 37 | - { |
|
| 38 | - $vortex->pause((int)$_GET['pause']); |
|
| 39 | - exit; |
|
| 40 | - } |
|
| 36 | + if (isset($_GET['pause'])) |
|
| 37 | + { |
|
| 38 | + $vortex->pause((int)$_GET['pause']); |
|
| 39 | + exit; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - if (isset($_GET['moveup'])) |
|
| 43 | - { |
|
| 44 | - $vortex->moveUp((int)$_GET['moveup']); |
|
| 45 | - exit; |
|
| 46 | - } |
|
| 42 | + if (isset($_GET['moveup'])) |
|
| 43 | + { |
|
| 44 | + $vortex->moveUp((int)$_GET['moveup']); |
|
| 45 | + exit; |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - if (isset($_GET['movedown'])) |
|
| 49 | - { |
|
| 50 | - $vortex->moveDown((int)$_GET['movedown']); |
|
| 51 | - exit; |
|
| 52 | - } |
|
| 48 | + if (isset($_GET['movedown'])) |
|
| 49 | + { |
|
| 50 | + $vortex->moveDown((int)$_GET['movedown']); |
|
| 51 | + exit; |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - if (isset($_GET['movetop'])) |
|
| 55 | - { |
|
| 56 | - $vortex->moveTop((int)$_GET['movetop']); |
|
| 57 | - exit; |
|
| 58 | - } |
|
| 54 | + if (isset($_GET['movetop'])) |
|
| 55 | + { |
|
| 56 | + $vortex->moveTop((int)$_GET['movetop']); |
|
| 57 | + exit; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - if (isset($_GET['movebottom'])) |
|
| 61 | - { |
|
| 62 | - $vortex->moveBottom((int)$_GET['movebottom']); |
|
| 63 | - exit; |
|
| 64 | - } |
|
| 60 | + if (isset($_GET['movebottom'])) |
|
| 61 | + { |
|
| 62 | + $vortex->moveBottom((int)$_GET['movebottom']); |
|
| 63 | + exit; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - if (isset($_GET['delete'])) |
|
| 67 | - { |
|
| 68 | - $vortex->delete((int)$_GET['delete']); |
|
| 69 | - exit; |
|
| 70 | - } |
|
| 66 | + if (isset($_GET['delete'])) |
|
| 67 | + { |
|
| 68 | + $vortex->delete((int)$_GET['delete']); |
|
| 69 | + exit; |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | - if (isset($_GET['filelist'])) |
|
| 73 | - { |
|
| 74 | - $response = $vortex->getFilelist((int)$_GET['filelist']); |
|
| 75 | - echo json_encode($response); |
|
| 76 | - exit; |
|
| 77 | - } |
|
| 78 | - } |
|
| 72 | + if (isset($_GET['filelist'])) |
|
| 73 | + { |
|
| 74 | + $response = $vortex->getFilelist((int)$_GET['filelist']); |
|
| 75 | + echo json_encode($response); |
|
| 76 | + exit; |
|
| 77 | + } |
|
| 78 | + } |
|
| 79 | 79 | } |
| 80 | 80 | catch (Exception $e) |
| 81 | 81 | { |
| 82 | - header('HTTP/1.1 500 Internal Server Error'); |
|
| 83 | - printf($e->getMessage()); |
|
| 84 | - exit; |
|
| 82 | + header('HTTP/1.1 500 Internal Server Error'); |
|
| 83 | + printf($e->getMessage()); |
|
| 84 | + exit; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $page->title = 'NZBVortex'; |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | $page->show404(); |
| 18 | 18 | |
| 19 | 19 | if (empty($nzbget->password)) |
| 20 | - $page->show404(); |
|
| 20 | + $page->show404(); |
|
| 21 | 21 | |
| 22 | 22 | $guid = $_GET["id"]; |
| 23 | 23 | |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | switch($action) |
| 25 | 25 | { |
| 26 | - case 'submit': |
|
| 27 | - $coverLoc = WWW_DIR."covers/movies/".$id.'-cover.jpg'; |
|
| 28 | - $backdropLoc = WWW_DIR."covers/movies/".$id.'-backdrop.jpg'; |
|
| 26 | + case 'submit': |
|
| 27 | + $coverLoc = WWW_DIR."covers/movies/".$id.'-cover.jpg'; |
|
| 28 | + $backdropLoc = WWW_DIR."covers/movies/".$id.'-backdrop.jpg'; |
|
| 29 | 29 | |
| 30 | 30 | if($_FILES['cover']['size'] > 0) |
| 31 | 31 | { |
@@ -66,10 +66,10 @@ discard block |
||
| 66 | 66 | ]); |
| 67 | 67 | |
| 68 | 68 | header("Location:".WWW_TOP."/movie-list.php"); |
| 69 | - die(); |
|
| 70 | - break; |
|
| 71 | - case 'view': |
|
| 72 | - default: |
|
| 69 | + die(); |
|
| 70 | + break; |
|
| 71 | + case 'view': |
|
| 72 | + default: |
|
| 73 | 73 | $page->title = "Movie Edit"; |
| 74 | 74 | $page->smarty->assign('movie', $mov); |
| 75 | 75 | break; |
@@ -58,17 +58,17 @@ |
||
| 58 | 58 | |
| 59 | 59 | switch($action) |
| 60 | 60 | { |
| 61 | - case 'test': |
|
| 62 | - if (isset($_REQUEST["regex"])) |
|
| 61 | + case 'test': |
|
| 62 | + if (isset($_REQUEST["regex"])) |
|
| 63 | 63 | { |
| 64 | - $matches = $reg->testRegex($_REQUEST['regex'], $group, $poster, $unreleased, $matchagainstbins); |
|
| 64 | + $matches = $reg->testRegex($_REQUEST['regex'], $group, $poster, $unreleased, $matchagainstbins); |
|
| 65 | 65 | |
| 66 | - $offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0; |
|
| 66 | + $offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0; |
|
| 67 | 67 | $page->smarty->assign('pagertotalitems',sizeof($matches)); |
| 68 | 68 | $page->smarty->assign('pageroffset',$offset); |
| 69 | 69 | $page->smarty->assign('pageritemsperpage',ITEMS_PER_PAGE); |
| 70 | - $page->smarty->assign('pagerquerybase', WWW_TOP."/regex-test.php?action=test&groupname={$groupname}&groupID={$groupID}®ex=".urlencode($regex)."&poster=".urlencode($poster)."&unreleased={$unreleased}&matchagainstbins={$matchagainstbins}&offset="); |
|
| 71 | - $pager = $page->smarty->fetch("pager.tpl"); |
|
| 70 | + $page->smarty->assign('pagerquerybase', WWW_TOP."/regex-test.php?action=test&groupname={$groupname}&groupID={$groupID}®ex=".urlencode($regex)."&poster=".urlencode($poster)."&unreleased={$unreleased}&matchagainstbins={$matchagainstbins}&offset="); |
|
| 71 | + $pager = $page->smarty->fetch("pager.tpl"); |
|
| 72 | 72 | $page->smarty->assign('pager', $pager); |
| 73 | 73 | |
| 74 | 74 | $matches = array_slice($matches, $offset, ITEMS_PER_PAGE); |
@@ -14,8 +14,8 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | switch($action) |
| 16 | 16 | { |
| 17 | - case 'add': |
|
| 18 | - $page->title = "Spotnab Source Add"; |
|
| 17 | + case 'add': |
|
| 18 | + $page->title = "Spotnab Source Add"; |
|
| 19 | 19 | $source = []; |
| 20 | 20 | $source["description"] = ''; |
| 21 | 21 | $row = $spotnab->getDefaultValue('spotnabsources','username'); |
@@ -27,20 +27,20 @@ discard block |
||
| 27 | 27 | $source["publickey"] = ''; |
| 28 | 28 | $page->smarty->assign('source', $source); |
| 29 | 29 | break; |
| 30 | - case 'submit': |
|
| 31 | - if ($_POST["id"] == "") |
|
| 32 | - { |
|
| 30 | + case 'submit': |
|
| 31 | + if ($_POST["id"] == "") |
|
| 32 | + { |
|
| 33 | 33 | $ret = $spotnab->addSource($_POST['description'], $_POST['username'], $_POST['useremail'], $_POST['usenetgroup'], $_POST['publickey']); |
| 34 | 34 | header("Location:".WWW_TOP."/spotnab-list.php"); |
| 35 | - } |
|
| 36 | - else |
|
| 37 | - { |
|
| 35 | + } |
|
| 36 | + else |
|
| 37 | + { |
|
| 38 | 38 | $ret = $spotnab->updateSource($_POST['id'],$_POST['description'], $_POST['username'], $_POST['useremail'], $_POST['usenetgroup'], $_POST['publickey']); |
| 39 | 39 | header("Location:".WWW_TOP."/spotnab-list.php"); |
| 40 | 40 | } |
| 41 | - break; |
|
| 42 | - case 'view': |
|
| 43 | - default: |
|
| 41 | + break; |
|
| 42 | + case 'view': |
|
| 43 | + default: |
|
| 44 | 44 | |
| 45 | 45 | if (isset($_GET["id"])) |
| 46 | 46 | { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $page->smarty->assign('source', $source); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - break; |
|
| 53 | + break; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $page->content = $page->smarty->fetch('spotnab-edit.tpl'); |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | switch($action) |
| 27 | 27 | { |
| 28 | - case 'submit': |
|
| 29 | - $coverLoc = WWW_DIR."covers/book/".$id.'.jpg'; |
|
| 28 | + case 'submit': |
|
| 29 | + $coverLoc = WWW_DIR."covers/book/".$id.'.jpg'; |
|
| 30 | 30 | |
| 31 | 31 | if($_FILES['cover']['size'] > 0) |
| 32 | 32 | { |
@@ -43,10 +43,10 @@ discard block |
||
| 43 | 43 | $book->update($id, $_POST["title"], $_POST['asin'], $_POST['url'], $_POST["author"], $_POST["publisher"], $_POST["publishdate"], $_POST["cover"]); |
| 44 | 44 | |
| 45 | 45 | header("Location:".WWW_TOP."/book-list.php"); |
| 46 | - die(); |
|
| 47 | - break; |
|
| 48 | - case 'view': |
|
| 49 | - default: |
|
| 46 | + die(); |
|
| 47 | + break; |
|
| 48 | + case 'view': |
|
| 49 | + default: |
|
| 50 | 50 | $page->title = "Book Edit"; |
| 51 | 51 | $page->smarty->assign('book', $b); |
| 52 | 52 | break; |
@@ -21,20 +21,20 @@ |
||
| 21 | 21 | if (!$rel) |
| 22 | 22 | $page->show404(); |
| 23 | 23 | |
| 24 | - $nzbpath = $nzb->getNZBPath($_GET["id"], $page->settings->getSetting('nzbpath')); |
|
| 24 | + $nzbpath = $nzb->getNZBPath($_GET["id"], $page->settings->getSetting('nzbpath')); |
|
| 25 | 25 | |
| 26 | - if (!file_exists($nzbpath)) |
|
| 27 | - $page->show404(); |
|
| 26 | + if (!file_exists($nzbpath)) |
|
| 27 | + $page->show404(); |
|
| 28 | 28 | |
| 29 | - ob_start(); |
|
| 30 | - @readgzfile($nzbpath); |
|
| 31 | - $nzbfile = ob_get_contents(); |
|
| 32 | - ob_end_clean(); |
|
| 29 | + ob_start(); |
|
| 30 | + @readgzfile($nzbpath); |
|
| 31 | + $nzbfile = ob_get_contents(); |
|
| 32 | + ob_end_clean(); |
|
| 33 | 33 | |
| 34 | - $ret = $nzb->nzbFileList($nzbfile); |
|
| 34 | + $ret = $nzb->nzbFileList($nzbfile); |
|
| 35 | 35 | |
| 36 | - $page->smarty->assign('rel', $rel); |
|
| 37 | - $page->smarty->assign('files', $ret); |
|
| 36 | + $page->smarty->assign('rel', $rel); |
|
| 37 | + $page->smarty->assign('files', $ret); |
|
| 38 | 38 | |
| 39 | 39 | $page->title = "File List"; |
| 40 | 40 | $page->meta_title = "View Nzb file list"; |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | switch($action) |
| 27 | 27 | { |
| 28 | - case 'submit': |
|
| 29 | - $coverLoc = WWW_DIR."covers/console/".$id.'.jpg'; |
|
| 28 | + case 'submit': |
|
| 29 | + $coverLoc = WWW_DIR."covers/console/".$id.'.jpg'; |
|
| 30 | 30 | |
| 31 | 31 | if($_FILES['cover']['size'] > 0) |
| 32 | 32 | { |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | $console->update($id, $_POST["title"], $_POST['asin'], $_POST['url'], $_POST["salesrank"], $_POST["platform"], $_POST["publisher"], $_POST["releasedate"], $_POST["esrb"], $_POST["cover"], $_POST["genre"]); |
| 46 | 46 | |
| 47 | 47 | header("Location:".WWW_TOP."/console-list.php"); |
| 48 | - die(); |
|
| 49 | - break; |
|
| 50 | - case 'view': |
|
| 51 | - default: |
|
| 48 | + die(); |
|
| 49 | + break; |
|
| 50 | + case 'view': |
|
| 51 | + default: |
|
| 52 | 52 | $page->title = "Console Edit"; |
| 53 | 53 | $page->smarty->assign('console', $con); |
| 54 | 54 | $page->smarty->assign('genres', $gen->getGenres(Genres::CONSOLE_TYPE)); |
@@ -14,13 +14,13 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | switch($action) |
| 16 | 16 | { |
| 17 | - case 'submit': |
|
| 17 | + case 'submit': |
|
| 18 | 18 | $ret = $category->update($_POST["id"], $_POST["status"], $_POST["description"], |
| 19 | 19 | $_POST["disablepreview"], $_POST["minsizetoformrelease"], $_POST["maxsizetoformrelease"]); |
| 20 | 20 | header("Location:".WWW_TOP."/category-list.php"); |
| 21 | 21 | break; |
| 22 | - case 'view': |
|
| 23 | - default: |
|
| 22 | + case 'view': |
|
| 23 | + default: |
|
| 24 | 24 | |
| 25 | 25 | if (isset($_GET["id"])) |
| 26 | 26 | { |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $page->smarty->assign('category', $cat); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - break; |
|
| 35 | + break; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $page->smarty->assign('status_ids', array(Category::STATUS_ACTIVE,Category::STATUS_INACTIVE)); |