Passed
Branch dev (a25f63)
by Darko
15:17
created
www/admin/ajax_sharing_settings.php 1 patch
Braces   +9 added lines, -27 removed lines patch added patch discarded remove patch
@@ -18,74 +18,56 @@
 block discarded – undo
18 18
 	} else {
19 19
 		print 'Deactivated site ' . $_GET['site_ID'];
20 20
 	}
21
-}
22
-
23
-else if (isset($_GET['enabled_status'])) {
21
+} else if (isset($_GET['enabled_status'])) {
24 22
 	$db->queryExec(sprintf('UPDATE sharing SET enabled = %d', $_GET['enabled_status']));
25 23
 	if ($_GET['enabled_status'] == 1) {
26 24
 		print 'Enabled sharing!';
27 25
 	} else {
28 26
 		print 'Disabled sharing!';
29 27
 	}
30
-}
31
-
32
-else if (isset($_GET['posting_status'])) {
28
+} else if (isset($_GET['posting_status'])) {
33 29
 	$db->queryExec(sprintf('UPDATE sharing SET posting = %d', $_GET['posting_status']));
34 30
 	if ($_GET['posting_status'] == 1) {
35 31
 		print 'Enabled posting!';
36 32
 	} else {
37 33
 		print 'Disabled posting!';
38 34
 	}
39
-}
40
-
41
-else if (isset($_GET['fetching_status'])) {
35
+} else if (isset($_GET['fetching_status'])) {
42 36
 	$db->queryExec(sprintf('UPDATE sharing SET fetching = %d', $_GET['fetching_status']));
43 37
 	if ($_GET['fetching_status'] == 1) {
44 38
 		print 'Enabled fetching!';
45 39
 	} else {
46 40
 		print 'Disabled fetching!';
47 41
 	}
48
-}
49
-
50
-else if (isset($_GET['auto_status'])) {
42
+} else if (isset($_GET['auto_status'])) {
51 43
 	$db->queryExec(sprintf('UPDATE sharing SET auto_enable = %d', $_GET['auto_status']));
52 44
 	if ($_GET['auto_status'] == 1) {
53 45
 		print 'Enabled automatic site enabling!';
54 46
 	} else {
55 47
 		print 'Disabled automatic site enabling!';
56 48
 	}
57
-}
58
-
59
-else if (isset($_GET['hide_status'])) {
49
+} else if (isset($_GET['hide_status'])) {
60 50
 	$db->queryExec(sprintf('UPDATE sharing SET hide_users = %d', $_GET['hide_status']));
61 51
 	if ($_GET['hide_status'] == 1) {
62 52
 		print 'Enabled hiding of user names!';
63 53
 	} else {
64 54
 		print 'Disabled hiding of user names!';
65 55
 	}
66
-}
67
-
68
-else if (isset($_GET['start_position'])) {
56
+} else if (isset($_GET['start_position'])) {
69 57
 	$db->queryExec(sprintf('UPDATE sharing SET start_position = %d', $_GET['start_position']));
70 58
 	if ($_GET['start_position'] == 1) {
71 59
 		print 'Enabled fetching from start of group!';
72 60
 	} else {
73 61
 		print 'Disabled fetching from start of group!';
74 62
 	}
75
-}
76
-
77
-else if (isset($_GET['toggle_all'])) {
63
+} else if (isset($_GET['toggle_all'])) {
78 64
 	$db->queryExec(sprintf('UPDATE sharing_sites SET enabled = %d', $_GET['toggle_all']));
79
-}
80
-
81
-else if (isset($_GET['reset_settings'])) {
65
+} else if (isset($_GET['reset_settings'])) {
82 66
 	$guid = $db->queryOneRow('SELECT site_guid FROM sharing');
83 67
 	$guid = ($guid === false ? '' : $guid['site_guid']);
84 68
 	(new Sharing(['Settings' => $admin->settings]))->initSettings($guid);
85 69
 	print 'Re-initiated sharing settings!';
86
-}
87
-
88
-else if (isset($_GET['purge_site'])) {
70
+} else if (isset($_GET['purge_site'])) {
89 71
 	$guid = $db->queryOneRow(sprintf('SELECT site_guid FROM sharing_sites WHERE id = %d', $_GET['purge_site']));
90 72
 	if ($guid === false) {
91 73
 		print 'Error purging site ' . $_GET['purge_site'] . '!';
Please login to merge, or discard this patch.
www/admin/group-list-active.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,19 +17,19 @@
 block discarded – undo
17 17
 $offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0;
18 18
 $groupname = (isset($_REQUEST['groupname']) && !empty($_REQUEST['groupname'])) ? $_REQUEST['groupname'] : '';
19 19
 
20
-$page->smarty->assign('groupname',$groupname);
21
-$page->smarty->assign('pagertotalitems',$groupcount);
22
-$page->smarty->assign('pageroffset',$offset);
23
-$page->smarty->assign('pageritemsperpage',ITEMS_PER_PAGE);
20
+$page->smarty->assign('groupname', $groupname);
21
+$page->smarty->assign('pagertotalitems', $groupcount);
22
+$page->smarty->assign('pageroffset', $offset);
23
+$page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
24 24
 
25
-$groupsearch = ($gname != "") ? 'groupname='.$gname.'&' : '';
26
-$page->smarty->assign('pagerquerybase', WWW_TOP."/group-list-active.php?".$groupsearch."offset=");
25
+$groupsearch = ($gname != "") ? 'groupname=' . $gname . '&' : '';
26
+$page->smarty->assign('pagerquerybase', WWW_TOP . "/group-list-active.php?" . $groupsearch . "offset=");
27 27
 $pager = $page->smarty->fetch("pager.tpl");
28 28
 $page->smarty->assign('pager', $pager);
29 29
 
30 30
 $grouplist = $groups->getRange($offset, ITEMS_PER_PAGE, $gname, 1);
31 31
 
32
-$page->smarty->assign('grouplist',$grouplist);
32
+$page->smarty->assign('grouplist', $grouplist);
33 33
 
34 34
 $page->title = "Group List";
35 35
 
Please login to merge, or discard this patch.
www/admin/release-files.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,20 +21,20 @@
 block discarded – undo
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";
Please login to merge, or discard this patch.
Braces   +9 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,19 +12,21 @@
 block discarded – undo
12 12
 $releases = new Releases;
13 13
 $nzb = new NZB;
14 14
 
15
-if (!$users->isLoggedIn())
15
+if (!$users->isLoggedIn()) {
16 16
 	$page->show403();
17
+}
17 18
 
18
-if (isset($_GET["id"]))
19
-{
19
+if (isset($_GET["id"])) {
20 20
 	$rel = $releases->getByGuid($_GET["id"]);
21
-	if (!$rel)
22
-		$page->show404();
21
+	if (!$rel) {
22
+			$page->show404();
23
+	}
23 24
 
24 25
     $nzbpath = $nzb->getNZBPath($_GET["id"], $page->settings->getSetting('nzbpath'));
25 26
 
26
-    if (!file_exists($nzbpath))
27
-        $page->show404();
27
+    if (!file_exists($nzbpath)) {
28
+            $page->show404();
29
+    }
28 30
 
29 31
     ob_start();
30 32
     @readgzfile($nzbpath);
Please login to merge, or discard this patch.
www/admin/movie-add.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@
 block discarded – undo
17 17
 	$movCheck = $movie->getMovieInfo($id);
18 18
 	if (!$movCheck || (isset($_REQUEST['update']) && $_REQUEST['update'] == 1))
19 19
 	{
20
-		if($movie->updateMovieInfo($id)) {
21
-			header("Location:".WWW_TOP."/movie-list.php");
20
+		if ($movie->updateMovieInfo($id)) {
21
+			header("Location:" . WWW_TOP . "/movie-list.php");
22 22
 			die();
23 23
 		}
24 24
 	}
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@
 block discarded – undo
15 15
 	$id = $_REQUEST['id'];
16 16
 
17 17
 	$movCheck = $movie->getMovieInfo($id);
18
-	if (!$movCheck || (isset($_REQUEST['update']) && $_REQUEST['update'] == 1))
19
-	{
18
+	if (!$movCheck || (isset($_REQUEST['update']) && $_REQUEST['update'] == 1)) {
20 19
 		if($movie->updateMovieInfo($id)) {
21 20
 			header("Location:".WWW_TOP."/movie-list.php");
22 21
 			die();
Please login to merge, or discard this patch.
www/admin/group-bulk.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 // set the current action
11 11
 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';
12 12
 
13
-switch($action)
13
+switch ($action)
14 14
 {
15 15
 	case 'submit':
16 16
 		if (isset($_POST['groupfilter']) && !empty($_POST['groupfilter'])) {
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
 		break;
24 24
 }
25 25
 
26
-$page->smarty->assign('groupmsglist',$msgs);
27
-$page->smarty->assign('yesno_ids', array(1,0));
28
-$page->smarty->assign('yesno_names', array( 'Yes', 'No'));
26
+$page->smarty->assign('groupmsglist', $msgs);
27
+$page->smarty->assign('yesno_ids', array(1, 0));
28
+$page->smarty->assign('yesno_names', array('Yes', 'No'));
29 29
 
30 30
 $page->title = "Bulk Add Newsgroups";
31 31
 $page->content = $page->smarty->fetch('group-bulk.tpl');
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,7 @@
 block discarded – undo
10 10
 // set the current action
11 11
 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';
12 12
 
13
-switch($action)
14
-{
13
+switch($action) {
15 14
 	case 'submit':
16 15
 		if (isset($_POST['groupfilter']) && !empty($_POST['groupfilter'])) {
17 16
 			$groups = new Groups;
Please login to merge, or discard this patch.
www/admin/console-edit.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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));
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,16 +23,16 @@  discard block
 block discarded – undo
23 23
 		$page->show404();
24 24
 	}
25 25
 
26
-	switch($action)
26
+	switch ($action)
27 27
 	{
28 28
 	    case 'submit':
29
-	    	$coverLoc = WWW_DIR."covers/console/".$id.'.jpg';
29
+	    	$coverLoc = WWW_DIR . "covers/console/" . $id . '.jpg';
30 30
 
31
-			if($_FILES['cover']['size'] > 0)
31
+			if ($_FILES['cover']['size'] > 0)
32 32
 			{
33 33
 				$tmpName = $_FILES['cover']['tmp_name'];
34 34
 				$file_info = getimagesize($tmpName);
35
-				if(!empty($file_info))
35
+				if (!empty($file_info))
36 36
 				{
37 37
 					move_uploaded_file($_FILES['cover']['tmp_name'], $coverLoc);
38 38
 				}
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
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
-			header("Location:".WWW_TOP."/console-list.php");
47
+			header("Location:" . WWW_TOP . "/console-list.php");
48 48
 	        die();
49 49
 	    break;
50 50
 	    case 'view':
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,8 +14,7 @@  discard block
 block discarded – undo
14 14
 // set the current action
15 15
 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';
16 16
 
17
-if (isset($_REQUEST["id"]))
18
-{
17
+if (isset($_REQUEST["id"])) {
19 18
 	$id = $_REQUEST["id"];
20 19
 	$con = $console->getConsoleInfo($id);
21 20
 
@@ -23,17 +22,14 @@  discard block
 block discarded – undo
23 22
 		$page->show404();
24 23
 	}
25 24
 
26
-	switch($action)
27
-	{
25
+	switch($action) {
28 26
 	    case 'submit':
29 27
 	    	$coverLoc = WWW_DIR."covers/console/".$id.'.jpg';
30 28
 
31
-			if($_FILES['cover']['size'] > 0)
32
-			{
29
+			if($_FILES['cover']['size'] > 0) {
33 30
 				$tmpName = $_FILES['cover']['tmp_name'];
34 31
 				$file_info = getimagesize($tmpName);
35
-				if(!empty($file_info))
36
-				{
32
+				if(!empty($file_info)) {
37 33
 					move_uploaded_file($_FILES['cover']['tmp_name'], $coverLoc);
38 34
 				}
39 35
 			}
Please login to merge, or discard this patch.
www/admin/game-list.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,16 +12,16 @@
 block discarded – undo
12 12
 $gamecount = $game->getCount();
13 13
 
14 14
 $offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0;
15
-$page->smarty->assign('pagertotalitems',$gamecount);
16
-$page->smarty->assign('pageroffset',$offset);
17
-$page->smarty->assign('pageritemsperpage',ITEMS_PER_PAGE);
18
-$page->smarty->assign('pagerquerybase', WWW_TOP."/game-list.php?offset=");
15
+$page->smarty->assign('pagertotalitems', $gamecount);
16
+$page->smarty->assign('pageroffset', $offset);
17
+$page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
18
+$page->smarty->assign('pagerquerybase', WWW_TOP . "/game-list.php?offset=");
19 19
 $pager = $page->smarty->fetch("pager.tpl");
20 20
 $page->smarty->assign('pager', $pager);
21 21
 
22 22
 $gamelist = $game->getRange($offset, ITEMS_PER_PAGE);
23 23
 
24
-$page->smarty->assign('gamelist',$gamelist);
24
+$page->smarty->assign('gamelist', $gamelist);
25 25
 
26 26
 $page->content = $page->smarty->fetch('game-list.tpl');
27 27
 $page->render();
Please login to merge, or discard this patch.
www/admin/ajax_welcome_msg.php 1 patch
Braces   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@
 block discarded – undo
8 8
 $admin = new AdminPage;
9 9
 $s = new Sites();
10 10
 
11
-if (isset($_GET['action']))
12
-{
13
-	if ($_GET['action'] == "1")
14
-		$s->updateItem("showadminwelcome", 1);
15
-	else
16
-		$s->updateItem("showadminwelcome", 0);
17
-}
11
+if (isset($_GET['action'])) {
12
+	if ($_GET['action'] == "1") {
13
+			$s->updateItem("showadminwelcome", 1);
14
+	} else {
15
+			$s->updateItem("showadminwelcome", 0);
16
+	}
17
+	}
18 18
 
Please login to merge, or discard this patch.
www/admin/content-delete.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,7 @@
 block discarded – undo
7 7
 
8 8
 $page = new AdminPage();
9 9
 
10
-if (isset($_GET['id']))
11
-{
10
+if (isset($_GET['id'])) {
12 11
 	$contents = new Contents();
13 12
 	$contents->delete($_GET['id']);
14 13
 }
Please login to merge, or discard this patch.