Skip to content

Commit

Permalink
Fixes #2149
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Jul 7, 2016
1 parent 3bb5479 commit 01b01c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/Http/Controllers/LicensesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,13 @@ public function postCheckout($seatId)

if ($asset_id!='') {

if (is_null($is_asset_id = Asset::find($asset_id))) {
if (is_null($asset = Asset::find($asset_id))) {
// Redirect to the asset management page with error
return redirect()->to('admin/licenses')->with('error', trans('admin/licenses/message.asset_does_not_exist'));
}
$was_assigned_to = $is_asset_id->assigned_to;
if (($was_assigned_to!=$assigned_to) && !is_null($was_assigned_to) && ($was_assigned_to != '')) {
//echo 'asset assigned to: '.$is_asset_id->assigned_to.'<br>license assigned to: '.$assigned_to;


if (($asset->assigned_to!='') && (($asset->assigned_to!=$assigned_to)) && ($assigned_to!='') ) {
return redirect()->to('admin/licenses')->with('error', trans('admin/licenses/message.owner_doesnt_match_asset'));
}

Expand Down

0 comments on commit 01b01c6

Please sign in to comment.