Passed
Push — dev ( 8c58d8...9b6cb9 )
by Darko
09:10
created
www/admin/book-list.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,16 +14,16 @@
 block discarded – undo
14 14
 $concount = $book->getCount();
15 15
 
16 16
 $offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0;
17
-$page->smarty->assign('pagertotalitems',$concount);
18
-$page->smarty->assign('pageroffset',$offset);
19
-$page->smarty->assign('pageritemsperpage',ITEMS_PER_PAGE);
20
-$page->smarty->assign('pagerquerybase', WWW_TOP."/book-list.php?offset=");
17
+$page->smarty->assign('pagertotalitems', $concount);
18
+$page->smarty->assign('pageroffset', $offset);
19
+$page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
20
+$page->smarty->assign('pagerquerybase', WWW_TOP . "/book-list.php?offset=");
21 21
 $pager = $page->smarty->fetch("pager.tpl");
22 22
 $page->smarty->assign('pager', $pager);
23 23
 
24 24
 $booklist = $book->getRange($offset, ITEMS_PER_PAGE);
25 25
 
26
-$page->smarty->assign('booklist',$booklist);
26
+$page->smarty->assign('booklist', $booklist);
27 27
 
28 28
 $page->content = $page->smarty->fetch('book-list.tpl');
29 29
 $page->render();
Please login to merge, or discard this patch.
www/admin/ajax_regex.php 3 patches
Switch Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -13,15 +13,15 @@
 block discarded – undo
13 13
 }
14 14
 
15 15
 switch($_GET['action']) {
16
-	case 1:
17
-		$id = (int) $_GET['col_id'];
18
-		(new Regexes(['Settings' => $admin->settings]))->deleteRegex($id);
19
-		print "Regex $id deleted.";
20
-		break;
16
+		case 1:
17
+			$id = (int) $_GET['col_id'];
18
+			(new Regexes(['Settings' => $admin->settings]))->deleteRegex($id);
19
+			print "Regex $id deleted.";
20
+			break;
21 21
 
22
-	case 2:
23
-		$id = (int) $_GET['bin_id'];
24
-		(new Binaries(['Settings' => $admin->settings]))->deleteBlacklist($id);
25
-		print "Blacklist $id deleted.";
26
-		break;
22
+		case 2:
23
+			$id = (int) $_GET['bin_id'];
24
+			(new Binaries(['Settings' => $admin->settings]))->deleteBlacklist($id);
25
+			print "Blacklist $id deleted.";
26
+			break;
27 27
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@
 block discarded – undo
12 12
 	exit();
13 13
 }
14 14
 
15
-switch($_GET['action']) {
15
+switch ($_GET['action']) {
16 16
 	case 1:
17
-		$id = (int) $_GET['col_id'];
17
+		$id = (int)$_GET['col_id'];
18 18
 		(new Regexes(['Settings' => $admin->settings]))->deleteRegex($id);
19 19
 		print "Regex $id deleted.";
20 20
 		break;
21 21
 
22 22
 	case 2:
23
-		$id = (int) $_GET['bin_id'];
23
+		$id = (int)$_GET['bin_id'];
24 24
 		(new Binaries(['Settings' => $admin->settings]))->deleteBlacklist($id);
25 25
 		print "Blacklist $id deleted.";
26 26
 		break;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@
 block discarded – undo
16 16
 	case 1:
17 17
 		$id = (int) $_GET['col_id'];
18 18
 		(new Regexes(['Settings' => $admin->settings]))->deleteRegex($id);
19
-		print "Regex $id deleted.";
19
+		print "regex $id deleted.";
20 20
 		break;
21 21
 
22 22
 	case 2:
23 23
 		$id = (int) $_GET['bin_id'];
24 24
 		(new Binaries(['Settings' => $admin->settings]))->deleteBlacklist($id);
25
-		print "Blacklist $id deleted.";
25
+		print "blacklist $id deleted.";
26 26
 		break;
27 27
 }
Please login to merge, or discard this patch.
www/admin/category-list.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 $page->title = "Category List";
13 13
 
14 14
 $categorylist = $category->getFlat();
15
-$page->smarty->assign('categorylist',$categorylist);
15
+$page->smarty->assign('categorylist', $categorylist);
16 16
 
17 17
 $page->content = $page->smarty->fetch('category-list.tpl');
18 18
 $page->render();
Please login to merge, or discard this patch.
www/admin/category-edit.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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));
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,12 +12,12 @@  discard block
 block discarded – undo
12 12
 // set the current action
13 13
 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';
14 14
 
15
-switch($action)
15
+switch ($action)
16 16
 {
17 17
     case 'submit':
18 18
 		$ret = $category->update($_POST["id"], $_POST["status"], $_POST["description"],
19 19
 			$_POST["disablepreview"], $_POST["minsizetoformrelease"], $_POST["maxsizetoformrelease"]);
20
-		header("Location:".WWW_TOP."/category-list.php");
20
+		header("Location:" . WWW_TOP . "/category-list.php");
21 21
 		break;
22 22
     case 'view':
23 23
     default:
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
       break;
36 36
 }
37 37
 
38
-$page->smarty->assign('status_ids', array(Category::STATUS_ACTIVE,Category::STATUS_INACTIVE));
39
-$page->smarty->assign('status_names', array( 'Yes', 'No'));
38
+$page->smarty->assign('status_ids', array(Category::STATUS_ACTIVE, Category::STATUS_INACTIVE));
39
+$page->smarty->assign('status_names', array('Yes', 'No'));
40 40
 
41 41
 $page->content = $page->smarty->fetch('category-edit.tpl');
42 42
 $page->render();
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@  discard block
 block discarded – undo
12 12
 // set the current action
13 13
 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';
14 14
 
15
-switch($action)
16
-{
15
+switch($action) {
17 16
     case 'submit':
18 17
 		$ret = $category->update($_POST["id"], $_POST["status"], $_POST["description"],
19 18
 			$_POST["disablepreview"], $_POST["minsizetoformrelease"], $_POST["maxsizetoformrelease"]);
@@ -22,8 +21,7 @@  discard block
 block discarded – undo
22 21
     case 'view':
23 22
     default:
24 23
 
25
-			if (isset($_GET["id"]))
26
-			{
24
+			if (isset($_GET["id"])) {
27 25
 				$page->title = "Category Edit";
28 26
 				$id = $_GET["id"];
29 27
 
Please login to merge, or discard this patch.
www/admin/group-list-inactive.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-inactive.php?".$groupsearch."offset=");
25
+$groupsearch = ($gname != "") ? 'groupname=' . $gname . '&' : '';
26
+$page->smarty->assign('pagerquerybase', WWW_TOP . "/group-list-inactive.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, 0);
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/music-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/music/".$id.'.jpg';
28
+		case 'submit':
29
+			$coverLoc = WWW_DIR."covers/music/".$id.'.jpg';
30 30
 
31 31
 			if($_FILES['cover']['size'] > 0)
32 32
 			{
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
 			$music->update($id, $_POST["title"], $_POST['asin'], $_POST['url'], $_POST["salesrank"], $_POST["artist"], $_POST["publisher"], $_POST["releasedate"], $_POST["year"], $_POST["tracks"], $_POST["cover"], $_POST["genre"]);
46 46
 
47 47
 			header("Location:".WWW_TOP."/music-list.php");
48
-	        die();
49
-	    break;
50
-	    case 'view':
51
-	    default:
48
+			die();
49
+		break;
50
+		case 'view':
51
+		default:
52 52
 			$page->title = "Music Edit";
53 53
 			$page->smarty->assign('music', $mus);
54 54
 			$page->smarty->assign('genres', $gen->getGenres(Genres::MUSIC_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/music/".$id.'.jpg';
29
+	    	$coverLoc = WWW_DIR . "covers/music/" . $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
 			$music->update($id, $_POST["title"], $_POST['asin'], $_POST['url'], $_POST["salesrank"], $_POST["artist"], $_POST["publisher"], $_POST["releasedate"], $_POST["year"], $_POST["tracks"], $_POST["cover"], $_POST["genre"]);
46 46
 
47
-			header("Location:".WWW_TOP."/music-list.php");
47
+			header("Location:" . WWW_TOP . "/music-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
 	$mus = $music->getMusicInfo($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/music/".$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/release_naming_regexes-edit.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 // Set the current action.
12 12
 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';
13 13
 
14
-switch($action) {
14
+switch ($action) {
15 15
 	case 'submit':
16 16
 		if ($_POST["group_regex"] == "") {
17 17
 			$page->smarty->assign('error', "Group regex must not be empty!");
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 			$regexes->updateRegex($_POST);
39 39
 		}
40 40
 
41
-		header("Location:".WWW_TOP."/release_naming_regexes-list.php");
41
+		header("Location:" . WWW_TOP . "/release_naming_regexes-list.php");
42 42
 		break;
43 43
 
44 44
 	case 'view':
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
 		break;
56 56
 }
57 57
 
58
-$page->smarty->assign('status_ids', array(Category::STATUS_ACTIVE,Category::STATUS_INACTIVE));
59
-$page->smarty->assign('status_names', array( 'Yes', 'No'));
58
+$page->smarty->assign('status_ids', array(Category::STATUS_ACTIVE, Category::STATUS_INACTIVE));
59
+$page->smarty->assign('status_names', array('Yes', 'No'));
60 60
 
61 61
 $page->content = $page->smarty->fetch('release_naming_regexes-edit.tpl');
62 62
 $page->render();
Please login to merge, or discard this patch.
www/admin/ajax_regex-list.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@
 block discarded – undo
6 6
 
7 7
 // login check
8 8
 $admin = new AdminPage;
9
-$regex  = new ReleaseRegex();
9
+$regex = new ReleaseRegex();
10 10
 
11 11
 if (isset($_GET['action']) && $_GET['action'] == "2")
12 12
 {
13
-		$id     = (int)$_GET['regex_id'];
13
+		$id = (int)$_GET['regex_id'];
14 14
 		$regex->delete($id);
15 15
 		print "Regex $id deleted.";
16 16
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,7 @@
 block discarded – undo
8 8
 $admin = new AdminPage;
9 9
 $regex  = new ReleaseRegex();
10 10
 
11
-if (isset($_GET['action']) && $_GET['action'] == "2")
12
-{
11
+if (isset($_GET['action']) && $_GET['action'] == "2") {
13 12
 		$id     = (int)$_GET['regex_id'];
14 13
 		$regex->delete($id);
15 14
 		print "Regex $id deleted.";
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,5 +12,5 @@
 block discarded – undo
12 12
 {
13 13
 		$id     = (int)$_GET['regex_id'];
14 14
 		$regex->delete($id);
15
-		print "Regex $id deleted.";
15
+		print "regex $id deleted.";
16 16
 }
Please login to merge, or discard this patch.
www/admin/forum-delete.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,14 +6,14 @@
 block discarded – undo
6 6
 
7 7
 $page = new AdminPage();
8 8
 
9
-if (isset($_GET['id']))
10
-{
9
+if (isset($_GET['id'])) {
11 10
 	$forum = new Forum();
12 11
 	$forum->deletePost($_GET['id']);
13 12
 }
14 13
 
15
-if (isset($_GET['from']))
14
+if (isset($_GET['from'])) {
16 15
 	$referrer = $_GET['from'];
17
-else
16
+} else {
18 17
 	$referrer = $_SERVER['HTTP_REFERER'];
18
+}
19 19
 header("Location: " . $referrer);
Please login to merge, or discard this patch.