diff --git a/Application/Timerecording/Application.php b/Application/Timerecording/Application.php index fad63c7..d8b1fc1 100755 --- a/Application/Timerecording/Application.php +++ b/Application/Timerecording/Application.php @@ -167,8 +167,8 @@ final class Application $this->app->accountManager = new AccountManager($this->app->sessionManager); $this->app->l11nServer = LocalizationMapper::get()->where('id', 1)->execute(); - $this->app->orgId = $this->getApplicationOrganization($request, $this->config); - $pageView->setData('orgId', $this->app->orgId); + $this->app->unitId = $this->getApplicationOrganization($request, $this->config); + $pageView->setData('unitId', $this->app->unitId); $aid = Auth::authenticate($this->app->sessionManager); $request->header->account = $aid; @@ -212,7 +212,7 @@ final class Application } /* No reading permission */ - if (!$account->hasPermission(PermissionType::READ, $this->app->orgId, $this->app->appName, 'Dashboard')) { + if (!$account->hasPermission(PermissionType::READ, $this->app->unitId, $this->app->appName, 'Dashboard')) { $this->create403Response($response, $pageView); return; @@ -227,7 +227,7 @@ final class Application $request->getData('CSRF'), $request->getRouteVerb(), $this->app->appName, - $this->app->orgId, + $this->app->unitId, $account, $request->getData() ), @@ -252,7 +252,7 @@ final class Application return (int) ( $request->getData('u') ?? ( $config['domains'][$request->uri->host]['org'] ?? $this->app->appSettings->get( - SettingsEnum::DEFAULT_ORGANIZATION + SettingsEnum::DEFAULT_UNIT ) ?? 1 ) ); diff --git a/Application/Timerecording/login.tpl.php b/Application/Timerecording/login.tpl.php index a82346c..51f57f2 100755 --- a/Application/Timerecording/login.tpl.php +++ b/Application/Timerecording/login.tpl.php @@ -262,13 +262,13 @@ $head = $this->getData('head');
- +
- +
diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 21c198c..7e78118 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -57,7 +57,7 @@ final class ApiController extends Controller public function apiSessionCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void { if ($request->getData('account') !== null && !$this->app->accountManager->get($request->header->account)->hasPermission( - PermissionType::CREATE, $this->app->orgId, $this->app->appName, self::NAME, PermissionCategory::SESSION_FOREIGN + PermissionType::CREATE, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::SESSION_FOREIGN )) { $response->header->status = RequestStatusCode::R_403; @@ -154,7 +154,7 @@ final class ApiController extends Controller if ($request->getData('account') !== null && ((int) $request->getData('account')) !== $request->header->account ) { if (!$this->app->accountManager->get($request->header->account)->hasPermission( - PermissionType::CREATE, $this->app->orgId, $this->app->appName, self::NAME, PermissionCategory::SESSION_ELEMENT_FOREIGN + PermissionType::CREATE, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::SESSION_ELEMENT_FOREIGN )) { $response->header->status = RequestStatusCode::R_403; diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index fa0aca1..1f3bf3c 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -58,7 +58,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase }; $this->app->dbPool = $GLOBALS['dbpool']; - $this->app->orgId = 1; + $this->app->unitId = 1; $this->app->accountManager = new AccountManager($GLOBALS['session']); $this->app->appSettings = new CoreSettings(); $this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/');