Passed
Push — dev ( 8c58d8...9b6cb9 )
by Darko
09:10
created
www/admin/role-edit.php 2 patches
Switch Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -11,42 +11,42 @@
 block discarded – undo
11 11
 }
12 12
 
13 13
 switch ((isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view')) {
14
-	case 'add':
15
-		$page->title              = "User Roles Add";
16
-		$role = [
17
-			'id'               => '',
18
-			'name'             => '',
19
-			'apirequests'      => '',
20
-			'downloadrequests' => '',
21
-			'defaultinvites'   => '',
22
-			'canpreview'       => 0,
23
-			'hideads'          => 0
24
-		];
25
-		$page->smarty->assign('role', $role);
26
-		break;
14
+		case 'add':
15
+			$page->title              = "User Roles Add";
16
+			$role = [
17
+				'id'               => '',
18
+				'name'             => '',
19
+				'apirequests'      => '',
20
+				'downloadrequests' => '',
21
+				'defaultinvites'   => '',
22
+				'canpreview'       => 0,
23
+				'hideads'          => 0
24
+			];
25
+			$page->smarty->assign('role', $role);
26
+			break;
27 27
 
28
-	case 'submit':
29
-		if ($_POST["id"] == "") {
30
-			$ret = $page->users->addRole($_POST['name'], $_POST['apirequests'], $_POST['downloadrequests'],
31
-				$_POST['defaultinvites'], $_POST['canpreview'], $_POST['hideads']
32
-			);
33
-			header("Location:" . WWW_TOP . "/role-list.php");
34
-		} else {
35
-			$ret = $page->users->updateRole($_POST['id'], $_POST['name'], $_POST['apirequests'],
36
-				$_POST['downloadrequests'], $_POST['defaultinvites'], $_POST['isdefault'], $_POST['canpreview'], $_POST['hideads']
37
-			);
38
-			header("Location:" . WWW_TOP . "/role-list.php");
39
-		}
40
-		break;
28
+		case 'submit':
29
+			if ($_POST["id"] == "") {
30
+				$ret = $page->users->addRole($_POST['name'], $_POST['apirequests'], $_POST['downloadrequests'],
31
+					$_POST['defaultinvites'], $_POST['canpreview'], $_POST['hideads']
32
+				);
33
+				header("Location:" . WWW_TOP . "/role-list.php");
34
+			} else {
35
+				$ret = $page->users->updateRole($_POST['id'], $_POST['name'], $_POST['apirequests'],
36
+					$_POST['downloadrequests'], $_POST['defaultinvites'], $_POST['isdefault'], $_POST['canpreview'], $_POST['hideads']
37
+				);
38
+				header("Location:" . WWW_TOP . "/role-list.php");
39
+			}
40
+			break;
41 41
 
42
-	case 'view':
43
-	default:
44
-		if (isset($_GET["id"])) {
45
-			$page->title = "User Roles Edit";
46
-			$role = $page->users->getRoleById($_GET["id"]);
47
-			$page->smarty->assign('role', $role);
48
-		}
49
-		break;
42
+		case 'view':
43
+		default:
44
+			if (isset($_GET["id"])) {
45
+				$page->title = "User Roles Edit";
46
+				$role = $page->users->getRoleById($_GET["id"]);
47
+				$page->smarty->assign('role', $role);
48
+			}
49
+			break;
50 50
 }
51 51
 
52 52
 $page->smarty->assign('yesno_ids', [1, 0]);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,8 +11,7 @@
 block discarded – undo
11 11
 }
12 12
 
13 13
 switch ((isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view')) {
14
-	case 'add':
15
-		$page->title              = "User Roles Add";
14
+	case 'add' : $page->title = "User Roles Add";
16 15
 		$role = [
17 16
 			'id'               => '',
18 17
 			'name'             => '',
Please login to merge, or discard this patch.
www/admin/spotnab-list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
 // set the current action
13 13
 $toggle = isset($_REQUEST['toggle']) ? $_REQUEST['toggle'] : 'view';
14 14
 
15
-if ( (isset($_GET["toggle"])) && (isset($_GET["id"])) ) {
16
-	$spotnab->toggleSource($_GET["id"],$_GET["toggle"]);
15
+if ((isset($_GET["toggle"])) && (isset($_GET["id"]))) {
16
+	$spotnab->toggleSource($_GET["id"], $_GET["toggle"]);
17 17
 }
18 18
 
19 19
 $page->title = "Spotnab Sources List";
@@ -21,6 +21,6 @@  discard block
 block discarded – undo
21 21
 //get the list of Sources
22 22
 $spotnab = $spotnab->getSources();
23 23
 
24
-$page->smarty->assign('spotnab',$spotnab);
24
+$page->smarty->assign('spotnab', $spotnab);
25 25
 $page->content = $page->smarty->fetch('spotnab-list.tpl');
26 26
 $page->render();
Please login to merge, or discard this patch.
www/admin/view-logs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 
18 18
 $regex = false;
19 19
 
20
-switch($type) {
20
+switch ($type) {
21 21
 	case 'info':
22 22
 		$regex = '/\[INFO\]/';
23 23
 		break;
Please login to merge, or discard this patch.
www/admin/comments-list.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,13 +17,13 @@
 block discarded – undo
17 17
 		'pagertotalitems' => $commentcount,
18 18
 		'pageroffset' => $offset,
19 19
 		'pageritemsperpage' => ITEMS_PER_PAGE,
20
-		'pagerquerybase' => WWW_TOP."/comments-list.php?offset=",
20
+		'pagerquerybase' => WWW_TOP . "/comments-list.php?offset=",
21 21
 		'pagerquerysuffix' => '']);
22 22
 $pager = $page->smarty->fetch("pager.tpl");
23 23
 $page->smarty->assign('pager', $pager);
24 24
 
25 25
 $commentslist = $releases->getCommentsRange($offset, ITEMS_PER_PAGE);
26
-$page->smarty->assign('commentslist',$commentslist);
26
+$page->smarty->assign('commentslist', $commentslist);
27 27
 
28 28
 $page->content = $page->smarty->fetch('comments-list.tpl');
29 29
 $page->render();
Please login to merge, or discard this patch.
www/admin/regex-submit.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 		curl_setopt($ch, CURLOPT_VERBOSE, 0);
26 26
 		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
27 27
 		curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (newznab / compatible;)");
28
-		curl_setopt($ch, CURLOPT_URL,"http://newznab.com/regex/uploadregex.php");
28
+		curl_setopt($ch, CURLOPT_URL, "http://newznab.com/regex/uploadregex.php");
29 29
 		curl_setopt($ch, CURLOPT_POST, true);
30 30
 		$post = array(
31 31
 			"regex" => $regexSerialize
@@ -55,6 +55,6 @@  discard block
 block discarded – undo
55 55
 $page->smarty->assign('regex_filename', $regexFilename);
56 56
 $page->smarty->assign('regex_contents', $regexList);
57 57
 
58
-$page->content  = $page->smarty->fetch('regex-submit.tpl');
58
+$page->content = $page->smarty->fetch('regex-submit.tpl');
59 59
 $page->render();
60 60
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,14 +11,12 @@  discard block
 block discarded – undo
11 11
 $regex = new ReleaseRegex();
12 12
 $regexList = $regex->get(false, -1, true, true);
13 13
 
14
-if (count($regexList))
15
-{
14
+if (count($regexList)) {
16 15
 	$regexSerialize = serialize($regexList);
17 16
 	$regexFilename  = 'releaseregex-' . time() . '.regex';
18 17
 
19 18
 	// User wants to submit their regex's
20
-	if (isset($_POST['regex_submit_please']))
21
-	{
19
+	if (isset($_POST['regex_submit_please'])) {
22 20
 		// Submit
23 21
 		$ch = curl_init();
24 22
 		curl_setopt($ch, CURLOPT_HEADER, 0);
@@ -35,18 +33,13 @@  discard block
 block discarded – undo
35 33
 
36 34
 		curl_close($ch);
37 35
 
38
-		if ($response == 'OK')
39
-		{
36
+		if ($response == 'OK') {
40 37
 			$page->smarty->assign('upload_status', 'OK');
41
-		}
42
-		else
43
-		{
38
+		} else {
44 39
 			$page->smarty->assign('upload_status', 'BAD');
45 40
 		}
46 41
 	}
47
-}
48
-else
49
-{
42
+} else {
50 43
 	$regexFilename = 'No user regexs found. Please add some.';
51 44
 	$regexList = array('Empty');
52 45
 	$page->smarty->assign('regex_error', 1);
Please login to merge, or discard this patch.
www/admin/category_regexes-edit.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +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) {
15
+switch ($action) {
16 16
 	case 'submit':
17 17
 		if ($_POST["group_regex"] == '') {
18 18
 			$page->smarty->assign('error', "Group regex must not be empty!");
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 			$regexes->updateRegex($_POST);
40 40
 		}
41 41
 
42
-		header("Location:".WWW_TOP."/category_regexes-list.php");
42
+		header("Location:" . WWW_TOP . "/category_regexes-list.php");
43 43
 		break;
44 44
 
45 45
 	case 'view':
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 		break;
57 57
 }
58 58
 
59
-$page->smarty->assign('status_ids', [Category::STATUS_ACTIVE,Category::STATUS_INACTIVE]);
59
+$page->smarty->assign('status_ids', [Category::STATUS_ACTIVE, Category::STATUS_INACTIVE]);
60 60
 $page->smarty->assign('status_names', ['Yes', 'No']);
61 61
 
62 62
 $categories_db = $page->settings->queryDirect(
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 );
69 69
 $categories = ['category_names', 'category_ids'];
70 70
 if ($categories_db) {
71
-	foreach($categories_db as $category_db) {
71
+	foreach ($categories_db as $category_db) {
72 72
 		$categories['category_names'][] = $category_db['parent_title'] . ' ' . $category_db['title'] . ': ' . $category_db['id'];
73 73
 		$categories['category_ids'][] = $category_db['id'];
74 74
 	}
Please login to merge, or discard this patch.
www/admin/binaryblacklist-edit.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,7 @@
 block discarded – undo
10 10
 $regex = ['id' => '', 'groupname' => '', 'regex' => '', 'description' => ''];
11 11
 
12 12
 switch ((isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view')) {
13
-	case 'submit':
14
-		if ($_POST["groupname"] == '') {
13
+	case 'submit' : if ($_POST["groupname"] == '') {
15 14
 			$error = "Group must be a valid usenet group";
16 15
 			break;
17 16
 		}
Please login to merge, or discard this patch.
www/admin/preview-list.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 
16 16
 $previewcat="-1";
17 17
 if (isset($_REQUEST["previewcat"]))
18
-    $previewcat = $_REQUEST["previewcat"];
18
+	$previewcat = $_REQUEST["previewcat"];
19 19
 
20 20
 $catarray = [];
21 21
 $catarray[] = $previewcat;
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 $page->title = "Preview List";
15 15
 
16
-$previewcat="-1";
16
+$previewcat = "-1";
17 17
 if (isset($_REQUEST["previewcat"]))
18 18
     $previewcat = $_REQUEST["previewcat"];
19 19
 
@@ -23,19 +23,19 @@  discard block
 block discarded – undo
23 23
 $releasecount = $releases->getPreviewCount($previewtype, $catarray);
24 24
 
25 25
 $offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0;
26
-$page->smarty->assign('pagertotalitems',$releasecount);
27
-$page->smarty->assign('pageroffset',$offset);
28
-$page->smarty->assign('pageritemsperpage',ITEMS_PER_PAGE);
29
-$page->smarty->assign('pagerquerybase', WWW_TOP."/preview-list.php?previewcat=".$previewcat."&offset=");
26
+$page->smarty->assign('pagertotalitems', $releasecount);
27
+$page->smarty->assign('pageroffset', $offset);
28
+$page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
29
+$page->smarty->assign('pagerquerybase', WWW_TOP . "/preview-list.php?previewcat=" . $previewcat . "&offset=");
30 30
 $pager = $page->smarty->fetch("pager.tpl");
31 31
 $page->smarty->assign('pager', $pager);
32 32
 
33 33
 $parentcatlist = $category->getForMenu();
34
-$page->smarty->assign('catlist',$parentcatlist);
35
-$page->smarty->assign('previewcat',$previewcat);
34
+$page->smarty->assign('catlist', $parentcatlist);
35
+$page->smarty->assign('previewcat', $previewcat);
36 36
 
37 37
 $releaselist = $releases->getPreviewRange($previewtype, $catarray, $offset, ITEMS_PER_PAGE);
38
-$page->smarty->assign('releaselist',$releaselist);
38
+$page->smarty->assign('releaselist', $releaselist);
39 39
 
40 40
 $page->content = $page->smarty->fetch('preview-list.tpl');
41 41
 $page->render();
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,8 +14,9 @@
 block discarded – undo
14 14
 $page->title = "Preview List";
15 15
 
16 16
 $previewcat="-1";
17
-if (isset($_REQUEST["previewcat"]))
17
+if (isset($_REQUEST["previewcat"])) {
18 18
     $previewcat = $_REQUEST["previewcat"];
19
+}
19 20
 
20 21
 $catarray = [];
21 22
 $catarray[] = $previewcat;
Please login to merge, or discard this patch.
www/admin/collection_regexes-edit.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,8 +11,7 @@
 block discarded – undo
11 11
 $regex = ['id' => '', 'regex' => '', 'description' => '', 'group_regex' => '', 'ordinal' => ''];
12 12
 
13 13
 switch ((isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view')) {
14
-	case 'submit':
15
-		if ($_POST["group_regex"] == '') {
14
+	case 'submit' : if ($_POST["group_regex"] == '') {
16 15
 			$error = "Group regex must not be empty!";
17 16
 			break;
18 17
 		}
Please login to merge, or discard this patch.