Download the PHP package johannschopplich/kirby-locked-pages without Composer

On this page you can find all versions of the php package johannschopplich/kirby-locked-pages. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kirby-locked-pages

Kirby Locked Pages

Protect pages that you want to hide from unwanted views with a password.

Key Features

Requirements

Installation

Composer

Download

Download and copy this repository to /site/plugins/kirby-locked-pages.

Usage

When a locked page is visited, Kirby will redirect to a login form (virtual page), where a password may be entered. Once the user enters the correct password, he will be redirected back to the page URL which was locked before.

The user session also records that this page is now unlocked for further requests. After the session expires, the user has to enter a password again.

Configuration

See the list of available options below.

Blueprints

Add the protection field group to a page blueprint, which shall be lockable by password:

The field group fields/locked-pages is registered globally by the plugin.

ℹ️ Note: The error page is not lockable. Although it is possible to add the fields, they will have no effect.

Templates

You probably want to customize the template which will show the password form. The template provided is suited to be used as-is, but you are welcome to create a locked-pages-login.php template inside your site/templates folder. The plugin's included template may be used as a starting point.

Once you've defined a custom template, Kirby will automatically use the one you've created rather than the one included by the plugin.

Logout Hook

It is often helpful and good UX to provide the user a way of logging out. You can use a custom Kirby hook for this use-case.

Trigger the locked-pages.logout hook to clear the user's plugin session data. Once logged out, he will have to enter the password again.

Options

All options are namespaced under johannschopplich.locked-pages.

Option  Default Description
slug locked Slug for login form (absolute to the site URL).
template locked-pages-login Optional name of custom template (has to be created manually).
title Page locked Title of the login form.
error.csrf The CSRF token is invalid Error message for invalid CSRF.
error.password The password is incorrect Error message for invalid password.

All of the error options have to be wrapped in an array.

To give an example for your config.php:

Credits

License

Johann Schopplich


All versions of kirby-locked-pages with dependencies

PHP Build Version
Package Version
Requires getkirby/composer-installer Version ^1.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package johannschopplich/kirby-locked-pages contains the following files

Loading the files please wait ....