Passed
Push — dev ( 51d1c1...7b33de )
by Darko
15:38 queued 04:32
created
www/admin/role-edit.php 1 patch
Switch Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -11,46 +11,46 @@
 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;
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
-			$_POST['exccat'] = (!isset($_POST['exccat']) || !is_array($_POST['exccat'])) ? [] : $_POST['exccat'];
41
-			$page->users->addRoleCategoryExclusions($_POST['id'], $_POST['exccat']);
42
-		}
43
-		break;
44
-
45
-	case 'view':
46
-	default:
47
-		if (isset($_GET["id"])) {
48
-			$page->title = "User Roles Edit";
49
-			$role = $page->users->getRoleById($_GET["id"]);
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
+			];
50 25
 			$page->smarty->assign('role', $role);
51
-			$page->smarty->assign('roleexccat', $page->users->getRoleCategoryExclusion($_GET["id"]));
52
-		}
53
-		break;
26
+			break;
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
+				$_POST['exccat'] = (!isset($_POST['exccat']) || !is_array($_POST['exccat'])) ? [] : $_POST['exccat'];
41
+				$page->users->addRoleCategoryExclusions($_POST['id'], $_POST['exccat']);
42
+			}
43
+			break;
44
+
45
+		case 'view':
46
+		default:
47
+			if (isset($_GET["id"])) {
48
+				$page->title = "User Roles Edit";
49
+				$role = $page->users->getRoleById($_GET["id"]);
50
+				$page->smarty->assign('role', $role);
51
+				$page->smarty->assign('roleexccat', $page->users->getRoleCategoryExclusion($_GET["id"]));
52
+			}
53
+			break;
54 54
 }
55 55
 
56 56
 $page->smarty->assign('yesno_ids', [1, 0]);
Please login to merge, or discard this patch.