Fix broken port deletion

This commit is contained in:
Dane Everitt 2017-02-18 22:32:16 -05:00
parent efdc3e6fd8
commit 644c07ea3a
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
2 changed files with 3 additions and 2 deletions

View File

@ -6,6 +6,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
## v0.6.0-pre.4 (Courageous Carniadactylus)
### Fixed
* `[pre.3]` — Fixes bug in cache handler that doesn't cache against the user making the request. Would have allowed for users to access servers not belonging to themselves in production.
* `[pre.3]` — Fixes misnamed MySQL column that was causing the inability to delete certain port ranges from the database.
### Added
* New cache policy for ServerPolicy to avoid making 15+ queries per page load when confirming if a user has permission to perform an action.

View File

@ -163,7 +163,7 @@ class NodesController extends Controller
public function deallocateBlock(Request $request, $node)
{
$query = Models\Allocation::where('node', $node)->whereNull('server_id')->where('ip', $request->input('ip'))->delete();
$query = Models\Allocation::where('node_id', $node)->whereNull('server_id')->where('ip', $request->input('ip'))->delete();
if ((int) $query === 0) {
Alert::danger('There was an error while attempting to delete allocations on that IP.')->flash();
@ -199,7 +199,7 @@ class NodesController extends Controller
public function getAllocationsJson(Request $request, $id)
{
$allocations = Models\Allocation::select('ip')->where('node', $id)->groupBy('ip')->get();
$allocations = Models\Allocation::select('ip')->where('node_id', $id)->groupBy('ip')->get();
return response()->json($allocations);
}