All Projects → kerli81 → kirby-securedpages

kerli81 / kirby-securedpages

Licence: MIT license
Protect pages for authenticated users

Programming Languages

PHP
23972 projects - #3 most used programming language
SCSS
7915 projects

Projects that are alternatives of or similar to kirby-securedpages

kirby3-many-to-many-field
This plugin allows you to create many-to-many relationships between pages in Kirby and synchronizes them on both sides.
Stars: ✭ 38 (+35.71%)
Mutual labels:  kirby-cms, kirby-plugin, kirby3
laravel-mix-kirby
Laravel Mix helper for Kirby
Stars: ✭ 23 (-17.86%)
Mutual labels:  kirby-cms, kirby-plugin, kirby3
kirby-minify-html
Enable minify HTML output for Kirby 3
Stars: ✭ 27 (-3.57%)
Mutual labels:  kirby-cms, kirby-plugin, kirby3
kirby-highlight
Themeable server-side syntax highlighting for Kirby
Stars: ✭ 14 (-50%)
Mutual labels:  kirby-cms, kirby-plugin
kirby-podcast
A KirbyCMS-Podcast-Plugin
Stars: ✭ 22 (-21.43%)
Mutual labels:  kirby-cms, kirby-plugin
kirby-html-minifier
Minify the html output of a site built with Kirby CMS
Stars: ✭ 20 (-28.57%)
Mutual labels:  kirby-cms, kirby-plugin
vuekit
Kirby 3 + Vue.js kit
Stars: ✭ 16 (-42.86%)
Mutual labels:  kirby-cms, kirby3
kirby-markdown-field
Super-sophisticated markdown editor for Kirby 3, community built.
Stars: ✭ 143 (+410.71%)
Mutual labels:  kirby-cms, kirby-plugin
kirby3-similar
Find similar collection items based on similarity
Stars: ✭ 16 (-42.86%)
Mutual labels:  kirby-cms, kirby3
kirby-blade
Enable Laravel Blade Template Engine for Kirby 3
Stars: ✭ 20 (-28.57%)
Mutual labels:  kirby-cms, kirby-plugin
kirby-boiler-field
Boilerplate for Kirby form fields
Stars: ✭ 15 (-46.43%)
Mutual labels:  kirby-cms, kirby-plugin
retour-for-kirby
Kirby 3 plugin to manage redirects and track 404s right from the Panel
Stars: ✭ 96 (+242.86%)
Mutual labels:  kirby-cms, kirby-plugin
kirbyup
🆙 Zero-config bundler for Kirby Panel plugins
Stars: ✭ 33 (+17.86%)
Mutual labels:  kirby-cms, kirby-plugin
content-viewer
A nifty little Kirby widget that allows you to show a block of Kirbytext or Markdown content in Kirby's panel.
Stars: ✭ 16 (-42.86%)
Mutual labels:  kirby-cms, kirby-plugin
field-engineer
A Kirby field for complex field structures.
Stars: ✭ 49 (+75%)
Mutual labels:  kirby-cms, kirby-plugin
search-for-kirby
Kirby 3 plugin for adding a search index (sqlite or Algolia).
Stars: ✭ 42 (+50%)
Mutual labels:  kirby-cms, kirby-plugin
kirby-membership
Simple Membership plugin for Kirby CMS
Stars: ✭ 27 (-3.57%)
Mutual labels:  kirby-cms, kirby-plugin
kirby-blade-template
⬢ Laravel Blade template component for Kirby CMS.
Stars: ✭ 26 (-7.14%)
Mutual labels:  kirby-cms, kirby-plugin
monochrome
A fully responsive Kirby CMS theme
Stars: ✭ 27 (-3.57%)
Mutual labels:  kirby-cms
kirby-git
Kirby plugin for updating content in the panel via Git
Stars: ✭ 75 (+167.86%)
Mutual labels:  kirby-cms

Kirby Secured Pages

Version License Kirby

With this plugin for Kirby CMS you can prevent unauthorized users to access a page or a hierarchy of pages. The permission will be granted by a user group. If the user is not yet logged in, a login page will be displayed.

Requirements

  • Kirby CMS, Version 3.x

Installation

Download

Download and extract this repository, rename the folder to securedpages and drop it into the plugins folder of your Kirby 3 installation. You should end up with a folder structure like this:

site/plugins/securedpages/

Composer

If you are using Composer, you can install the plugin with

composer require kerli81/securedpages

Git submodule

git submodule add https://github.com/kerli81/kerby-securedpages.git site/plugins/securedpages

Usage

Blueprint

To enable the configuration for the page security your blueprint needs to include the security field. Here an example ho such a page blueprint could look like.

title: Protected Page

columns:
  # main
  - width: 2/3
    sections:
      content:
        type: fields
        fields:
          text:
            text:
            type: textarea
            size: large

  # sidebar
  - width: 1/3
    sections:
        securityconfig:
            type: fields
            fields:
                security: fields/kerli81.securedpages.pageconfiguration
        pages:
            type: pages
        files:
            type: files

Template

User Group

The plugin will check if a user is part of a certain user group. To create such a group, create a *.yml file in folder blueprints/users/. You will find below an example of a group definition.

title: Webpage Access
description: Usergroup for frontend access

permissions:
  access:
    panel: false

To use the group create a new user on the panel.

Secure a page incl. sub pages

Go to the page which you will protected and enable the protection. After you enabled it a user group selction field will be displayed. Select the just defined group.

Protection Configuration

Options

Default Behavior

If you navigate to a page which is protected and you are not logged in or your user is not part of the correct user group, your request is forwarded to /no-permission. On this page a login form will be displayed. After correct login you will be forward to your requested page.

Adjust texts of default behavior

to adjust the texts just override the provided options:

Option Default Description
kerli81.securedpages.loginform.username.name Username Name of the field 'username'
kerli81.securedpages.loginform.username.error Please enter your username Error message for the field 'username'
kerli81.securedpages.loginform.password.name Password Name of the field 'password'
kerli81.securedpages.loginform.password.error Please enter your password Error message for the field 'password'

Login Form

display another error page

If you would like to show your custom error page, just update following options:

Option Value Description
kerli81.securedpages.logintype custom Will trigger the page to display. Possible values are: [loginform, custom]
kerli81.securedpages.custom.page --- The url (url-slug) to navigate to.

Filter the pages (i.e. in search)

If you do some search and would like to filter the collection of pages, you could filter them like this:

$results = $site->index()->listed()->filterBy('kerli81-securedpages', 'OnlyUserVisiblePages');

This example will return only the pages, which are accessable by the current user.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].