admin add confirm user + show original media info when not meet the standard

This commit is contained in:
xiaomlove
2022-07-05 03:02:33 +08:00
parent ea94c0f738
commit 147cf6db71
6 changed files with 24 additions and 3 deletions

View File

@@ -45,6 +45,9 @@ class UserProfile extends Page
if ($this->record->two_step_secret) {
$actions[] = $this->buildDisableTwoStepAuthenticationAction();
}
if ($this->record->status == User::STATUS_PENDING) {
$actions[] = $this->buildConfirmAction();
}
$actions[] = $this->buildResetPasswordAction();
$actions[] = $this->buildAssignExamAction();
$actions[] = $this->buildGrantMedalAction();
@@ -204,6 +207,20 @@ class UserProfile extends Page
});
}
private function buildConfirmAction()
{
return Actions\Action::make(__('admin.resources.user.actions.confirm_btn'))
->modalHeading(__('admin.resources.user.actions.confirm_btn'))
->requiresConfirmation()
->action(function () {
$this->record->status = User::STATUS_CONFIRMED;
$this->record->info= null;
$this->record->save();
$this->notify('success', 'Success!');
$this->emitSelf(self::EVENT_RECORD_UPDATED, $this->record->id);
});
}