mirror of
https://github.com/typemill/typemill.git
synced 2025-07-30 19:00:32 +02:00
V2.4.2 added guest role for loginlink
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -307,7 +307,7 @@ class ControllerWebAuth extends Controller
|
||||
|
||||
$userdata = $user->getUserData();
|
||||
|
||||
if($userdata['userrole'] != 'member')
|
||||
if($userdata['userrole'] != 'guest')
|
||||
{
|
||||
if($securitylog)
|
||||
{
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -1,3 +1,9 @@
|
||||
guest:
|
||||
name: guest
|
||||
inherits: NULL
|
||||
permissions:
|
||||
account:
|
||||
- 'none'
|
||||
member:
|
||||
name: member
|
||||
inherits: NULL
|
||||
|
@@ -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)"
|
Reference in New Issue
Block a user