Skip to content

A free open source IT asset/license management system

syncs assets location to users location

Godfrey M866f0a9f561c
diff --git a/app/Console/Commands/LdapSync.php b/app/Console/Commands/LdapSync.php
index a26c157476..34eb4642b3 100755
--- a/app/Console/Commands/LdapSync.php
+++ b/app/Console/Commands/LdapSync.php
@@ -391,9 +391,11 @@ class LdapSync extends Command
$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){
$asset->location_id = $user->location_id;
+ $asset->save();
}
$user->ldap_import = 1;