many fixes and expands and module expansions

This commit is contained in:
Dennis Eichhorn 2021-04-04 17:10:52 +02:00
parent 8aa81419c7
commit d4b30e036f
3 changed files with 19 additions and 10 deletions

View File

@ -102,17 +102,17 @@ final class ApiController extends Controller
*
* @since 1.0.0
*/
public function apiProfileTempLoginCreate(Profile $profile, RequestAbstract $request) : void
public function apiProfileTempLoginCreate(Profile $profile, RequestAbstract $request, ResponseAbstract $response) : void
{
$account = AccountMapper::get($reqeust->header->account);
$account = AccountMapper::get($request->header->account);
$account->tempPassword = \password_hash(\random_bytes(64), \PASSWORD_DEFAULT);
$this->updateModel($request->header->account, $old, $profile, AccountMapper::class, 'profile', $request->getOrigin());
$this->updateModel($request->header->account, $account, $account, AccountMapper::class, 'profile', $request->getOrigin());
$this->fillJsonResponse(
$request, $response,
$status ? NotificationLevel::OK : NotificationLevel::WARNING,
'Profil',
NotificationLevel::OK,
'Profile',
'Temp password successfully created.',
$account->tempPassword
);

View File

@ -51,16 +51,25 @@ final class ProfileMapper extends DataMapperAbstract
* @since 1.0.0
*/
protected static array $ownsOne = [
'account' => [
'mapper' => AccountMapper::class,
'external' => 'profile_account_account',
],
'image' => [
'mapper' => MediaMapper::class,
'external' => 'profile_account_image',
],
];
/**
* Belongs to.
*
* @var array<string, array{mapper:string, external:string}>
* @since 1.0.0
*/
protected static array $belongsTo = [
'account' => [
'mapper' => AccountMapper::class,
'external' => 'profile_account_account',
],
];
/**
* Has many relation.
*

View File

@ -17,7 +17,7 @@
data-emptyAfter="true"
data-autocomplete="off"
data-src="api/admin/find/accgrp?search={!#i<?= $this->getId(); ?>}">
<div id="<?= $this->getId(); ?>-dropdown" class="dropdown" data-active="true">
<div id="<?= $this->getId(); ?>-popup" class="popup" data-active="true">
<table class="default">
<thead>
<tr>