Skip to content

A free open source IT asset/license management system

store good, update needs work

spencerrlongg20dbacd22f5c
diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php
index 2922766286..75d64d440f 100644
--- a/app/Http/Controllers/Api/AssetsController.php
+++ b/app/Http/Controllers/Api/AssetsController.php
@@ -585,6 +585,16 @@ class AssetsController extends Controller
}
}
if ($field->element == 'checkbox') {
+ if ($field->field_encrypted) {
+ // to not break a bunch of stuff, we must decrypt + implode if the checkbox value is an array
+ $field_val_decrypt = Crypt::decrypt($field_val);
+ if (is_array($field_val_decrypt)) {
+ $field_val_decrypt_imploded = implode(',', $field_val_decrypt);
+ $field_val = Crypt::encrypt($field_val_decrypt_imploded);
+ } else
+ $field_val = Crypt::encrypt($field_val_decrypt);
+
+ }
if(is_array($field_val)) {
$field_val = implode(',', $field_val);
}
@@ -665,6 +675,16 @@ class AssetsController extends Controller
}
}
if ($field->element == 'checkbox') {
+ //if ($field->field_encrypted) {
+ // // to not break a bunch of stuff, we must decrypt + implode if the checkbox value is an array
+ // $field_val_decrypt = Crypt::decrypt($field_val);
+ // if (is_array($field_val_decrypt)) {
+ // $field_val_decrypt_imploded = implode(',', $field_val_decrypt);
+ // $field_val = Crypt::encrypt($field_val_decrypt_imploded);
+ // } else
+ // $field_val = Crypt::encrypt($field_val_decrypt);
+ //
+ //}
if(is_array($field_val)) {
$field_val = implode(',', $field_val);
$asset->{$field->db_column} = $field_val;