fix billing process

This commit is contained in:
Dennis Eichhorn 2023-04-08 04:36:26 +02:00
parent b0fd52b651
commit 9eb8b8e7d6
4 changed files with 21 additions and 17 deletions

View File

@ -8,9 +8,11 @@ assignees: ''
--- ---
# Bug Description # Bug Description
A clear and concise description of what the bug is. A clear and concise description of what the bug is.
# How to Reproduce # How to Reproduce
Steps to reproduce the behavior: Steps to reproduce the behavior:
1. Go to '...' 1. Go to '...'
@ -19,16 +21,20 @@ Steps to reproduce the behavior:
4. See error 4. See error
# Expected Behavior # Expected Behavior
A clear and concise description of what you expected to happen. A clear and concise description of what you expected to happen.
# Screenshots # Screenshots
If applicable, add screenshots to help explain your problem. If applicable, add screenshots to help explain your problem.
# System Information # System Information
- System: [e.g. PC or iPhone11, ...]
- OS: [e.g. iOS] - System: [e.g. PC or iPhone11, ...]
- Browser [e.g. chrome, safari] - OS: [e.g. iOS]
- KarakaVersion [e.g. 22] - Browser [e.g. chrome, safari]
- KarakaVersion [e.g. 22]
# Additional Information # Additional Information
Add any other context about the problem here. Add any other context about the problem here.

View File

@ -178,18 +178,14 @@ final class Application
if (!($account instanceof NullAccount)) { if (!($account instanceof NullAccount)) {
$response->header->l11n = $account->l11n; $response->header->l11n = $account->l11n;
} elseif ($this->app->sessionManager->get('language') !== null) { } elseif ($this->app->sessionManager->get('language') !== null
&& $response->header->l11n->getLanguage() !== $this->app->sessionManager->get('language')
) {
$response->header->l11n $response->header->l11n
->loadFromLanguage( ->loadFromLanguage(
$this->app->sessionManager->get('language'), $this->app->sessionManager->get('language'),
$this->app->sessionManager->get('country') ?? '*' $this->app->sessionManager->get('country') ?? '*'
); );
} elseif ($this->app->cookieJar->get('language') !== null) {
$response->header->l11n
->loadFromLanguage(
$this->app->cookieJar->get('language'),
$this->app->cookieJar->get('country') ?? '*'
);
} }
UriFactory::setQuery('/lang', $response->getLanguage()); UriFactory::setQuery('/lang', $response->getLanguage());
@ -212,7 +208,7 @@ final class Application
} }
/* No reading permission */ /* No reading permission */
if (!$account->hasPermission(PermissionType::READ, $this->app->unitId, $this->app->appName, 'Dashboard')) { if (!$account->hasPermission(PermissionType::READ, $this->app->unitId, $this->app->appId, 'Dashboard')) {
$this->create403Response($response, $pageView); $this->create403Response($response, $pageView);
return; return;
@ -226,7 +222,7 @@ final class Application
$request->uri->getRoute(), $request->uri->getRoute(),
$request->getDataString('CSRF'), $request->getDataString('CSRF'),
$request->getRouteVerb(), $request->getRouteVerb(),
$this->app->appName, $this->app->appId,
$this->app->unitId, $this->app->unitId,
$account, $account,
$request->getData() $request->getData()

View File

@ -47,7 +47,9 @@ export class Application {
this.request.setRootPath( this.request.setRootPath(
HttpUri.parseUrl( HttpUri.parseUrl(
document.getElementsByTagName('base')[0].href typeof document.getElementsByTagName('base')[0] !== 'undefined'
? document.getElementsByTagName('base')[0].href
: ''
).path ).path
); );

View File

@ -57,7 +57,7 @@ final class ApiController extends Controller
public function apiSessionCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void public function apiSessionCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
{ {
if ($request->hasData('account') && !$this->app->accountManager->get($request->header->account)->hasPermission( if ($request->hasData('account') && !$this->app->accountManager->get($request->header->account)->hasPermission(
PermissionType::CREATE, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::SESSION_FOREIGN PermissionType::CREATE, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::SESSION_FOREIGN
)) { )) {
$response->header->status = RequestStatusCode::R_403; $response->header->status = RequestStatusCode::R_403;
@ -153,7 +153,7 @@ final class ApiController extends Controller
if ($request->hasData('account') && ((int) $request->getData('account')) !== $request->header->account if ($request->hasData('account') && ((int) $request->getData('account')) !== $request->header->account
) { ) {
if (!$this->app->accountManager->get($request->header->account)->hasPermission( if (!$this->app->accountManager->get($request->header->account)->hasPermission(
PermissionType::CREATE, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::SESSION_ELEMENT_FOREIGN PermissionType::CREATE, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::SESSION_ELEMENT_FOREIGN
)) { )) {
$response->header->status = RequestStatusCode::R_403; $response->header->status = RequestStatusCode::R_403;
@ -195,7 +195,7 @@ final class ApiController extends Controller
private function validateSessionElementCreate(RequestAbstract $request) : array private function validateSessionElementCreate(RequestAbstract $request) : array
{ {
$val = []; $val = [];
if (($val['session'] = empty($request->getData('session')) || !\is_numeric($request->getData('session')))) { if (($val['session'] = !$request->hasData('session') || !\is_numeric($request->getData('session')))) {
return $val; return $val;
} }