Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2020-10-22 23:24:56 -07:00
commit c3e8f64064
4 changed files with 35 additions and 13 deletions

View file

@ -191,21 +191,27 @@ class LdapSync extends Command
];
// Only update the database if is not a dry run
if (!$this->dryrun) {
if ($user->save()) {
$summary['note'] = ($user->wasRecentlyCreated ? 'CREATED' : 'UPDATED');
$summary['status'] = 'SUCCESS';
} else {
$errors = '';
foreach ($user->getErrors()->getMessages() as $error) {
$errors .= implode(", ",$error);
if ($user->isDirty()) { //if nothing on the user changed, don't bother trying to save anything nor put anything in the summary
if ($user->save()) {
$summary['note'] = ($user->wasRecentlyCreated ? 'CREATED' : 'UPDATED');
$summary['status'] = 'SUCCESS';
} else {
$errors = '';
foreach ($user->getErrors()->getMessages() as $error) {
$errors .= implode(", ",$error);
}
$summary['note'] = $snipeUser->getDN().' was not imported. REASON: '.$errors;
$summary['status'] = 'ERROR';
}
$summary['note'] = $snipeUser->getDN().' was not imported. REASON: '.$errors;
$summary['status'] = 'ERROR';
} else {
$summary = null;
}
}
// $summary['note'] = ($user->getOriginal('username') ? 'UPDATED' : 'CREATED'); // this seems, kinda, like, superfluous, relative to the $summary['note'] thing above, yeah?
$this->summary->push($summary);
if($summary) { //if the $user wasn't dirty, $summary was set to null so that we will skip the following push()
$this->summary->push($summary);
}
}
/**

View file

@ -49,6 +49,7 @@ class ReportsController extends Controller
'created_at',
'target_id',
'user_id',
'accept_signature',
'action_type',
'note'
];

View file

@ -113,7 +113,7 @@ class ActionlogsTransformer
] : null,
'note' => ($actionlog->note) ? e($actionlog->note): null,
'signature_file' => ($actionlog->signature_filename) ? route('log.signature.view', ['filename' => $actionlog->signature_filename ]) : null,
'signature_file' => ($actionlog->accept_signature) ? route('log.signature.view', ['filename' => $actionlog->accept_signature ]) : null,
'log_meta' => ((isset($clean_meta)) && (is_array($clean_meta))) ? $clean_meta: null,
'action_date' => ($actionlog->action_date) ? Helper::getFormattedDateObject($actionlog->action_date, 'datetime'): null,

View file

@ -144,6 +144,10 @@ a, a:link, a:visited, .btn-primary.hover {
#assetsListingTable>tbody>tr.selected>td {
background-color: var(--back-main);
}
#assetsListingTable>tbody>tr>td {
color: var(--link);
}
body {
color: var(--text-main);
}
@ -201,6 +205,13 @@ body {
background-color: var(--back-main);
color: var(--text-main);
}
.dynamic-form-row{
color: @green;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: var(--header);
}
.form-control {
background-color: var(--back-main);
color: var(--text-main);
@ -219,6 +230,9 @@ input[type=text], input[type=search] {
background-color: var(--back-sub)!important;
color: var(--text-main);
}
li.select2-results__option{
color:@green;
}
#licensesTable>tbody>tr>td>nobr>a>i.fa {
color: var(--text-main);
}
@ -293,7 +307,9 @@ input[type=text], input[type=search] {
#webui>div>div>div>div>div>table>tbody>tr>td>a>i.fa {
color: var(--text-main);
}
#webui>#app>.row>.col-md-12>.box>.box-body>.row>.col-md-12 {
color:@green;
}
a {
color: var(--link);
&:link {
@ -333,4 +349,3 @@ a {
border-top: 1px solid #dddddd;
display: table-cell;
}