Passed
Push — dev ( 7b33de...17ad80 )
by Darko
14:48 queued 05:38
created
www/admin/role-edit.php 2 patches
Switch Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -14,46 +14,46 @@
 block discarded – undo
14 14
 }
15 15
 
16 16
 switch ((isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view')) {
17
-	case 'add':
18
-		$page->title              = "User Roles Add";
19
-		$role = [
20
-			'id'               => '',
21
-			'name'             => '',
22
-			'apirequests'      => '',
23
-			'downloadrequests' => '',
24
-			'defaultinvites'   => '',
25
-			'canpreview'       => 0,
26
-			'hideads'          => 0
27
-		];
28
-		$page->smarty->assign('role', $role);
29
-		break;
17
+		case 'add':
18
+			$page->title              = "User Roles Add";
19
+			$role = [
20
+				'id'               => '',
21
+				'name'             => '',
22
+				'apirequests'      => '',
23
+				'downloadrequests' => '',
24
+				'defaultinvites'   => '',
25
+				'canpreview'       => 0,
26
+				'hideads'          => 0
27
+			];
28
+			$page->smarty->assign('role', $role);
29
+			break;
30 30
 
31
-	case 'submit':
32
-		if ($_POST["id"] == "") {
33
-			$ret = $page->users->addRole($_POST['name'], $_POST['apirequests'], $_POST['downloadrequests'],
34
-				$_POST['defaultinvites'], $_POST['canpreview'], $_POST['hideads']
35
-			);
36
-			header("Location:" . WWW_TOP . "/role-list.php");
37
-		} else {
38
-			$ret = $page->users->updateRole($_POST['id'], $_POST['name'], $_POST['apirequests'],
39
-				$_POST['downloadrequests'], $_POST['defaultinvites'], $_POST['isdefault'], $_POST['canpreview'], $_POST['hideads']
40
-			);
41
-			header("Location:" . WWW_TOP . "/role-list.php");
31
+		case 'submit':
32
+			if ($_POST["id"] == "") {
33
+				$ret = $page->users->addRole($_POST['name'], $_POST['apirequests'], $_POST['downloadrequests'],
34
+					$_POST['defaultinvites'], $_POST['canpreview'], $_POST['hideads']
35
+				);
36
+				header("Location:" . WWW_TOP . "/role-list.php");
37
+			} else {
38
+				$ret = $page->users->updateRole($_POST['id'], $_POST['name'], $_POST['apirequests'],
39
+					$_POST['downloadrequests'], $_POST['defaultinvites'], $_POST['isdefault'], $_POST['canpreview'], $_POST['hideads']
40
+				);
41
+				header("Location:" . WWW_TOP . "/role-list.php");
42 42
 
43
-			$_POST['exccat'] = (!isset($_POST['exccat']) || !is_array($_POST['exccat'])) ? [] : $_POST['exccat'];
44
-			$page->users->addRoleCategoryExclusions($_POST['id'], $_POST['exccat']);
45
-		}
46
-		break;
43
+				$_POST['exccat'] = (!isset($_POST['exccat']) || !is_array($_POST['exccat'])) ? [] : $_POST['exccat'];
44
+				$page->users->addRoleCategoryExclusions($_POST['id'], $_POST['exccat']);
45
+			}
46
+			break;
47 47
 
48
-	case 'view':
49
-	default:
50
-		if (isset($_GET["id"])) {
51
-			$page->title = "User Roles Edit";
52
-			$role = $page->users->getRoleById($_GET["id"]);
53
-			$page->smarty->assign('role', $role);
54
-			$page->smarty->assign('roleexccat', $page->users->getRoleCategoryExclusion($_GET["id"]));
55
-		}
56
-		break;
48
+		case 'view':
49
+		default:
50
+			if (isset($_GET["id"])) {
51
+				$page->title = "User Roles Edit";
52
+				$role = $page->users->getRoleById($_GET["id"]);
53
+				$page->smarty->assign('role', $role);
54
+				$page->smarty->assign('roleexccat', $page->users->getRoleCategoryExclusion($_GET["id"]));
55
+			}
56
+			break;
57 57
 }
58 58
 
59 59
 $page->smarty->assign('yesno_ids', [1, 0]);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,8 +14,7 @@  discard block
 block discarded – undo
14 14
 }
15 15
 
16 16
 switch ((isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view')) {
17
-	case 'add':
18
-		$page->title              = "User Roles Add";
17
+	case 'add' : $page->title = "User Roles Add";
19 18
 		$role = [
20 19
 			'id'               => '',
21 20
 			'name'             => '',
@@ -58,7 +57,7 @@  discard block
 block discarded – undo
58 57
 
59 58
 $page->smarty->assign('yesno_ids', [1, 0]);
60 59
 $page->smarty->assign('yesno_names', ['Yes', 'No']);
61
-$page->smarty->assign('catlist',$category->getForSelect(false));
60
+$page->smarty->assign('catlist', $category->getForSelect(false));
62 61
 
63 62
 $page->content = $page->smarty->fetch('role-edit.tpl');
64 63
 $page->render();
Please login to merge, or discard this patch.