Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

User-based pages via login-plugin

Started by Muut Archive 11 years ago · 1 replies · 530 views
11 years ago

I am planning to create pages which are accessable only after login and to certain users.

For example:
User 'Alex' logs in and gets forwarded to 'user.php' which gets configured to Alex
User 'Julia' logs in and gets forwarded to 'user.php' which gets configured to Julia
...

Can this be done with Grav in conjunction with the already available login plugin? I am new to Grav, just been through the installation routines and now evaluating if it can fulfil the requirements.

Thanks in advance for any comments.

11 years ago

Yes this can be done. I suggest you install the Admin Plugin as it includes the Login Plugin (currently v 1.0.2), Create your user accounts allowing them site access and set the Login Plugin option 'Redirect after login' to point to the users page. Note that this can or should be a normal page you create in Grav, not a php file like 'user.php'. In the user page's template you can find out which user is logged in using the Twig variable "grav.user.username".

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1352 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4063 9 years ago
Archive · by Muut Archive, 9 years ago
1 2949 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago