mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-02-14 19:48:41 +00:00
Implement tests
This commit is contained in:
parent
a62a8d3507
commit
56eded102a
|
|
@ -370,16 +370,12 @@ final class ApiController extends Controller
|
||||||
if (((string) ($request->getData('password') ?? '')) !== ''
|
if (((string) ($request->getData('password') ?? '')) !== ''
|
||||||
&& ((string) ($request->getData('login') ?? '')) !== ''
|
&& ((string) ($request->getData('login') ?? '')) !== ''
|
||||||
) {
|
) {
|
||||||
$this->app->moduleManager->get('Profile')->apiProfileCreateDbEntry(new \Modules\Profile\Models\Profile($account));
|
$this->app->moduleManager->get('Profile')->apiProfileCreateDbEntry(new \Modules\Profile\Models\Profile($account), $request);
|
||||||
|
|
||||||
$this->app->eventManager->trigger('PRE:Module:Admin-account-update', '', $account);
|
$this->updateModel($request, $account, $account, function() use($account) {
|
||||||
$account->setLoginTries((int) $this->app->appSettings->get(Settings::LOGIN_TRIES));
|
$account->setLoginTries((int) $this->app->appSettings->get(Settings::LOGIN_TRIES));
|
||||||
AccountMapper::update($account);
|
AccountMapper::update($account);
|
||||||
$this->app->eventManager->trigger('POST:Module:Admin-account-update', '', [
|
}, 'account');
|
||||||
$request->getHeader()->getAccount(),
|
|
||||||
null,
|
|
||||||
$account,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -404,8 +400,6 @@ final class ApiController extends Controller
|
||||||
$account->setEmail((string) ($request->getData('email') ?? ''));
|
$account->setEmail((string) ($request->getData('email') ?? ''));
|
||||||
$account->generatePassword((string) ($request->getData('password') ?? ''));
|
$account->generatePassword((string) ($request->getData('password') ?? ''));
|
||||||
|
|
||||||
// todo: set remaining login tries based on global default config here. but before you have to add it to the model and mapper
|
|
||||||
|
|
||||||
return $account;
|
return $account;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user