Completed
Pull Request — master (#532)
06:37
created
app/tools/racks/print-racks.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,8 @@  discard block
 block discarded – undo
18 18
 <div class="btn-group">
19 19
     <?php if($_GET['page']=="administration") { ?>
20 20
 	<a href="" class='btn btn-sm btn-default  editRack' data-action='add'   data-rackid='' style='margin-bottom:10px;'><i class='fa fa-plus'></i> <?php print _('Add rack'); ?></a>
21
-	<?php } else { ?>
21
+	<?php }
22
+else { ?>
22 23
 	<a href="<?php print create_link("administration", "racks") ?>" class='btn btn-sm btn-default' style='margin-bottom:10px;'><i class='fa fa-pencil'></i> <?php print _('Manage'); ?></a>
23 24
 	<?php } ?>
24 25
 </div>
@@ -132,7 +133,7 @@  discard block
 block discarded – undo
132 133
     					$r->$field['name'] = $Result->create_links ($r->$field['name'], $field['type']);
133 134
 
134 135
     					//booleans
135
-    					if($field['type']=="tinyint(1)")	{
136
+    					if($field['type']=="tinyint(1)") {
136 137
     						if($r->$field['name'] == "0")		{ print _("No"); }
137 138
     						elseif($r->$field['name'] == "1")	{ print _("Yes"); }
138 139
     					}
Please login to merge, or discard this patch.
app/tools/firewall-zones/index.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -86,17 +86,20 @@
 block discarded – undo
86 86
 						$network->subnetDescription = $network->subnetDescription ? " (".$network->subnetDescription.")" : "";
87 87
 						if (!$network->subnetIsFolder) {
88 88
 							print '<td><a href="'.create_link("subnets",$network->sectionId,$network->subnetId).'">'.$Subnets->transform_to_dotted($network->subnet).'/'.$network->subnetMask.$network->subnetDescription.'</a></td>';
89
-						} else {
89
+						}
90
+						else {
90 91
 							print '<td><a href="'.create_link("subnets",$network->sectionId,$network->subnetId).'">Folder'.$network->subnetDescription.'</a></td>';
91 92
 						}
92
-					} else {
93
+					}
94
+					else {
93 95
 						print '<td>/</td>';
94 96
 					}
95 97
 					# display vlan informations
96 98
 					if ($network->vlanId) {
97 99
 						$network->vlanName = strlen($network->vlanName)>0 ? " (".$network->vlanName.")" : "";
98 100
 						print '<td><a href="'.create_link('tools','vlan',$network->domainId,$network->vlanId).'">Vlan '.$network->vlan.$network->vlanName.'</a></td>';
99
-					} else {
101
+					}
102
+					else {
100 103
 						print '<td>/</td>';
101 104
 					}
102 105
 					print '</tr>';
Please login to merge, or discard this patch.
app/tools/devices/devices-hosts.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@
 block discarded – undo
139 139
     if(empty($device['hostname'])) {
140 140
     	$device['hostname'] = _('Device not specified');
141 141
     }
142
-    else 										{
142
+    else {
143 143
     	if(empty($device['hostname'])) 				{ $device['hostname'] = "Unspecified";}
144 144
     }
145 145
 
Please login to merge, or discard this patch.
app/tools/vlan/domains.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,8 @@
 block discarded – undo
9 9
 	<button class="btn btn-sm btn-default editVLAN" data-action="add" data-domain="all" style="margin-bottom:10px;"><i class="fa fa-plus"></i> <?php print _('Add VLAN'); ?></button>
10 10
 
11 11
 </div>
12
-<?php } else { ?>
12
+<?php }
13
+else { ?>
13 14
 	<a class="btn btn-sm btn-default" href="<?php print create_link("administration", "vlans"); ?>" style='margin-bottom:15px;'><i class='fa fa-pencil'></i> <?php print _("Manage"); ?></a>
14 15
 <?php } ?>
15 16
 <?php } ?>
Please login to merge, or discard this patch.
app/tools/vlan/domain-vlans-all.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -69,21 +69,22 @@  discard block
 block discarded – undo
69 69
 
70 70
 		// show free vlans - start
71 71
 		if($User->user->hideFreeRange!=1 && !isset($_GET['sPage'])) {
72
-			if($m==0 && $vlan->number!=1)	{
72
+			if($m==0 && $vlan->number!=1) {
73 73
 				print "<tr class='success'>";
74 74
 				print "<td></td>";
75 75
 				print "<td colspan='".(4+$csize)."'><btn class='btn btn-xs btn-default editVLAN $disabled' data-action='add' data-domain='all' data-number='1'><i class='fa fa-plus'></i></btn> "._('VLAN')." 1 - ".($vlan->number -1)." (".($vlan->number -1)." "._('free').")</td>";
76 76
 				print "</tr>";
77 77
 			}
78 78
 			# show free vlans - before vlan
79
-			if($m>0)	{
79
+			if($m>0) {
80 80
 				if( (($vlan->number)-($vlans[$m-1]->number)-1) > 0 ) {
81 81
 				print "<tr class='success'>";
82 82
 				print "<td></td>";
83 83
 				# only 1?
84 84
 				if( (($vlan->number)-($vlans[$m-1]->number)-1) ==1 ) {
85 85
 				print "<td colspan='".(4+$csize)."'><btn class='btn btn-xs btn-default editVLAN $disabled' data-action='add' data-domain='all' data-number='".($vlan->number -1)."'><i class='fa fa-plus'></i></btn> "._('VLAN')." ".($vlan->number -1)." (".(($vlan->number)-($vlans[$m-1]->number)-1)." "._('free').")</td>";
86
-				} else {
86
+				}
87
+				else {
87 88
 				print "<td colspan='".(4+$csize)."'><btn class='btn btn-xs btn-default editVLAN $disabled' data-action='add' data-domain='all' data-number='".($vlans[$m-1]->number+1)."'><i class='fa fa-plus'></i></btn> "._('VLAN')." ".($vlans[$m-1]->number+1)." - ".($vlan->number -1)." (".(($vlan->number)-($vlans[$m-1]->number)-1)." "._('free').")</td>";
88 89
 				}
89 90
 				print "</tr>";
@@ -114,7 +115,7 @@  discard block
 block discarded – undo
114 115
 
115 116
 					print "<td class='hidden-xs hidden-sm hidden-md'>";
116 117
 					//booleans
117
-					if($field['type']=="tinyint(1)")	{
118
+					if($field['type']=="tinyint(1)") {
118 119
 						if($vlan->$field['name'] == "0")		{ print _("No"); }
119 120
 						elseif($vlan->$field['name'] == "1")	{ print _("Yes"); }
120 121
 					}
Please login to merge, or discard this patch.
app/tools/vlan/domain-vlans.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -91,21 +91,22 @@  discard block
 block discarded – undo
91 91
 
92 92
 		// show free vlans - start
93 93
 		if($User->user->hideFreeRange!=1) {
94
-			if($m==0 && $vlan[0]->number!=1)	{
94
+			if($m==0 && $vlan[0]->number!=1) {
95 95
 				print "<tr class='success'>";
96 96
 				print "<td></td>";
97 97
 				print "<td colspan='".(5+$csize)."'><btn class='btn btn-xs btn-default editVLAN $disabled' data-action='add' data-domain='".$vlan_domain->id."'  data-number='1'><i class='fa fa-plus'></i></btn> "._('VLAN')." 1 - ".($vlan[0]->number)." (".($vlan[0]->number -1)." "._('free').")</td>";
98 98
 				print "</tr>";
99 99
 			}
100 100
 			# show free vlans - before vlan
101
-			if($m>0)	{
101
+			if($m>0) {
102 102
 				if( (($vlans[$m][0]->number)-($vlans[$m-1][0]->number)-1) > 0 ) {
103 103
 				print "<tr class='success'>";
104 104
 				print "<td></td>";
105 105
 				# only 1?
106 106
 				if( (($vlans[$m][0]->number)-($vlans[$m-1][0]->number)-1) ==1 ) {
107 107
 				print "<td colspan='".(5+$csize)."'><btn class='btn btn-xs btn-default editVLAN $disabled' data-action='add' data-domain='".$vlan_domain->id."' data-number='".($vlan[0]->number -1)."'><i class='fa fa-plus'></i></btn> "._('VLAN')." ".($vlan[0]->number -1)." (".(($vlans[$m][0]->number)-($vlans[$m-1][0]->number)-1)." "._('free').")</td>";
108
-				} else {
108
+				}
109
+				else {
109 110
 				print "<td colspan='".(5+$csize)."'><btn class='btn btn-xs btn-default editVLAN $disabled' data-action='add' data-domain='".$vlan_domain->id."' data-number='".($vlans[$m-1][0]->number+1)."'><i class='fa fa-plus'></i></btn> "._('VLAN')." ".($vlans[$m-1][0]->number+1)." - ".($vlan[0]->number -1)." (".(($vlans[$m][0]->number)-($vlans[$m-1][0]->number)-1)." "._('free').")</td>";
110 111
 				}
111 112
 				print "</tr>";
@@ -156,7 +157,7 @@  discard block
 block discarded – undo
156 157
 
157 158
 								print "<td class='hidden-xs hidden-sm hidden-md'>";
158 159
 								//booleans
159
-								if($field['type']=="tinyint(1)")	{
160
+								if($field['type']=="tinyint(1)") {
160 161
 									if($v->$field['name'] == "0")		{ print _("No"); }
161 162
 									elseif($v->$field['name'] == "1")	{ print _("Yes"); }
162 163
 								}
Please login to merge, or discard this patch.
app/tools/vrf/index.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 	    print "	<td colspan='8'>";
47 47
 	    print _("Available in sections")." ";
48 48
             $vrf_sections = array_filter(explode(";", $vrf['sections']));
49
-            if (sizeof($vrf_sections)==0)   {
49
+            if (sizeof($vrf_sections)==0) {
50 50
                 print "<span class='badge badge1'>"._("All sections")."</span>";
51 51
             }
52 52
             else {
Please login to merge, or discard this patch.
app/tools/tools-menu-config.php 1 patch
Braces   +21 added lines, -14 removed lines patch added patch discarded remove patch
@@ -13,34 +13,41 @@
 block discarded – undo
13 13
 # Tools
14 14
 $tools_menu['Tools'][] = array("show"=>true,	"icon"=>"fa-search", 		"name"=>"Search", 		 		"href"=>"search", 		"description"=>"Search database Addresses, subnets and VLANs");
15 15
 $tools_menu['Tools'][] = array("show"=>true,	"icon"=>"fa-calculator",	"name"=>"IP calculator", 		"href"=>"ip-calculator","description"=>"IPv4v6 calculator for subnet calculations");
16
-if($User->settings->enableChangelog == 1)
17
-$tools_menu['Tools'][] = array("show"=>true,	"icon"=>"fa-clock-o", 		"name"=>"Changelog", 	 		"href"=>"changelog", 	"description"=>"Show changelog for all network objects");
16
+if($User->settings->enableChangelog == 1) {
17
+    $tools_menu['Tools'][] = array("show"=>true,	"icon"=>"fa-clock-o", 		"name"=>"Changelog", 	 		"href"=>"changelog", 	"description"=>"Show changelog for all network objects");
18
+}
18 19
 $tools_menu['Tools'][] = array("show"=>true,	"icon"=>"fa-list", 			"name"=>"Log files", 			"href"=>"logs",		 	"description"=>"Browse phpipam log files");
19 20
 if($User->settings->enableIPrequests==1) {
20 21
 $tools_menu['Tools'][] = array("show"=>true,	"icon"=>"fa-plus", 			"name"=>"IP requests", 			"href"=>"requests", 	"description"=>"Manage IP requests");
21 22
 }
22 23
 $tools_menu['Tools'][] = array("show"=>true,	"icon"=>"fa-info", 	  		"name"=>"Instructions",  		"href"=>"instructions", "description"=>"Instructions for managing IP addresses");
23
-if($User->settings->enablePowerDNS==1)
24
-$tools_menu['Tools'][] = array("show"=>true,	"icon"=>"fa-database", 	  		"name"=>"PowerDNS",  		"href"=>"powerDNS", "description"=>"PowerDNS settings");
24
+if($User->settings->enablePowerDNS==1) {
25
+    $tools_menu['Tools'][] = array("show"=>true,	"icon"=>"fa-database", 	  		"name"=>"PowerDNS",  		"href"=>"powerDNS", "description"=>"PowerDNS settings");
26
+}
25 27
 
26 28
 # Subnets
27 29
 $tools_menu['Subnets'][] 	= array("show"=>true,	"icon"=>"fa-star", 	  	"name"=>"Favourite networks",  	"href"=>"favourites", 	"description"=>"Show favourite networks");
28 30
 $tools_menu['Subnets'][] 	= array("show"=>true,	"icon"=>"fa-sitemap", 	"name"=>"Subnets",  		   	"href"=>"subnets", 		"description"=>"Show all subnets");
29 31
 $tools_menu['Subnets'][] 	= array("show"=>true,	"icon"=>"fa-cloud", 	"name"=>"VLAN",  				"href"=>"vlan", 		"description"=>"Show VLANs and belonging subnets");
30
-if($User->settings->enableVRF == 1)
31
-$tools_menu['Subnets'][] 	= array("show"=>true,	"icon"=>"fa-cloud", 	 "name"=>"VRF",  				"href"=>"vrf", 			"description"=>"Show VRFs and belonging networks");
32
-if($User->settings->enableRACK == 1)
33
-$tools_menu['Subnets'][] 	= array("show"=>true,	"icon"=>"fa-bars", 	     "name"=>"Racks",  				"href"=>"racks", 		"description"=>"Show racks");
32
+if($User->settings->enableVRF == 1) {
33
+    $tools_menu['Subnets'][] 	= array("show"=>true,	"icon"=>"fa-cloud", 	 "name"=>"VRF",  				"href"=>"vrf", 			"description"=>"Show VRFs and belonging networks");
34
+}
35
+if($User->settings->enableRACK == 1) {
36
+    $tools_menu['Subnets'][] 	= array("show"=>true,	"icon"=>"fa-bars", 	     "name"=>"Racks",  				"href"=>"racks", 		"description"=>"Show racks");
37
+}
34 38
 $tools_menu['Subnets'][] 	= array("show"=>true,	"icon"=>"fa-desktop", 	 "name"=>"Devices",  			"href"=>"devices", 		"description"=>"Show all configured devices");
35
-if($User->settings->enableMulticast == 1)
36
-$tools_menu['Subnets'][] 	= array("show"=>true,	"icon"=>"fa-map-o",		"name"=>"Multicast networks", 	"href"=>"multicast-networks", "description"=>"Show multicast subnets and mapping");
37
-if($User->settings->enableFirewallZones == 1)
38
-$tools_menu['Subnets'][] 	= array("show"=>true,	"icon"=>"fa-fire",		"name"=>"Firewall Zones", 		"href"=>"firewall-zones", "description"=>"Display firewall zone to device mappings");
39
+if($User->settings->enableMulticast == 1) {
40
+    $tools_menu['Subnets'][] 	= array("show"=>true,	"icon"=>"fa-map-o",		"name"=>"Multicast networks", 	"href"=>"multicast-networks", "description"=>"Show multicast subnets and mapping");
41
+}
42
+if($User->settings->enableFirewallZones == 1) {
43
+    $tools_menu['Subnets'][] 	= array("show"=>true,	"icon"=>"fa-fire",		"name"=>"Firewall Zones", 		"href"=>"firewall-zones", "description"=>"Display firewall zone to device mappings");
44
+}
39 45
 $tools_menu['Subnets'][] 	= array("show"=>true,	"icon"=>"fa-eye", 		 "name"=>"Scanned networks", 	"href"=>"scanned-networks",	"description"=>"List of subnets to be scanned for online hosts and detect new hosts");
40 46
 $tools_menu['Subnets'][] 	= array("show"=>true,	"icon"=>"fa-th-large", 	 "name"=>"Subnet masks", 		"href"=>"subnet-masks",	"description"=>"Table of all subnet masks with different representations");
41 47
 // temp shares
42
-if($User->settings->tempShare==1)
43
-$tools_menu['Subnets'][] 	= array("show"=>true,	"icon"=>"fa-share-alt",  "name"=>"Temporary shares", 	"href"=>"temp-shares",	"description"=>"List of temporary shared objects");
48
+if($User->settings->tempShare==1) {
49
+    $tools_menu['Subnets'][] 	= array("show"=>true,	"icon"=>"fa-share-alt",  "name"=>"Temporary shares", 	"href"=>"temp-shares",	"description"=>"List of temporary shared objects");
50
+}
44 51
 
45 52
 # user menu
46 53
 $tools_menu['User Menu'][] = array("show"=>true,	"icon"=>"fa-user", 		"name"=>"My account",  			"href"=>"user-menu", 	"description"=>"Manage your account");
Please login to merge, or discard this patch.
app/sections/index.php 1 patch
Braces   +20 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,7 +46,8 @@  discard block
 block discarded – undo
46 46
 		# null
47 47
 		if (sizeof($requests)==0) {
48 48
 			unset($requests);
49
-		} else {
49
+		}
50
+		else {
50 51
 			$requests = sizeof($requests);
51 52
 		}
52 53
 	}
@@ -167,7 +168,8 @@  discard block
 block discarded – undo
167 168
 					# active?
168 169
 					if($_GET['page']=="administration") {
169 170
 						$active = $_GET['section']==$i['href'] ? "active" : "";
170
-					} else {
171
+					}
172
+					else {
171 173
 						$active = "";
172 174
 					}
173 175
 					print "<li class='$active'><a href='".create_link("administration",$i['href'])."'>"._($i['name'])."</a></li>";
@@ -206,7 +208,8 @@  discard block
 block discarded – undo
206 208
 							# active?
207 209
 							if($_GET['page']=="tools") {
208 210
 								$active = $_GET['section']==$i['href'] ? "active" : "";
209
-							} else {
211
+							}
212
+							else {
210 213
 								$active = "";
211 214
 							}
212 215
 							print "<li class='$active'><a href='".create_link("tools",$i['href'])."'>"._($i['name'])."</a></li>";
@@ -239,13 +242,19 @@  discard block
 block discarded – undo
239 242
 		//check if user has favourite subnets
240 243
 		if(strlen(trim($User->user->favourite_subnets))>0) {
241 244
 		?>
242
-		<li class="<?php if($_GET['section']=="favourites") print " active"; ?>">
245
+		<li class="<?php if($_GET['section']=="favourites") {
246
+    print " active";
247
+}
248
+?>">
243 249
 			<a href="<?php print create_link("tools","favourites"); ?>" class="icon-li" rel='tooltip' data-placement='bottom' title="<?php print _('Favourite networks'); ?>"><i class='fa fa-star-o'></i></a>
244 250
 		</li>
245 251
 		<?php } ?>
246 252
 
247 253
 		<!-- instructions -->
248
-		<li class="<?php if($_GET['section']=="instructions") print " active"; ?>">
254
+		<li class="<?php if($_GET['section']=="instructions") {
255
+    print " active";
256
+}
257
+?>">
249 258
 			<a href="<?php print create_link("tools","instructions"); ?>" class="icon-li" rel='tooltip' data-placement='bottom' title="<?php print _('Show IP addressing guide'); ?>"><i class='fa fa-info'></i></a>
250 259
 		</li>
251 260
 
@@ -272,7 +281,8 @@  discard block
 block discarded – undo
272 281
 							# active?
273 282
 							if($_GET['page']=="tools") {
274 283
 								$active = $_GET['section']==$i['href'] ? "active" : "";
275
-							} else {
284
+							}
285
+							else {
276 286
 								$active = "";
277 287
 							}
278 288
 							print "<li class='$active'><a href='".create_link("tools",$i['href'])."'>"._($i['name'])."</a></li>";
@@ -317,13 +327,15 @@  discard block
 block discarded – undo
317 327
 			if(!$version = $Tools->check_latest_phpipam_version ()) {
318 328
 				# we failed, so NW is not ok. update time anyway to avoid future failures
319 329
 				$Tools->update_phpipam_checktime ();
320
-			} else {
330
+			}
331
+			else {
321 332
 				# new version available
322 333
 				if ($User->settings->version < $version) {
323 334
 					print "<li>";
324 335
 					print "	<a href='".create_link("administration","version-check")."' class='icon-li btn-warning' rel='tooltip' data-placement='bottom' title='"._('New version available')."'><i class='fa fa-bullhorn'></i><sup>$version</sup></a>";
325 336
 					print "</li>";
326
-				} else {
337
+				}
338
+				else {
327 339
 					# version ok
328 340
 					$Tools->update_phpipam_checktime ();
329 341
 				}
Please login to merge, or discard this patch.