Passed
Push — dev ( 8c58d8...9b6cb9 )
by Darko
09:10
created
www/pages/nzbgetqueuedata.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 				"<td style='text-align:center;'>" . $item['RemainingSizeMB'] . " MB</td>" .
57 57
 				"<td style='text-align:center;'>" . ($item['FileSizeMB'] == 0 ? 0 : round(100 - ($item['RemainingSizeMB'] / $item['FileSizeMB']) * 100)) . "%</td>" .
58 58
 				"<td style='text-align:center;'>" . ($item['ActiveDownloads'] > 0 ? 'Downloading' : 'Paused') . "</td>" .
59
-				"<td style='text-align:center;'><a  onclick=\"return confirm('Are you sure?');\" href='?del=" .  $item['LastID'] . "'>Delete</a></td>" .
59
+				"<td style='text-align:center;'><a  onclick=\"return confirm('Are you sure?');\" href='?del=" . $item['LastID'] . "'>Delete</a></td>" .
60 60
 				"<td style='text-align:center;'><a href='?pause=" . $item['LastID'] . "'>Pause</a></td>" .
61 61
 				"<td style='text-align:center;'><a href='?resume=" . $item['LastID'] . "'>Resume</a></td>" .
62 62
 				"</tr>";
Please login to merge, or discard this patch.
www/pages/contact-us.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@
 block discarded – undo
31 31
 	}
32 32
 }
33 33
 $page->smarty->assign('msg', $msg);
34
-$page->title = "Contact ".$page->settings->getSetting('title');
35
-$page->meta_title = "Contact ".$page->settings->getSetting('title');
34
+$page->title = "Contact " . $page->settings->getSetting('title');
35
+$page->meta_title = "Contact " . $page->settings->getSetting('title');
36 36
 $page->meta_keywords = "contact us,contact,get in touch,email";
37
-$page->meta_description = "Contact us at ".$page->settings->getSetting('title')." and submit your feedback";
37
+$page->meta_description = "Contact us at " . $page->settings->getSetting('title') . " and submit your feedback";
38 38
 
39 39
 $page->content = $page->smarty->fetch('contact.tpl');
40 40
 
Please login to merge, or discard this patch.
www/pages/profile.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 if (!$privateProfiles || $privileged) {
20 20
 
21
-	$altID = (isset($_GET['id']) && $_GET['id'] >= 0) ? (int) $_GET['id'] : false;
21
+	$altID = (isset($_GET['id']) && $_GET['id'] >= 0) ? (int)$_GET['id'] : false;
22 22
 	$altUsername = (isset($_GET['name']) && strlen($_GET['name']) > 0) ? $_GET['name'] : false;
23 23
 
24 24
 	// If both 'id' and 'name' are specified, 'id' should take precedence.
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 }
36 36
 
37 37
 $downloadlist = $page->users->getDownloadRequestsForUser($userID);
38
-$page->smarty->assign('downloadlist',$downloadlist);
38
+$page->smarty->assign('downloadlist', $downloadlist);
39 39
 
40 40
 $data = $page->users->getById($userID);
41 41
 if (!$data)
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	$data['style'] = 'Using the admin selected theme.';
47 47
 }
48 48
 
49
-$offset       = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0;
49
+$offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0;
50 50
 $page->smarty->assign([
51 51
 		'apirequests'       => $page->users->getApiRequests($userID),
52 52
 		'grabstoday'        => $page->users->getDownloadRequests($userID),
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,9 @@  discard block
 block discarded – undo
4 4
 use nntmux\SABnzbd;
5 5
 use nntmux\NZBGet;
6 6
 
7
-if (!$page->users->isLoggedIn())
7
+if (!$page->users->isLoggedIn()) {
8 8
 	$page->show403();
9
+}
9 10
 
10 11
 $rc = new ReleaseComments;
11 12
 $sab = new SABnzbd($page);
@@ -38,8 +39,9 @@  discard block
 block discarded – undo
38 39
 $page->smarty->assign('downloadlist',$downloadlist);
39 40
 
40 41
 $data = $page->users->getById($userID);
41
-if (!$data)
42
+if (!$data) {
42 43
 	$page->show404();
44
+}
43 45
 
44 46
 // Check if the user selected a theme.
45 47
 if (!isset($data['style']) || $data['style'] == 'None') {
Please login to merge, or discard this patch.
www/pages/forum.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 			$page->show403();
15 15
 
16 16
 		$forum->add(0, $page->users->currentUserId(), $_POST["addSubject"], $_POST["addMessage"]);
17
-		header("Location:".WWW_TOP."/forum");
17
+		header("Location:" . WWW_TOP . "/forum");
18 18
 		die();
19 19
 }
20 20
 $browsecount = $forum->getBrowseCount();
@@ -24,16 +24,16 @@  discard block
 block discarded – undo
24 24
 $results = array();
25 25
 $results = $forum->getBrowseRange($offset, ITEMS_PER_PAGE);
26 26
 
27
-$page->smarty->assign('pagertotalitems',$browsecount);
28
-$page->smarty->assign('pageroffset',$offset);
29
-$page->smarty->assign('pageritemsperpage',ITEMS_PER_PAGE);
30
-$page->smarty->assign('pagerquerybase', WWW_TOP."/forum?offset=");
27
+$page->smarty->assign('pagertotalitems', $browsecount);
28
+$page->smarty->assign('pageroffset', $offset);
29
+$page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
30
+$page->smarty->assign('pagerquerybase', WWW_TOP . "/forum?offset=");
31 31
 $page->smarty->assign('pagerquerysuffix', "#results");
32
-$page->smarty->assign('privateprofiles', ($page->settings->getSetting('privateprofiles') == 1) ? true : false );
32
+$page->smarty->assign('privateprofiles', ($page->settings->getSetting('privateprofiles') == 1) ? true : false);
33 33
 
34 34
 $pager = $page->smarty->fetch("pager.tpl");
35 35
 $page->smarty->assign('pager', $pager);
36
-$page->smarty->assign('results',$results);
36
+$page->smarty->assign('results', $results);
37 37
 
38 38
 $page->meta_title = "Forum";
39 39
 $page->meta_keywords = "forum,chat,posts";
Please login to merge, or discard this patch.
Braces   +9 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,15 +3,17 @@
 block discarded – undo
3 3
 
4 4
 $forum = new Forum;
5 5
 
6
-if (!$page->users->isLoggedIn())
6
+if (!$page->users->isLoggedIn()) {
7 7
 	$page->show403();
8
+}
8 9
 
9
-if ($page->isPostBack())
10
-{
11
-		if (!isset($_POST["addSubject"]) || empty($_POST["addSubject"]))
12
-			$page->show403();
13
-		if (!isset($_POST["addMessage"]) || empty($_POST["addMessage"]))
14
-			$page->show403();
10
+if ($page->isPostBack()) {
11
+		if (!isset($_POST["addSubject"]) || empty($_POST["addSubject"])) {
12
+					$page->show403();
13
+		}
14
+		if (!isset($_POST["addMessage"]) || empty($_POST["addMessage"])) {
15
+					$page->show403();
16
+		}
15 17
 
16 18
 		$forum->add(0, $page->users->currentUserId(), $_POST["addSubject"], $_POST["addMessage"]);
17 19
 		header("Location:".WWW_TOP."/forum");
Please login to merge, or discard this patch.
www/pages/filelist.php 1 patch
Braces   +16 added lines, -14 removed lines patch added patch discarded remove patch
@@ -6,19 +6,21 @@  discard block
 block discarded – undo
6 6
 $releases = new Releases;
7 7
 $nzb = new NZB;
8 8
 
9
-if (!$page->users->isLoggedIn())
9
+if (!$page->users->isLoggedIn()) {
10 10
 	$page->show403();
11
+}
11 12
 
12
-if (isset($_GET["id"]))
13
-{
13
+if (isset($_GET["id"])) {
14 14
 	$rel = $releases->getByGuid($_GET["id"]);
15
-	if (!$rel)
16
-		$page->show404();
15
+	if (!$rel) {
16
+			$page->show404();
17
+	}
17 18
 
18 19
 	$nzbpath = $nzb->NZBPath($_GET["id"]);
19 20
 
20
-	if (!file_exists($nzbpath))
21
-		$page->show404();
21
+	if (!file_exists($nzbpath)) {
22
+			$page->show404();
23
+	}
22 24
 
23 25
 	ob_start();
24 26
 	@readgzfile($nzbpath);
@@ -36,17 +38,17 @@  discard block
 block discarded – undo
36 38
 	$page->meta_description = "View Nzb File List";
37 39
 
38 40
 	$modal = false;
39
-	if (isset($_GET['modal']))
40
-	{
41
+	if (isset($_GET['modal'])) {
41 42
 		$modal = true;
42 43
 		$page->smarty->assign('modal', true);
43 44
 	}
44 45
 
45 46
 	$page->content = $page->smarty->fetch('viewfilelist.tpl');
46 47
 
47
-	if ($modal)
48
-		echo $page->content;
49
-	else
50
-		$page->render();
51
-}
48
+	if ($modal) {
49
+			echo $page->content;
50
+	} else {
51
+			$page->render();
52
+	}
53
+	}
52 54
 
Please login to merge, or discard this patch.
www/pages/nzbvortex.php 2 patches
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -1,87 +1,87 @@
 block discarded – undo
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';
Please login to merge, or discard this patch.
Braces   +15 added lines, -28 removed lines patch added patch discarded remove patch
@@ -1,18 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!$page->users->isLoggedIn())
3
+if (!$page->users->isLoggedIn()) {
4 4
     $page->show403();
5
+}
5 6
 use nntmux\NZBVortex;
6 7
 
7
-try
8
-{
9
-    if (isset($_GET['isAjax']))
10
-    {
8
+try {
9
+    if (isset($_GET['isAjax'])) {
11 10
         $vortex = new NZBVortex;
12 11
 
13 12
         // I guess we Ajax this way.
14
-        if (isset($_GET['getOverview']))
15
-        {
13
+        if (isset($_GET['getOverview'])) {
16 14
             $overview = $vortex->getOverview();
17 15
             $page->smarty->assign('overview', $overview);
18 16
             $content = $page->smarty->fetch('nzbvortex-ajax.tpl');
@@ -20,65 +18,54 @@  discard block
 block discarded – undo
20 18
             exit;
21 19
         }
22 20
 
23
-        if (isset($_GET['addQueue']))
24
-        {
21
+        if (isset($_GET['addQueue'])) {
25 22
             $nzb = $_GET['addQueue'];
26 23
             $vortex->addQueue($nzb);
27 24
             exit;
28 25
         }
29 26
 
30
-        if (isset($_GET['resume']))
31
-        {
27
+        if (isset($_GET['resume'])) {
32 28
             $vortex->resume((int)$_GET['resume']);
33 29
             exit;
34 30
         }
35 31
 
36
-        if (isset($_GET['pause']))
37
-        {
32
+        if (isset($_GET['pause'])) {
38 33
             $vortex->pause((int)$_GET['pause']);
39 34
             exit;
40 35
         }
41 36
 
42
-        if (isset($_GET['moveup']))
43
-        {
37
+        if (isset($_GET['moveup'])) {
44 38
             $vortex->moveUp((int)$_GET['moveup']);
45 39
             exit;
46 40
         }
47 41
 
48
-        if (isset($_GET['movedown']))
49
-        {
42
+        if (isset($_GET['movedown'])) {
50 43
             $vortex->moveDown((int)$_GET['movedown']);
51 44
             exit;
52 45
         }
53 46
 
54
-        if (isset($_GET['movetop']))
55
-        {
47
+        if (isset($_GET['movetop'])) {
56 48
             $vortex->moveTop((int)$_GET['movetop']);
57 49
             exit;
58 50
         }
59 51
 
60
-        if (isset($_GET['movebottom']))
61
-        {
52
+        if (isset($_GET['movebottom'])) {
62 53
             $vortex->moveBottom((int)$_GET['movebottom']);
63 54
             exit;
64 55
         }
65 56
 
66
-        if (isset($_GET['delete']))
67
-        {
57
+        if (isset($_GET['delete'])) {
68 58
             $vortex->delete((int)$_GET['delete']);
69 59
             exit;
70 60
         }
71 61
 
72
-        if (isset($_GET['filelist']))
73
-        {
62
+        if (isset($_GET['filelist'])) {
74 63
             $response = $vortex->getFilelist((int)$_GET['filelist']);
75 64
             echo json_encode($response);
76 65
             exit;
77 66
         }
78 67
     }
79
-}
80
-catch (Exception $e)
81
-{
68
+} catch (Exception $e) {
82 69
     header('HTTP/1.1 500 Internal Server Error');
83 70
     printf($e->getMessage());
84 71
     exit;
Please login to merge, or discard this patch.
www/pages/consolemodal.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 
15 15
 	$page->smarty->assign('console', $con);
16 16
 
17
-	$page->title = "Info for ".$con['title'];
17
+	$page->title = "Info for " . $con['title'];
18 18
 	$page->meta_title = "";
19 19
 	$page->meta_keywords = "";
20 20
 	$page->meta_description = "";
Please login to merge, or discard this patch.
Braces   +13 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,16 +1,17 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!$page->users->isLoggedIn())
3
+if (!$page->users->isLoggedIn()) {
4 4
 	$page->show403();
5
+}
5 6
 
6 7
 use nntmux\Console;
7 8
 
8
-if (isset($_GET["id"]) && ctype_digit($_GET["id"]))
9
-{
9
+if (isset($_GET["id"]) && ctype_digit($_GET["id"])) {
10 10
 	$console = new Console(['Settings' => $page->settings]);
11 11
 	$con = $console->getConsoleInfo($_GET['id']);
12
-	if (!$con)
13
-		$page->show404();
12
+	if (!$con) {
13
+			$page->show404();
14
+	}
14 15
 
15 16
 	$page->smarty->assign('console', $con);
16 17
 
@@ -21,16 +22,16 @@  discard block
 block discarded – undo
21 22
 	$page->smarty->registerPlugin('modifier', 'ss', 'stripslashes');
22 23
 
23 24
 	$modal = false;
24
-	if (isset($_GET['modal']))
25
-	{
25
+	if (isset($_GET['modal'])) {
26 26
 		$modal = true;
27 27
 		$page->smarty->assign('modal', true);
28 28
 	}
29 29
 
30 30
 	$page->content = $page->smarty->fetch('viewconsole.tpl');
31 31
 
32
-	if ($modal)
33
-		echo $page->content;
34
-	else
35
-		$page->render();
36
-}
32
+	if ($modal) {
33
+			echo $page->content;
34
+	} else {
35
+			$page->render();
36
+	}
37
+	}
Please login to merge, or discard this patch.
www/pages/movietrailer.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 
17 17
 	$page->smarty->assign('movie', $mov);
18 18
 
19
-	$page->title = "Info for ".$mov['title'];
19
+	$page->title = "Info for " . $mov['title'];
20 20
 	$page->meta_title = "";
21 21
 	$page->meta_keywords = "";
22 22
 	$page->meta_description = "";
Please login to merge, or discard this patch.
Braces   +13 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,15 +4,16 @@  discard block
 block discarded – undo
4 4
 
5 5
 $movie = new Movie;
6 6
 
7
-if (!$page->users->isLoggedIn())
7
+if (!$page->users->isLoggedIn()) {
8 8
 	$page->show403();
9
+}
9 10
 
10
-if (isset($_GET["id"]) && ctype_digit($_GET["id"]))
11
-{
11
+if (isset($_GET["id"]) && ctype_digit($_GET["id"])) {
12 12
 	$mov = $movie->getMovieInfo($_GET['id']);
13 13
 
14
-	if (!$mov)
15
-		$page->show404();
14
+	if (!$mov) {
15
+			$page->show404();
16
+	}
16 17
 
17 18
 	$page->smarty->assign('movie', $mov);
18 19
 
@@ -23,17 +24,17 @@  discard block
 block discarded – undo
23 24
 	$page->smarty->registerPlugin('modifier', 'ss', 'stripslashes');
24 25
 
25 26
 	$modal = false;
26
-	if (isset($_GET['modal']))
27
-	{
27
+	if (isset($_GET['modal'])) {
28 28
 		$modal = true;
29 29
 		$page->smarty->assign('modal', true);
30 30
 	}
31 31
 
32 32
 	$page->content = $page->smarty->fetch('viewmovietrailer.tpl');
33 33
 
34
-	if ($modal)
35
-		echo $page->content;
36
-	else
37
-		$page->render();
38
-}
34
+	if ($modal) {
35
+			echo $page->content;
36
+	} else {
37
+			$page->render();
38
+	}
39
+	}
39 40
 
Please login to merge, or discard this patch.
www/pages/forgottenpassword.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 $captcha = new Captcha($page);
13 13
 $email = $sent = $confirmed = '';
14 14
 
15
-switch($action) {
15
+switch ($action) {
16 16
 	case "reset":
17 17
 		if (!isset($_REQUEST['guid'])) {
18 18
 			$page->smarty->assign('error', "No reset code provided.");
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
 			$to = $ret["email"];
35 35
 			$subject = $page->settings->getSetting('title') . " Password Reset";
36 36
 			$contents = "Your password has been reset to " . $newpass;
37
-			$onscreen = "Your password has been reset to <strong>" . $newpass ."</strong> and sent to your e-mail address.";
37
+			$onscreen = "Your password has been reset to <strong>" . $newpass . "</strong> and sent to your e-mail address.";
38 38
 			Utility::sendEmail($to, $subject, $contents, $page->settings->getSetting('email'));
39
-			$page->smarty->assign('notice',  $onscreen);
39
+			$page->smarty->assign('notice', $onscreen);
40 40
 			$confirmed = "true";
41 41
 			break;
42 42
 		}
Please login to merge, or discard this patch.