Hi,
I have setup a multilingual site using Kirby 3 (3.0.3), and the Thinking3 theme.
The theme developer has provided me with a patch to make the theme multilingual as well.
Now I would like to restrict access to the blog page and it’s articles, so I can make these availabe for members only.
I have followed the access restriction guide and the login page is loading. However, login from the front-end does not seem to work.
I enabled debugging, and I get an error on the username (email address)
Also a note: the debugger exposes the password in plaintext, which is not optimal for a production site.
/www/site/controllers/login.php
line 17: if ($user = $kirby->user(get('username')) && $user->login(get('password'))) {
error message: Error - Call to a member function login() on null
One thing I noticed about the above error is that the webroot /www/
is listed for the login controller.
Caching is not enabled.
- Any tips are welcome.
The login is available at unlisted page:
https://waucomont.eu/en/login
and also in the Dutch version of the site.
The Blog template has <?php if (!$kirby->user()) go('/') ?>
added at the very top of the blog template, and routes to /
if not logged in, so this is OK, but not very elegant.
- Is there a way to hide the Blog menu item for site visitors that have not logged in?
- Alternatively, is it possible to turn the login into a snippet, that I could display on the blog page, or in the sidebar, for non-logged in users only?
- If not I will change the redirect