diff --git a/data/security/securitylog.txt b/data/security/securitylog.txt index e027179..bdaefc4 100644 --- a/data/security/securitylog.txt +++ b/data/security/securitylog.txt @@ -2,3 +2,4 @@ 127.0.0.1;2024-04-20 12:51:39;login: wrong password 127.0.0.1;2024-04-21 19:24:11;login: invalid data 127.0.0.1;2024-04-22 14:38:20;loginlink: loginlink for user member is not activated. +127.0.0.1;2024-04-23 11:16:24;loginlink: invalid data diff --git a/system/typemill/Controllers/ControllerApiSystemUsers.php b/system/typemill/Controllers/ControllerApiSystemUsers.php index ef15f70..6e0a2a7 100644 --- a/system/typemill/Controllers/ControllerApiSystemUsers.php +++ b/system/typemill/Controllers/ControllerApiSystemUsers.php @@ -223,7 +223,7 @@ class ControllerApiSystemUsers extends Controller # check if loginlink is activated $loginlink = false; - if($userdata['userrole'] == 'member' && isset($this->settings['loginlink']) && $this->settings['loginlink']) + if($userdata['userrole'] == 'guest' && isset($this->settings['loginlink']) && $this->settings['loginlink']) { $loginlink = true; } diff --git a/system/typemill/Controllers/ControllerWebAuth.php b/system/typemill/Controllers/ControllerWebAuth.php index 5f2ff28..8a27fbc 100644 --- a/system/typemill/Controllers/ControllerWebAuth.php +++ b/system/typemill/Controllers/ControllerWebAuth.php @@ -307,7 +307,7 @@ class ControllerWebAuth extends Controller $userdata = $user->getUserData(); - if($userdata['userrole'] != 'member') + if($userdata['userrole'] != 'guest') { if($securitylog) { diff --git a/system/typemill/Controllers/ControllerWebSystem.php b/system/typemill/Controllers/ControllerWebSystem.php index 9db44fa..e182a65 100644 --- a/system/typemill/Controllers/ControllerWebSystem.php +++ b/system/typemill/Controllers/ControllerWebSystem.php @@ -362,7 +362,7 @@ class ControllerWebSystem extends Controller $userdata = $user->getUserData(); $inspector = $request->getAttribute('c_userrole'); $loginlink = false; - if($userdata['userrole'] == 'member' && isset($this->settings['loginlink']) && $this->settings['loginlink']) + if($userdata['userrole'] == 'guest' && isset($this->settings['loginlink']) && $this->settings['loginlink']) { $loginlink = true; } diff --git a/system/typemill/Middleware/WebAuthorization.php b/system/typemill/Middleware/WebAuthorization.php index c7ccf15..da44d89 100644 --- a/system/typemill/Middleware/WebAuthorization.php +++ b/system/typemill/Middleware/WebAuthorization.php @@ -28,14 +28,12 @@ class WebAuthorization implements MiddlewareInterface } public function process(Request $request, RequestHandler $handler) :Response - { - $test = $this->acl->isAllowed($request->getAttribute('c_userrole'), $this->resource, $this->action); - + { if(!$this->acl->isAllowed($request->getAttribute('c_userrole'), $this->resource, $this->action)) { $response = new Response(); - return $response->withHeader('Location', $this->router->urlFor('user.account'))->withStatus(302); + return $response->withHeader('Location', $this->router->urlFor('home'))->withStatus(302); } $response = $handler->handle($request); diff --git a/system/typemill/settings/permissions.yaml b/system/typemill/settings/permissions.yaml index eee294d..22051a8 100644 --- a/system/typemill/settings/permissions.yaml +++ b/system/typemill/settings/permissions.yaml @@ -1,3 +1,9 @@ +guest: + name: guest + inherits: NULL + permissions: + account: + - 'none' member: name: member inherits: NULL diff --git a/system/typemill/settings/system.yaml b/system/typemill/settings/system.yaml index 46971bb..dd41ceb 100644 --- a/system/typemill/settings/system.yaml +++ b/system/typemill/settings/system.yaml @@ -292,8 +292,8 @@ fieldsetdeveloper: loginlink: type: checkbox label: "Login with link" - checkboxlabel: "Allow selected users to login with a login link." - description: "If activated, you can allow login-links with a checkbox in the user profile. This is only available for member-roles since members have very limited rights. Login with a link can be helpful if you link from your software to a non-public documentation. Be aware of the low protection that this kind of logins have. If you integrate such links in a SaaS-software, then you should restrict access to your ips." + checkboxlabel: "Allow selected guest-users to login with a login link." + description: "If activated, you can allow login-links with a checkbox in the user profile. This is only available for guest-roles since guests do not have any rights. Login with a link can be helpful if you link from your software to a non-public documentation. Be aware of the low protection that this kind of logins has. If you integrate such links in a SaaS-software, then you should restrict access with login-links to your ips." trustedloginreferrer: type: text label: "Trusted IPs for the login-link-referrer (comma separated)" \ No newline at end of file