Skip to content

A free open source IT asset/license management system

updates assets with selected model to inherit asset model eol

Godfrey M09b2feac5401
diff --git a/app/Console/Commands/LdapSync.php b/app/Console/Commands/LdapSync.php
index 1856bf10fc..a36de2ae0b 100755
--- a/app/Console/Commands/LdapSync.php
+++ b/app/Console/Commands/LdapSync.php
@@ -257,7 +257,7 @@ class LdapSync extends Command
//If a sync option is not filled in on the LDAP settings don't populate the user field
if($ldap_result_username != null){
- $user->username = $item['username'];
+ $user->username = $item[name'];
}
if($ldap_result_last_name != null){
$user->last_name = $item['lastname'];
diff --git a/app/Console/Commands/RemoveExplicitEols.php b/app/Console/Commands/RemoveExplicitEols.php
index a0793cc507..58c1ed26b1 100644
--- a/app/Console/Commands/RemoveExplicitEols.php
+++ b/app/Console/Commands/RemoveExplicitEols.php
@@ -13,7 +13,7 @@ class RemoveExplicitEols extends Command
*
* @var string
*/
- protected $signature = 'snipeit:remove-explicit-eols {--model_name=*}';
+ protected $signature = 'snipeit:remove-explicit-eols {--model_name=}';
/**
* The console command description.
@@ -31,11 +31,17 @@ class RemoveExplicitEols extends Command
if($assetModel){
$assets = Asset::where('model_id', '=', $assetModel->id)->get();
+
+ foreach ($assets as $asset) {
+ $asset->eol_explicit = 0;
+ $asset->asset_eol_date = null;
+ $asset->save();
+ }
+
+ $this->info($assets->count().' Assets updated successfully');
}
else {
$this->error('Asset model not found');
}
-
- dd($assets);
}
}