mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
syncs assets location to users location
This commit is contained in:
parent
05a8d3030b
commit
866f0a9f56
|
@ -391,9 +391,11 @@ class LdapSync extends Command
|
||||||
$user->location_id = $location->id;
|
$user->location_id = $location->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$assets = Asset::whereColumn('assigned_to', '=', $user->id)->get();
|
//updates assets location based on user's location
|
||||||
|
$assets = Asset::where('assigned_to', '=', $user->id)->get();
|
||||||
foreach($assets as $asset){
|
foreach($assets as $asset){
|
||||||
$asset->location_id = $user->location_id;
|
$asset->location_id = $user->location_id;
|
||||||
|
$asset->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
$user->ldap_import = 1;
|
$user->ldap_import = 1;
|
||||||
|
|
Loading…
Reference in a new issue