mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
rm validation stuff
This commit is contained in:
parent
b6fa6cba22
commit
ad0f873ece
|
@ -585,16 +585,6 @@ 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);
|
||||
}
|
||||
|
@ -670,24 +660,12 @@ class AssetsController extends Controller
|
|||
$field_val = $request->input($field->db_column, null);
|
||||
|
||||
if ($request->has($field->db_column)) {
|
||||
//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 ($field->field_encrypted == '1') {
|
||||
if (Gate::allows('admin')) {
|
||||
$asset->{$field->db_column} = Crypt::encrypt($field_val);
|
||||
}
|
||||
}
|
||||
|
||||
if ($field->element == 'checkbox') {
|
||||
|
||||
if(is_array($field_val)) {
|
||||
$field_val = implode(',', $field_val);
|
||||
$asset->{$field->db_column} = $field_val;
|
||||
|
|
|
@ -304,14 +304,6 @@ class ValidationServiceProvider extends ServiceProvider
|
|||
$field = CustomField::where('db_column', $attribute)->first();
|
||||
$options = $field->formatFieldValuesAsArray();
|
||||
|
||||
// temporarily decrypt for validation
|
||||
// so, this is breaking patches, i don't really get why.
|
||||
// is it not encrypted here on an update? need to do more testing. :(
|
||||
if($field->field_encrypted) {
|
||||
$value = Crypt::decrypt($value);
|
||||
}
|
||||
dump(is_array($value));
|
||||
|
||||
if(is_array($value)) {
|
||||
$invalid = array_diff($value, $options);
|
||||
if(count($invalid) > 0) {
|
||||
|
|
Loading…
Reference in a new issue