@@ -57,7 +57,10 @@ discard block |
||
57 | 57 | <tr> |
58 | 58 | <td style="width:120px;"><?php print _('Type'); ?></td> |
59 | 59 | <td> |
60 | - <input type="text" name="type" class="form-control input-sm" value="<?php print @$tag->type; ?>" maxlength='32' <?php if($_POST['action'] == "delete") print "readonly"; ?>> |
|
60 | + <input type="text" name="type" class="form-control input-sm" value="<?php print @$tag->type; ?>" maxlength='32' <?php if($_POST['action'] == "delete") { |
|
61 | + print "readonly"; |
|
62 | +} |
|
63 | +?>> |
|
61 | 64 | <input type="hidden" name="id" value="<?php print @$tag->id; ?>"> |
62 | 65 | <input type="hidden" name="action" value="<?php print $_POST['action']; ?>"> |
63 | 66 | <input type="hidden" name="csrf_cookie" value="<?php print $csrf; ?>"> |
@@ -80,7 +83,10 @@ discard block |
||
80 | 83 | <td><?php print _('Bg color'); ?></td> |
81 | 84 | <td> |
82 | 85 | <div class="input-group select-bgcolor"> |
83 | - <input type="text" name="bgcolor" class="form-control input-xs" value="<?php print @$tag->bgcolor; ?>" maxlength='32' <?php if($_POST['action'] == "delete") print "readonly"; ?>><span class="input-group-addon"><i></i></span> |
|
86 | + <input type="text" name="bgcolor" class="form-control input-xs" value="<?php print @$tag->bgcolor; ?>" maxlength='32' <?php if($_POST['action'] == "delete") { |
|
87 | + print "readonly"; |
|
88 | +} |
|
89 | +?>><span class="input-group-addon"><i></i></span> |
|
84 | 90 | </div> |
85 | 91 | </td> |
86 | 92 | </tr> |
@@ -90,7 +96,10 @@ discard block |
||
90 | 96 | <td><?php print _('Fg color'); ?></td> |
91 | 97 | <td> |
92 | 98 | <div class="input-group select-fgcolor"> |
93 | - <input type="text" name="fgcolor" class="form-control input-sm" value="<?php print @$tag->fgcolor; ?>" maxlength='32' <?php if($_POST['action'] == "delete") print "readonly"; ?>><span class="input-group-addon"><i></i></span> |
|
99 | + <input type="text" name="fgcolor" class="form-control input-sm" value="<?php print @$tag->fgcolor; ?>" maxlength='32' <?php if($_POST['action'] == "delete") { |
|
100 | + print "readonly"; |
|
101 | +} |
|
102 | +?>><span class="input-group-addon"><i></i></span> |
|
94 | 103 | </div> |
95 | 104 | </td> |
96 | 105 | </tr> |
@@ -115,7 +124,10 @@ discard block |
||
115 | 124 | <div class="pFooter"> |
116 | 125 | <div class="btn-group"> |
117 | 126 | <button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button> |
118 | - <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } else { print "btn-success"; } ?>" id="editTypesubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } else if ($_POST['action']=="delete") { print "fa-trash-o"; } else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
127 | + <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } |
|
128 | +else { print "btn-success"; } ?>" id="editTypesubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } |
|
129 | +else if ($_POST['action']=="delete") { print "fa-trash-o"; } |
|
130 | +else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
119 | 131 | </div> |
120 | 132 | <!-- Result --> |
121 | 133 | <div class="editTypeResult"></div> |
@@ -60,7 +60,10 @@ discard block |
||
60 | 60 | <tr> |
61 | 61 | <td><?php print _('Name'); ?></td> |
62 | 62 | <td> |
63 | - <input type="text" name="name" class="form-control input-sm" placeholder="<?php print _('Name'); ?>" value="<?php if(isset($rack->name)) print $rack->name; ?>" <?php print $readonly; ?>> |
|
63 | + <input type="text" name="name" class="form-control input-sm" placeholder="<?php print _('Name'); ?>" value="<?php if(isset($rack->name)) { |
|
64 | + print $rack->name; |
|
65 | +} |
|
66 | +?>" <?php print $readonly; ?>> |
|
64 | 67 | </td> |
65 | 68 | </tr> |
66 | 69 | |
@@ -83,7 +86,10 @@ discard block |
||
83 | 86 | <tr> |
84 | 87 | <td><?php print _('Description'); ?></td> |
85 | 88 | <td> |
86 | - <textarea name="description" class="form-control input-sm" placeholder="<?php print _('Description'); ?>" <?php print $readonly; ?>><?php if(isset($rack->description)) print $rack->description; ?></textarea> |
|
89 | + <textarea name="description" class="form-control input-sm" placeholder="<?php print _('Description'); ?>" <?php print $readonly; ?>><?php if(isset($rack->description)) { |
|
90 | + print $rack->description; |
|
91 | +} |
|
92 | +?></textarea> |
|
87 | 93 | <?php |
88 | 94 | if( ($_POST['action'] == "edit") || ($_POST['action'] == "delete") ) { |
89 | 95 | print '<input type="hidden" name="rackid" value="'. $_POST['rackid'] .'">'. "\n"; |
@@ -200,7 +206,10 @@ discard block |
||
200 | 206 | <div class="pFooter"> |
201 | 207 | <div class="btn-group"> |
202 | 208 | <button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button> |
203 | - <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } else { print "btn-success"; } ?>" id="editRacksubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } else if ($_POST['action']=="delete") { print "fa-trash-o"; } else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
209 | + <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } |
|
210 | +else { print "btn-success"; } ?>" id="editRacksubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } |
|
211 | +else if ($_POST['action']=="delete") { print "fa-trash-o"; } |
|
212 | +else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
204 | 213 | </div> |
205 | 214 | |
206 | 215 | <!-- result --> |
@@ -109,7 +109,8 @@ |
||
109 | 109 | <a href="http://phpipam.net/api-documentation/">http://phpipam.net/api-documentation/</a> |
110 | 110 | |
111 | 111 | <?php |
112 | -} else { |
|
112 | +} |
|
113 | +else { |
|
113 | 114 | $Result->show("info", _('Please enable API module under server management'), false); |
114 | 115 | } |
115 | 116 | ?> |
116 | 117 | \ No newline at end of file |
@@ -30,7 +30,8 @@ discard block |
||
30 | 30 | $api===false ? $Result->show("danger", _("Invalid ID"), true) : null; |
31 | 31 | # title |
32 | 32 | $title = ucwords($_POST['action']) .' '._('api').' '.$api->app_id; |
33 | -} else { |
|
33 | +} |
|
34 | +else { |
|
34 | 35 | # generate new code |
35 | 36 | $api = new StdClass; |
36 | 37 | $api->app_code = str_shuffle(md5(microtime())); |
@@ -53,7 +54,10 @@ discard block |
||
53 | 54 | <tr> |
54 | 55 | <td><?php print _('App id'); ?></td> |
55 | 56 | <td> |
56 | - <input type="text" name="app_id" class="form-control input-sm" value="<?php print @$api->app_id; ?>" <?php if($_POST['action'] == "delete") print "readonly"; ?>> |
|
57 | + <input type="text" name="app_id" class="form-control input-sm" value="<?php print @$api->app_id; ?>" <?php if($_POST['action'] == "delete") { |
|
58 | + print "readonly"; |
|
59 | +} |
|
60 | +?>> |
|
57 | 61 | <input type="hidden" name="id" value="<?php print $api->id; ?>"> |
58 | 62 | <input type="hidden" name="action" value="<?php print $_POST['action']; ?>"> |
59 | 63 | <input type="hidden" name="csrf_cookie" value="<?php print $csrf; ?>"> |
@@ -64,7 +68,10 @@ discard block |
||
64 | 68 | <!-- code --> |
65 | 69 | <tr> |
66 | 70 | <td><?php print _('App code'); ?></td> |
67 | - <td><input type="text" id="appcode" name="app_code" class="form-control input-sm" value="<?php print @$api->app_code; ?>" maxlength='32' <?php if($_POST['action'] == "delete") print "readonly"; ?>></td> |
|
71 | + <td><input type="text" id="appcode" name="app_code" class="form-control input-sm" value="<?php print @$api->app_code; ?>" maxlength='32' <?php if($_POST['action'] == "delete") { |
|
72 | + print "readonly"; |
|
73 | +} |
|
74 | +?>></td> |
|
68 | 75 | <td class="info2"><?php print _('Application code'); ?> <button class="btn btn-xs btn-default" id="regApiKey"><i class="fa fa-random"></i> <?php print _('Regenerate'); ?></button></td> |
69 | 76 | </tr> |
70 | 77 | |
@@ -108,7 +115,10 @@ discard block |
||
108 | 115 | <tr> |
109 | 116 | <td><?php print _('Description'); ?></td> |
110 | 117 | <td> |
111 | - <input type="text" name="app_comment" class="form-control input-sm" value="<?php print @$api->app_comment; ?>" <?php if($_POST['action'] == "delete") print "readonly"; ?>> |
|
118 | + <input type="text" name="app_comment" class="form-control input-sm" value="<?php print @$api->app_comment; ?>" <?php if($_POST['action'] == "delete") { |
|
119 | + print "readonly"; |
|
120 | +} |
|
121 | +?>> |
|
112 | 122 | </td> |
113 | 123 | <td class="info2"><?php print _('Enter description'); ?></td> |
114 | 124 | </tr> |
@@ -125,7 +135,10 @@ discard block |
||
125 | 135 | <div class="pFooter"> |
126 | 136 | <div class="btn-group"> |
127 | 137 | <button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button> |
128 | - <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } else { print "btn-success"; } ?>" id="apiEditSubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } else if ($_POST['action']=="delete") { print "fa-trash-o"; } else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
138 | + <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } |
|
139 | +else { print "btn-success"; } ?>" id="apiEditSubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } |
|
140 | +else if ($_POST['action']=="delete") { print "fa-trash-o"; } |
|
141 | +else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
129 | 142 | </div> |
130 | 143 | <!-- Result --> |
131 | 144 | <div class="apiEditResult"></div> |
@@ -100,7 +100,10 @@ |
||
100 | 100 | <div class="pFooter"> |
101 | 101 | <div class="btn-group"> |
102 | 102 | <button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button> |
103 | - <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } else { print "btn-success"; } ?> editVLANdomainsubmit" id="editVLANdomainsubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } else if ($_POST['action']=="delete") { print "fa-trash-o"; } else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
103 | + <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } |
|
104 | +else { print "btn-success"; } ?> editVLANdomainsubmit" id="editVLANdomainsubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } |
|
105 | +else if ($_POST['action']=="delete") { print "fa-trash-o"; } |
|
106 | +else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
104 | 107 | </div> |
105 | 108 | |
106 | 109 | <!-- result --> |
@@ -74,7 +74,10 @@ |
||
74 | 74 | </table> |
75 | 75 | </form> |
76 | 76 | |
77 | - <?php if($m==0) $Result->show("warning", _("No domains available!"), false); ?> |
|
77 | + <?php if($m==0) { |
|
78 | + $Result->show("warning", _("No domains available!"), false); |
|
79 | +} |
|
80 | +?> |
|
78 | 81 | |
79 | 82 | </div> |
80 | 83 |
@@ -42,10 +42,12 @@ discard block |
||
42 | 42 | # all |
43 | 43 | if (@$_POST['domain']=="all") { |
44 | 44 | $vlan_domains = $Admin->fetch_all_objects("vlanDomains"); |
45 | - } else { |
|
45 | + } |
|
46 | + else { |
|
46 | 47 | $vlan_domain = $Admin->fetch_object("vlanDomains", "id", $_POST['domain']); |
47 | 48 | } |
48 | -} else { |
|
49 | +} |
|
50 | +else { |
|
49 | 51 | $vlan_domain = $Admin->fetch_object("vlanDomains", "id", $vlan['domainId']); |
50 | 52 | } |
51 | 53 | if($vlan_domain===false) { $Result->show("danger", _("Invalid ID"), true, true); } |
@@ -74,7 +76,8 @@ discard block |
||
74 | 76 | # not all |
75 | 77 | if (@$_POST['domain']!="all") { |
76 | 78 | print $vlan_domain->name." (".$vlan_domain->description.")"; |
77 | - } else { |
|
79 | + } |
|
80 | + else { |
|
78 | 81 | print "<select name='domainId' class='form-control input-sm'>"; |
79 | 82 | foreach ($vlan_domains as $d) { |
80 | 83 | print "<option value='$d->id'>$d->name</option>"; |
@@ -238,8 +241,12 @@ discard block |
||
238 | 241 | <!-- footer --> |
239 | 242 | <div class="pFooter"> |
240 | 243 | <div class="btn-group"> |
241 | - <button class="btn btn-sm btn-default <?php if(isset($_POST['fromSubnet'])) { print "hidePopup2"; } else { print "hidePopups"; } ?>"><?php print _('Cancel'); ?></button> |
|
242 | - <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } else { print "btn-success"; } ?> vlanManagementEditFromSubnetButton" id="editVLANsubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } else if ($_POST['action']=="delete") { print "fa-trash-o"; } else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
244 | + <button class="btn btn-sm btn-default <?php if(isset($_POST['fromSubnet'])) { print "hidePopup2"; } |
|
245 | +else { print "hidePopups"; } ?>"><?php print _('Cancel'); ?></button> |
|
246 | + <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } |
|
247 | +else { print "btn-success"; } ?> vlanManagementEditFromSubnetButton" id="editVLANsubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } |
|
248 | +else if ($_POST['action']=="delete") { print "fa-trash-o"; } |
|
249 | +else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
243 | 250 | </div> |
244 | 251 | |
245 | 252 | <!-- result --> |
@@ -18,8 +18,12 @@ |
||
18 | 18 | $User->check_user_session(); |
19 | 19 | |
20 | 20 | // checks |
21 | -if(!is_numeric($_POST['newDomainId'])) $Result->show("danger", _("Invalid ID"), true); |
|
22 | -if(!is_numeric($_POST['vlanId'])) $Result->show("danger", _("Invalid ID"), true); |
|
21 | +if(!is_numeric($_POST['newDomainId'])) { |
|
22 | + $Result->show("danger", _("Invalid ID"), true); |
|
23 | +} |
|
24 | +if(!is_numeric($_POST['vlanId'])) { |
|
25 | + $Result->show("danger", _("Invalid ID"), true); |
|
26 | +} |
|
23 | 27 | |
24 | 28 | // verify that new exists |
25 | 29 | $vlan_domain = $Admin->fetch_object("vlanDomains", "id", $_POST['newDomainId']); |
@@ -93,7 +93,8 @@ discard block |
||
93 | 93 | else { |
94 | 94 | print '<td><a href="'.create_link("subnets",$network->sectionId,$network->subnetId).'">Folder'.$network->subnetDescription.'</a></td>'; |
95 | 95 | } |
96 | - } else { |
|
96 | + } |
|
97 | + else { |
|
97 | 98 | print '<td>/</td>'; |
98 | 99 | } |
99 | 100 | # display vlan informations |
@@ -101,7 +102,8 @@ discard block |
||
101 | 102 | // name fix |
102 | 103 | $network->vlanName = strlen($network->vlanName)>0 ? " (".$network->vlanName.")" : ""; |
103 | 104 | print '<td><a href="'.create_link('tools','vlan',$network->domainId,$network->vlanId).'">Vlan '.$network->vlan.''.$network->vlanName.'</a></td>'; |
104 | - } else { |
|
105 | + } |
|
106 | + else { |
|
105 | 107 | print '<td>/</td>'; |
106 | 108 | } |
107 | 109 | if ($i === 1) { |
@@ -117,7 +119,8 @@ discard block |
||
117 | 119 | # increase the loop counter |
118 | 120 | $i++; |
119 | 121 | } |
120 | - } else { |
|
122 | + } |
|
123 | + else { |
|
121 | 124 | print "<tr class='border-top'>"; |
122 | 125 | # display only the zone mapping data if there is no network data available |
123 | 126 | $title = $mapping->indicator == 0 ? 'Own Zone' : 'Customer Zone'; |